40 likes | 242 Views
Lab 1. Hello World in PHP CSN Class Lab Activity No. 1. Lab 1 – Hello World. Install XAMPP on your computer Open the XAMPP control panel and start the Apache service ( C:xamppxampp-control.exe) Click the Admin button For new installation, click the Language preferred (english)
E N D
Lab 1 Hello World in PHP CSN Class Lab Activity No. 1
Lab 1 – Hello World • Install XAMPP on your computer • Open the XAMPP control panel and start the Apache service (C:\xampp\xampp-control.exe) • Click the Admin button • For new installation, click the Language preferred (english) • Click the phpinfo() link • Find the value of DOCUMENT_ROOT
Lab 1 – Hello World • Using the file explorer, open the folder specified in the DOCUMENT_ROOT setting. • Under that location, create your own folder. Ex. DOCUMENT_ROOT\nuarinfs • Using a text editor, create a file and save it as lab1.php • Type the following code: • <?php • echo "Hello World. Today is " , date('m/d/Y'),'<br/>'; • echo 'Your lucky numbers are ', mt_rand(1,31), 'and ', mt_rand(1,31); • ?>
Lab 1 – Hello World • Using a web browser and open your lab1.php • Ex. http://localhost/nuarinfs/lab1.php • Ex. http://127.0.0.1/nuarinfs/lab1.php • Replace nuarinfs with your own folder name • Debug your code if necessary and refresh the page. • Upload your lab1.php using the file manager • http://10.10.10.30/csclass File Manager • http://www.ue.edu.ph/csnclass File Manager