Presentation is loading. Please wait.

Presentation is loading. Please wait.

Lab 1 Hello World in PHP CSN Class Lab Activity No. 1.

Similar presentations


Presentation on theme: "Lab 1 Hello World in PHP CSN Class Lab Activity No. 1."— Presentation transcript:

1 Lab 1 Hello World in PHP CSN Class Lab Activity No. 1

2 Lab 1 – Hello World 1. Install XAMPP on your computer 2. Open the XAMPP control panel and start the Apache service (C:\xampp\xampp- control.exe) 3. Click the Admin button. XAMPP will start the browser and open localhost/xampp. 4. For new installation, click the Language preferred (English) 5. Click the phpinfo() link 6. Find the value of DOCUMENT_ROOT

3 Lab 1 – Hello World 7. Using the file explorer, open the folder specified in the DOCUMENT_ROOT setting. 8. Under that location, create your own folder. Ex. DOCUMENT_ROOT\nuarinfs 9. Using a text editor, create a file and save it as lab1.php under the directory specified by the DOCUMENT_ROOT setting.

4 Lab 1 – Hello World 7. Type the following code: 1. echo ' '; 2. echo ' Hello World. Today is ', date('m/d/Y'), ' '; 3. echo 'Your lucky numbers are ', mt_rand(1,31), ' and ', mt_rand(1,31), ' '; 4. echo ' '; 5. echo ' ';

5 Lab 1 – Hello World 11. Using a web browser, open your lab1.php http://localhost/nuarinfs/lab1.php http://127.0.0.1/nuarinfs/lab1.php If using different port number (ex. 8080) http://localhost:8080/nuarinfs/lab1.php http://127.0.0.1:8080/nuarinfs/lab1.php Replace nuarinfs with your own folder name 12. Debug your code if necessary and refresh the page. 13. Upload your lab1.php using the file manager http://10.10.10.30/csclass  File Manager http://www.ue.edu.ph/csnclass  File Manager

6 Lab 1 – Hello World 11. Upload your lab1.php using the file manager http://10.10.10.30/csclass  File Manager https://www.ue.edu.ph/csnclass  File Manager Good Luck and Happy Coding!


Download ppt "Lab 1 Hello World in PHP CSN Class Lab Activity No. 1."

Similar presentations


Ads by Google