Friday, 20 October 2017

How to run PHP programme ?


Run PHP Programme
  • At first you install XAMPP Server(xampp-win32-5.6.3-0-VC11-installer or latest Version)
  • Second you go to the c derive (C:/xampp) and open this folder and then go to the htdocs folder and Create you your own project folder name like:-Online_Exam.
  • Not that you create your folder with special characters only underscore(_) not use space or any other characters like:- #,@,%,* etc.
  • Third you create your PHP file and save it to .php extension in your created htdocs folder name. Example:-a.php, b.php etc.
  • Last you run your php file for this you write down on your any web browser:-localhost\Online_Exam(or your htdocs folder name)
                                                                  OR
  • If you are install any other database like SQL Server in your system then you should change your php port number otherwise your php file is not execute.
  • For this you can change in your PHP web Config file(Apache(httpd.conf)) his port number like:-808 in three places:-1. #Listen 12.34.56.78:808 2. Listen 808 3. ServerName localhost:808
  • For more visualization you can see my videos on my YouTube Channel.
Rules for PHP variables:
  • A variable starts with the $ sign, followed by the name of the variable
  • A variable name must start with a letter or the underscore character
  • A variable name cannot start with a number
  • A variable name can only contain alpha-numeric characters and underscores (A-z, 0-9, and _ )
  • Variable names are case-sensitive ($age and $AGE are two different variables)
eg:-1. a.php

<?php
$txt = "www.shahblogs.com";
echo "I write $txt!";
?>

2.B.php

Eg-:<?php
$txt = "Hello world!";
$x = 5;
$y = 10.5;
?>

0 comments

Post a Comment