View Full Version : Basic explanation of PHP needed please
thejoeknows.com
April 2nd, 2008, 09:45 PM
I am very familiar with HTML but dont know where to start with php. i.e. what is a mySQL database? how do you set up PHP? what do you save the pages as? .php? Just basic ideas and answers needed please
thank you
-joey
joran420
April 2nd, 2008, 09:56 PM
donload WAMP and it will set up Apache local host with php5 and Mysql
mysql is a database program that runs on a server and you can use asp or php to communicate with it.
then make the pages they can be any extension as your server config will tell open .gif as php or open .php as php (typically its just .php, although some shared hosting .php = php4 and *.php5 = php5)
php files are essentially html pages that has some code that is proccessed on the server before the page is printed
<?php
echo "<title>My PAge</title>";
?>
would be the same as a html file that just contained
<title>myPAge</title>
that example isnt very helpful i know, since just printing a title isnt very helpful
but what if you wanted users to have custom titles
<?php
$title ="JoransPage";
echo "<title>$title</title>"
?>
little more usefull as whatever you set the title var to will be the page title
php is just a coding language(like actionscript or javascript or C++) the difference being javascript and actionscript are both executed on the client (on the computer looking at the page)
where php is a server side language (meaning the code is executed on the server not on the client)
say you had a file we'll call main.php
if you navigated to it
http://www.url.com/main.php?id=123
then in main you just had
<?php
echo $_REQUEST['id'];
?>
it would print 123 if you changed the id it would print different things(numbers or strings)
same example
http://www.url.com/main.php?title=jorans php page
<?php
echo "<title>".$_REQUEST['title']."</title>";
?>
and it would make the page title "jorans php page"
lexus
April 3rd, 2008, 10:24 AM
Just try freewebmasterhelp.com for start!
Be aware on some of their examples there are some small mistakes on their code (an ";" missing at the end of a line for example).. or there were at least nearly 2 years ago when i first visited their site!
Tottaly the BEST source for a beginner!
Then you can go on with tizag.com and w3schools.com!
After a week you will be able to develop some very decent scripts!
CU!
Stylistic Ninja
April 7th, 2008, 06:24 PM
tizag.com is incredibly useful.
nobody
April 7th, 2008, 06:37 PM
Or you could just stay here and read the ton of PHP tutorials we have here and tap into our ridiculously helpful PHP coding forum (that you're in).
Templarian
April 7th, 2008, 08:24 PM
tizag.com is incredibly useful.
I agree Tizag has amazing tutorials that keep it very simple and to the point none of that extra text.
Usually googling a question will take one to tizag for simple questions.
Powered by vBulletin® Version 4.1.10 Copyright © 2012 vBulletin Solutions, Inc. All rights reserved.