~PHP: Personal-Home-Page HyperText Preprocessor
~Server End code: Code that is executed on the server and gives the result to the webpage
~Dynamic Webpages: Pages that interact with the user (a login form)
Step 1: What You Need
The other thing that you need is a PHP/HTML editor. If you are running Windows (Like I am), I would suggest Notepad ++. It's a free HTML editor that has many file extensions, including PHP, so you can edit the files you create easily. It also will highlight and color the code, depending on what file extensions you use, so you can detect mistakes.If you are running Mac OS X or Linux, Komodo Edit is good. I'm not sure what editors there are for Solaris, so if you do know, please leave me a comment.
For Windows users, Notepad works fine, although I don't like to program in it, because of the lack of syntax hi-lighting.
Step 2: Install XAMPP
XAMPP for Linux
XAMPP for Windows
XAMPP for Mac OS X
XAMPP for Solaris
Depending on your operating system, click on the appropriate link. That should take you to a page that has the download files. Click on the Installer for Windows , the XAMPP Linux 1.7.4 for Linux , the XAMPP Mac OS X 1.7.3 for Mac , and the XAMPP Solaris 1.7.4 for Solaris .
On the download page, there should be instructions on how to download, install, and run XAMPP.
IMPORTANT: Be sure to download Apache and MySQL when it prompts you to!
Step 3: Echo
echo "Hello Instructables community!";
This code, with the echo statement, will simply display the words 'Hello Instructables community!' on an otherwise empty webpage. But before you can run the code, you must make sure that it is saved in the right location. To run it, go to your web browser, and type in this: http://localhost/xampp/echo.php into the URL search box. You should see the result of your code: the words 'Hello Instructables community' in the web browser. If not, check to make sure that all you code is correct, and that it is saved in the right place.
Step 4: Using Variables
$str = "RandomText jdsfbjsfgbfsnvfkjjjvm,nbvjbfbmhgggggggggggggvffgxc;"
Now the webpage reads Random Text etc. This isn't very helpful in this situation, but say you needed to repeat the variable over and over. It would be a lot easier to write $str that the actual text.
Variables can store numbers, as mentioned above. This means that they can do math. Example:
$num = 5.4;
$numb = 1.6;
echo $num + $numb;
The webpage now says 7. Another useful thing with variables is that to add multiple variables together (the text way, not the math), you can use a period between the variables. Instead of saying
echo $num + $numb;
you would say
This would display
Instead of 7. This works with text to.
Step 5: Information Files