...

View Full Version : learning how php works



voodoo
07-15-2008, 06:08 AM
Hey, so i've been reading about php and learning the code but i need some help on clarifying how it works. I've done some c++ and java programming before so I have a pretty good sense of how to program. However I think I keep over complicating how html/php/mysql all work together.

So with a website that has an area for users to enter in information. this info is submitted and then php processes the information. so first question is the php code that processes this written in the same html document or is a php document called by the html document?

Once the information has been processed its saved into the database, right?
If the information is supposed to be posted somewhere on the website is that page a .php file or .html.

How is php used to get the information saved in the database to be posted on the webpage.


These questions all might be just basic knowledge of using php but like i said i'm just starting to learn php and want to get some things straight about it and know at least how it works even if i don't know how to code it yet.
thanks for any and all the help.

Bob42
07-15-2008, 08:57 AM
So with a website that has an area for users to enter in information. this info is submitted and then php processes the information. so first question is the php code that processes this written in the same html document or is a php document called by the html document?
Either way will work. If you are going to place the PHP code and the HTML in the same page, make sure that document has the .php extension.


Once the information has been processed its saved into the database, right?
You can store the information in a database if you wish. You can also store it in a text file.


If the information is supposed to be posted somewhere on the website is that page a .php file or .html.
.php because you would have to use PHP to display the information on the page.


How is php used to get the information saved in the database to be posted on the webpage.

You would have to use a mySQL query for that.



$query = mysql_query("SELECT * FROM table");


I hope this helps.

rafiki
07-15-2008, 12:20 PM
You can use .html extentions and just patch up your .htaccess?
Every php function has a manual page at www.php.net/function.(name) replace (name) with the actual name of the function.



EZ Archive Ads Plugin for vBulletin Copyright 2006 Computer Help Forum