|
||
Welcome to RoadDust's php tutorial. Here you will learn php fast and will master basic php code in no time Create a web page with php.Code a basic php script that displays "Hello World".If you wish to learn php basics, you are more than likely familiar with HTML syntax. If you are not familiar with HTML or don't know what it is, you must first learn HTML basics. Once you know your HTML basics, you are ready for this php basic tutorial. The following example php code is the php hello world code. As tradition would have it, your first php should display "Hello World". Here is the example of a web page with php. php syntax code example.In the above example, the php code was put within a "?" tag in the head portion of the HTML. However, php code can be inserted anywhere as long as it is between "?" tags and somewhere between either the head tags or the body tags. Copy and paste the above php hello world code into any text editor and save the file as "helloworld.php". It is very important that you save the file with the ".php" extension. The name of the file is not important. Depending on the text editor you are using, you should select the option "All files" instead of "txt files" as you are saving. Otherwise, you may wind up with a file name "helloworld.php.txt" which is not a PHP file it is a text file named "helloworld.php". Getting started with php basic tutorial.Learn php fast, start by downloading EasyPHP.
Php is a server side scripting language. Unlike JavaScript you cannot simply run a php script
through your web browser. Php must be run by a server. This is why testing the above
php hello world code can get a little tricky. To get you started I will recommend that you download
EasyPHP which, as its title suggests, makes PHP easy to run and test on your computer. The link
bellow allows you to download this free software from Download.com which is totally safe.
Php basic tutorial, using Easy PHP.Running the php code example with EasyPHP.During EasyPHP's installation a shortcut to EasyPHP will be created in your "Start/Programs/EasyPHP" directory. When you launch EasyPHP, an icon will appear in the system tray. If you click on this icon you will have access to several options. The following options may vary depending on your version of EasyPHP.
Now launch EasyPHP, click on the system tray icon, and click on the start/stop option. You are now running the server. You should see a little blinking light on the Big "E" of EasyPHP which means the server is running. To run the php code example of the php hello world code that I gave you above, all you have to do is put your PHP file in the "www" folder located in "c:/program files/easyPHP". Keep in mind that the EasyPHP folder will have a version number attached to it (EX: c:/program files/EasyPHP1-7). In this folder you will find a folder named "www". Put your PHP file in this folder. Next step is to click on the "Web local" option of your EasyPHP which will display the contents of your "www" folder. You could also type "http://localhost/" in your web browser for the same result. You can now display the "php hello world code" by double clicking on the helloworld.php file we created earlyer wich should be displayed on your screen. Depending on the version you should be looking at a bluish screen that says EasyPHP and shows links to the files in your "www" folder. Once you click on the "helloworld.php" file we created earlier you should get a web page that says "Hello World". Php hello world code, trouble shootingEasyPHP trouble shooting. Why is my EasyPHP server not working?
Is your EasyPHP running?
Further your PHP knowledge with php code examples.Php basic tutorial on how to learn php fast.Now that you know how to make a web page with php, you should further your PHP knowledge by learning more php syntax. You will see that coding in php goes far beyond the above php hello world code. I will add tons of PHP tutorial information in the near future as I update this page. I will include things such as php basics, php functions, making blogs with PHP and more. |
||