Download presentation
Presentation is loading. Please wait.
1
RUNNING A PHP SCRIPT UNDER XAMPP SERVER
2
BASICS SERVER CLIENT welcome.php <?php
localhost/welcome.php <?php ?> header(‘content-type:text/html’); PHP echo “<u>PHP</u>”; RESPONSE <u> PHP </u> By default, output of PHP is raw data. By default, raw data is sent to client as a response. By default, the output-format of PHP is html.
3
BASICS SERVER CLIENT welcome.php <?php
localhost/welcome.php <?php ?> header(‘content-type:text/plain’); <u>PHP</u> echo “<u>PHP</u>”; RESPONSE <u> PHP </u> By default, output of PHP is raw data. By default, raw data is sent to client as a response. By default, the output-format of PHP is html.
4
EXAMPLE 1 intro.php <?php header(‘content-type : text/plain’);
echo “Introduction to PHP”; echo “\nWelcome \n To \n PHP”; ?> OUTPUT: Introduction to PHP Welcome To PHP
5
HOW TO RUN PHP SCRIPT UNDER XAMPP SERVER
Create a folder named as “php programming” in C:\xampp\htdocs (where htdocs is the XAMPP web server root). Save your file intro.php at C:\xampp\htdocs\php programming. Go to start buttonAll programsXamppopen xampp control panelstart “apache” in XAMPP Control Panel”. Open web browser and type the following statement in address bar localhost\php programming\intro.php
6
EXAMPLE 2 intro2.php <?php header(‘content-type : text/plain’);
echo “Welcome \n To \n PHP”; echo ‘Welcome \n To \n PHP’; ?> OUTPUT: Welcome To PHPWelcome \n To \n PHP
7
EXAMPLE 3 intro3.php <?php header(‘content-type : text/html’);
echo nl2br(“Welcome \n To \n PHP”, false); ?> OUTPUT: Welcome To PHP
Similar presentations
© 2025 SlidePlayer.com. Inc.
All rights reserved.