Working with
HTML & PHP
In this
section we learn some basic of PHP :
PHP is
hypertext Preprocessor .
Is server
side scripting language.
While working
with website : first execution of client side code then server side code.
<html>
<?php include ‘abc.htm’; ?>
<body>
<p>hi
hello</p>
</body>
</html>
In above
example shows Para which execute first then fetch server side code ie abc.htm
file code. If there is clear solution or clear code then all this works in 2 -3
second . remember website should load in maximum 3 -4 second or less.
|
HTML Code Execute first as its client side code
|
|
HTML + PHP
|
|
PHP Code server side execute
|
|
Browser display output
|
fig: shows how PHP Work with HTML.
Save file
with .php or .htm extension but in case
html or htm need add .htaccess file to root folder.
Remember php
not working directly in browser it need xampp or wamp like localhost or hosting
server.
Basic syntax
:
<?php
echo ‘hello
world’;
?>
In above
hello world is shown as output.
$ab => is
variable declaration syntax. No need int or str or var like add simply put $
symbol.
Variable also
used to add html code so that refer to other page or repeated in different location.
We see more detail in next blog.
Thanks for viewing blog send comment in case any query.