Ok Guys, Now What Is This PHP Thing ???

Status
Not open for further replies.

alib_i

Cyborg Agent
HTML pages are .... how to say .. DEAD.
you display whatever is saved on the .htm file

But, php pages can be alive ..
you can program them to display what you like ...

say you want to show how many people have visited you site
then you can use a php script for counting the number of hits ..
the counter increases by one everytime someone visits your webpage.
you can display the number of hits.

this kind of dynamic behaviour is not possible with html
but well there are other languages also that can produce dynamic pages ...
ex. ASP, Perl, etc.

PHP is found to be most userfriendly ..
 

#/bin/sh

Journeyman
PHP is a language for creating interactive web sites and is used on over 3.3 million web sites around the world. It was originally called "Personal Home Page Tools" when it was created in 1994 by Rasmus Lerdorf to keep track of who was looking at his online resume.

<html>
<head>
<title>My first PHP page</title>
</head>
<body>
This is normal HTML code
<?php

// PHP code goes here
?>

Back into normal HTML

</body>
</html>
In this example, we see that PHP code is signified by the use of the <?php to begin the PHP block and ?> to signify the end of the code block. Although this a completely acceptable method of encapsulating your PHP code there are many other ways that are all, as far as syntax is concerned, correct. Here are some other ways to mark PHP code blocks.
 

shehan9999

Broken In
think of it as a way of doing processing on the server side of a web connection.

php pages can do stuff what u cant with javascript/ vbscript, which only allow u to do processing on the clients machne.....

also the php code will not be displayed when the user opens the page containing the code. this is not possible with javascript/ vbscript.
 

Avtar9

Right off the assembly line
Hypertext Preprocessor.

It's a language far more versatile than HTML that can be used to create some dynamic web applications.
 

Deep

Version 2.0
DHTML - Client side language..you can not create forums or login systems or connect to database using HTMl because everything is done at client side i.e. browser..

PHP - It is server side language..it is used to create web applications like shopping carts, creating images (GD Library), forums...basically anything you can think of...

how does it work?

well its like...
php will query the server for data and then after fetching the data it will convert the same in HTML or whatever format you see..

for example...

to get data from this post...PHP may query mysql like foll

Code:
$sql="SELECT * FROM posts where post_id=6896";
$result = mysql_query($sql);
$fetch_data = mysql_fetch_row($result);
// rest will come here..

so basically this query is just asking databse to get records for specified post id...

and once it gets all details it i wll place all in html format..

so what you see in the source code is simple html not the code which is written to make html (i.e. the code i mentioned before)

i hope you got the point...

so in short if you want to learn php, learn html first because its the base for all web languages...

Regards
Deep
 

Deep

Version 2.0
amanwannalearn said:
where do you code PHP..like HTML can be done on notepad ..cand PHP also be coded on notepad..

no point in bumping old threads..please start new if you have questions...i am locking it...

Deep
 
Status
Not open for further replies.
Top Bottom