[HOLDING YOUR HAND] How to start coding PHP

Status
Not open for further replies.

krazyjosh5

theres GOLD in dem tubes!
May 28, 2007
1,010
19
0
Step 1.) Setup a WAMP server (download: PHP5 APACHE MYSQL for Windows : install WAMP5)
Step 2.) When your WAMP server is installed, put it online (using the menu from the icon in the system tray).
Step 3.) Open C:\wamp\www (or wherever you installed it to) and create the following file named "phpinfo.php" in Notepad (use File->Save as.. and INCLUDE THE QUOTES IN THE FILENAME):
PHP:
<?php
phpinfo();
?>
Step 4.) Load up http: // localhost / phpinfo.php (without the spaces)
Step 5.) You should see a page similar to this. If so, congrats you wrote your first PHP script. Continue on. If not, go back to 1 and figure out what you did wrong.
test-php-installation.gif

Step 6.) Read and go thru this: PHP MySQL Tutorial (skip step 1 since you already installed WAMP)

I actually really like this website. Its pretty no-bullshit about what you need to know and teaching it to you. Plain design, straightforward tuts.
I think its just as good as any book will teach you, honestly.

Start from the 2 and work your way down to 11.


While you are coding:

Two bookmarks you should use are:
W3Schools Online Web Tutorials
Tizag Tutorials


And this is your PHP manual: PHP: PHP Manual - Manual
Get to know it and love it. When I'm coding PHP, I'm typically landing on that site anywhere from 2-20 times per hour. Everything that PHP can do is listed and defined on that site. Functions, inputs, outputs, syntax, everything. That is your bible.

Use the search in the top right. For example, here are your mysql functions:
PHP: mysql_query - Manual

Googling a PHP command usually works, too. Often times the first result in the SERPs is the PHP manual. And the comments in the PHP manual are often times very helpful, as well.

(MODS: I know I posted this already in Aequitas' thread but I thought this post came out so well that it deserved its own thread. If you think otherwise, please delete it.)
 
  • Like
Reactions: turbolapp


aaaaaaahhhh for me? You shouldn't have!

Thanks, This will come in handy.

+rep for taking pity on me. :D
 
WAMP server - Windows, Apache, MySQL, PHP
as in
LAMP server - Linux, Apache, MySQL, PHP

The Web server is Apache, the rest is OS, webserver, Database, programming language

::emp::
 
I thought it was some cultural (oh well) reference that I did not get.

meh, going to bed now.

::emp::
 
Josh, you do know that WAMP comes installed with a phpinfo built into the index.php right?

So, once you install WAMP... Simply point your browser to...
cPanel®

If the page comes up looking like the image Josh posted, then... WINNAR! Otherwise, go home because you suck

Heh yeah, I know. The purpose of that step, while fundamental, is to get the noobies to understand how it works and what goes where through doing. It answers the questions 'Where do I go to create PHP code?' Answer: Notepad/Text Editor. 'How do I 'make' PHP code into something usable?' Half-answer: Put it in the web root folder so you can... 'How do I view my PHP programs?' Open it in a browser... all achieved by just making a phpinfo script. Plus phpinfo looks cool for a first timer. One line of code and lots out output to gaze at. ;)

emp.. :D
 
Status
Not open for further replies.