Skip to main content

How to execute PHP Script in Website using XAMPP webserver ?

How to execute PHP Script in Website using XAMPP webserver ?

First we have to install the XAMPP/WAMP webserver in our system. Please follow the link to download and install XAMPP/WAMP server. Link https://www.apachefriends.org/download.html


After successful installation, the steps we should follow are-


Open XAMPP control panel, if you want to link database to your code then start MySQL otherwise you will need to start Filezilla and Apache



Xampp starts


Then open Notepad/Notepad++ or any text editor to write PHP program.

<?php 


echo "Geeks for Geeks"; 

?>

Save you file in path xampp/htdocs/gfg/a.php






Then go to your browser and type localhost/gfg/a.php in URL section. It will display the result.




Note: If there are multiple files in your code similarly then you can put all your files in one folder and can run it.


<?php  


  

// Declare the variable 


$x = 20;   


$y = 10;   


  

// Evaluate arithmetic operations 


$z = $x + $y;  


$m = $x - $y; 


$p = $x * $y;  


$a = $x / $y; 


  

// Addition 


echo "Sum: ", $z; // Sum: 30 


  

// Subtraction 


echo "Diff: ", $m; // Diff: 10 


  

// Multiplication 


echo "Mul: ", $p; // Mul: 200 


  

// Division 


echo "Div: ", $a; // Div: 2 

?>

Type the URL xampp/htdocs/gfg/code/1.php in the browser, it will display the result.






Comments

Popular posts from this blog

software design institute training

  ONLINE-OFFLINE IN-PLANT/INTERNSHIP With Certificate Training For B.E(ECE,EEE,CSE,IT,AI,ML,DataScience,Cyper Security),MCA, B.Sc,M.E,M.Tech. @ TrainingTrains.Online Classes Available 100 % Job placement Training Full Stack Developer | Placement Training In-plant Training/Internship Training with Project supports the various Engineering and Non-Engineering, Arts Students to develop their Skills on the IT Companies/Corporate Expectations. DURATION OF IN-PLANT TRAINING: 1 week and Above.DURATION OF INTERNSHIP: 1 Month and Above Internship-inplant training For All Departments students, Internship- inplant Training Python | Java | Full Stack Development | UI & UX | C& C++ | Php | Web Designing - HTML, CSS, Java Script, Bootstrap | MEAN Stack | MERN Stack | MEARNStack | Android | Kotlin | Flutter | Database - Oracle, Mongo DB, MySQL, MS SQL Serer | Visual Studio Code | Objective C | Swift | Go Lang | Frame work - Laravel, Django, Vue JS | Machine Learning | React JS | ...

நீங்கள் Digital Marketing வழியாக உங்கள் தொழிலுக்கு அதிக வாடிக்கையாளர்கள் பெற விரும்புகிறீர்களா?இதை கட்டாயம் படியுங்கள்.

நீங்கள் தொழிலதிபரா?  நீங்கள் Digital Marketing வழியாக உங்கள் தொழிலுக்கு அதிக வாடிக்கையாளர்கள் பெற விரும்புகிறீர்களா? இதை கட்டாயம் படியுங்கள்.  தொழில் சிறியதாக இருந்தாலும், பெரியதாக இருந்தாலும் சரி அதன் தொழில் வளர்ச்சியடைய தொழில்நுட்பம் (technology) பெரிதும் உதவுகிறது. தொழில்நுட்பங்கள் தொழிலின் பல மட்டங்களில் பயன்படுகிறது. தயாரிப்பு மற்றும் சேவையை சந்தைப்படுத்த டிஜிட்டல் மார்க்கெட்டிங் (Digital Marketing) தொழில்நுட்பம் பெரிதும் உதவுகிறது. மின்னணு ஊடகங்கள் வழியாக தயாரிப்பு மற்றும் சேவையை சந்தைப்படுத்துதல் Digital Marketing ஆகும். இத்தகைய டிஜிட்டல் மார்க்கெட்டிங்கில் பல உத்திகள் (strategy) மூலம் பொருட்கள் / சேவையை   சந்தைப்படுத்தலாம். ஆன்லைன் வழியாக பல டிஜிட்டல் மார்க்கெட்டிங்கை எவ்வித செலவும் இல்லாமல் செய்துகொள்ளலாம் Location: Social Media Marketing இன்றைய நிலையில் பெரும்பாலோனோர் சமூக வலைத்தளங்களை (Social media) பயன்படுத்துகின்றனர். ஒரு தயாரிப்பு மற்றும் சேவை அவர்களை சென்றடைய சமூக வலைத்தள மார்கெட்டிங்கை பின்பற்றுவது அவசியமாகும். Face book, Twitter, Google plus, ...

How to Run Java Program

  How to Run Java Program Java is a popular, high-level, object-oriented programming language that was developed by James Gosling and his team at Sun Microsystems (now owned by Oracle Corporation) in the mid-1990s. It is widely used for developing various kinds of software, including web applications, desktop applications, mobile applications, games, and more. Step by Step Implementation To run a Java program, you need to follow these steps: Step 1:  Install Java Development Kit (JDK) on your computer. You can download the JDK from the Oracle website or any other reliable source.   Step 2:  Write your Java code in a text editor such as Notepad or any other code editor. Save the file with a .java extension and file type as ‘All files’ in the desired location. Step 3:  Open the command prompt (Windows) or terminal (Mac or Linux). Step 4:  Navigate to the directory where you saved your Java code using the “cd” command. Step 5:  C...