the 1st right answer will be marked as brilient answer!
A short note on php programming about 100 -200 words?
Answers
Answered by
3
PHP is the very basics of PHP in a short, simple tutorial. This text only deals with dynamic web page creation with PHP, though PHP is not only capable of creating web pages. See the section titled What can PHP do for more information.
PHP-enabled web pages are treated just like regular HTML pages and you can create and edit them the same way you normally create regular HTML pages.
PHP-enabled web pages are treated just like regular HTML pages and you can create and edit them the same way you normally create regular HTML pages.
ridhaqazi:
it is not of 200 words
Answered by
1
Chapter 3. Simple programs
3.1. A first program
Let us begin with a very simple PHP program. Create a file (named random.php perhaps) that says the following.
<html>
<head><title>Random number</title></head>
<body>
<p>I have chosen <?php
echo rand(1, 100);
?>.</p>
</body>
</html>
You can install it on the Web server; if the Web server supports PHP, then when you load it into your Web browser you'll see something like the following.
I have chosen 47.
Let's try to make sense of this simple program. The first thing you'll notice is that our PHP program is basically HTML. In fact, when the Web server sees a PHP file, it sends the page to the Web browser verbatim until it finds the character sequence <?php. Thus, when the browser requests the file, the server starts to read through the file and simply sends each character along to it; but when it sees the five-character sequence <?php, it thinks, Uh-oh. Here comes some PHP that tells me that I have to do some work before sending any more information to the browser.
In this program, the server would see the statementecho rand(1, 100);, which as we'll see later means that the Web server should send a random number between 1 and 100 to the browser. Then it sees ?>, whereupon the server thinks, Whew! I'm past all that work. Now I can go back to sending characters without having to think about it. So it goes along.
The overall result of the above process is that when a Web browser accesses the Web page, the server actually sends the following HTML to the browser.
<html>
<head><title>Random Number</title></head>
<body>
<p>I have chosen 47.</p>
</body>
</html>
Notice that the Web page that the browser receives straight HTML, just as if the Web page were a simple HTML file. Because the browser never sees any PHP, there is no reason for us as PHP programmers to worry about browser support: As long as the browser supports HTML, it will be able to read our PHP pages. (This is not true of pages using client-side programming technologies, such as JavaScript or Flash, where Web browsers will need to be able to read those programs in addition to regular HTML.)
I hope this answer Is correct
Mark as a brainlist plz
3.1. A first program
Let us begin with a very simple PHP program. Create a file (named random.php perhaps) that says the following.
<html>
<head><title>Random number</title></head>
<body>
<p>I have chosen <?php
echo rand(1, 100);
?>.</p>
</body>
</html>
You can install it on the Web server; if the Web server supports PHP, then when you load it into your Web browser you'll see something like the following.
I have chosen 47.
Let's try to make sense of this simple program. The first thing you'll notice is that our PHP program is basically HTML. In fact, when the Web server sees a PHP file, it sends the page to the Web browser verbatim until it finds the character sequence <?php. Thus, when the browser requests the file, the server starts to read through the file and simply sends each character along to it; but when it sees the five-character sequence <?php, it thinks, Uh-oh. Here comes some PHP that tells me that I have to do some work before sending any more information to the browser.
In this program, the server would see the statementecho rand(1, 100);, which as we'll see later means that the Web server should send a random number between 1 and 100 to the browser. Then it sees ?>, whereupon the server thinks, Whew! I'm past all that work. Now I can go back to sending characters without having to think about it. So it goes along.
The overall result of the above process is that when a Web browser accesses the Web page, the server actually sends the following HTML to the browser.
<html>
<head><title>Random Number</title></head>
<body>
<p>I have chosen 47.</p>
</body>
</html>
Notice that the Web page that the browser receives straight HTML, just as if the Web page were a simple HTML file. Because the browser never sees any PHP, there is no reason for us as PHP programmers to worry about browser support: As long as the browser supports HTML, it will be able to read our PHP pages. (This is not true of pages using client-side programming technologies, such as JavaScript or Flash, where Web browsers will need to be able to read those programs in addition to regular HTML.)
I hope this answer Is correct
Mark as a brainlist plz
Similar questions