Peer-to-peer sharing for home and business
Home
Products
News
Help Center
Download
About BadBlue


Help >> Tutorial Center >> Write your first PHP script

BadBlue Discussion     Email support
Tutorial: Write your first PHP script

Ready to write your first PHP script? Let's get started.

Important: please make sure you've used the PHP Installation Tutorial and verified that PHP was installed correctly.
Step 1

Run the Windows Notepad program. For example, use Start >> Run >> and type Notepad and press the OK button.

Step 2

Enter the following text into Notepad. You can copy and paste it if you'd like.


   <html><body>
   <?php
   echo("Hello, world!");
   ?>
   </body></html>


Step 3

From Notepad, use File >> Save as and save the file as test.php in the BadBlue installation folder. For example, if you use BadBlue Personal Edition and performed an installation to the default folder, save the test script as:

c:\program files\badblue\pe\test.php

Step 4

Important: use Windows Explorer and make sure the file you saved has a php type (file extension) associated with it. On some versions of Notepad, a type of txt is always assigned. Use Windows Explorer to rename the file from test.php.txt to test.php if necessary.

Step 5

If BadBlue is not running, start it - or if it's running, use the system tray icon (pictured at right) and select Main menu.

Step 6

In your web browser's address bar, remove everything after the hostname and the slash and enter test.php, for example:

http://127.0.0.1/test.php

The Hello, World! message should appear. Congratulations! You just created your first working PHP script!

Need more info on PHP?

For more information on PHP, please visit our PHP Help Center, which includes links to popular PHP resources as well as PHP Books and References.


Next steps

Tutorials
More Tutorials
Buy Now!
Buy now
Download
Free download