-3

my php code is not executed and is displayed as it is in the browser. I used the .php extension to save the file.

I am using WAMP Server.

Please also note that other php files are working which shows that php is installed and configured properly.

The code I am using:

<?php
$name=$_POST['name'];
$un=$_POST['un'];
$pw=$_POST['pw'];
$ei=$_POST['ei'];

$con=mysqli_connect('localhost','root');
mysqli_select_db($con,'login');
$q=" INSERT INTO user (name, username, password) value('$name','$un,'$pw')";  
mysqli_query($con,$q);
mysqli_close($con);
?>
Massimiliano Kraus
  • 3,638
  • 5
  • 27
  • 47

1 Answers1

0

Seems like there are some configuration issues. Follow these steps

1- Check if PHP is installed and running.

2- Also check if you are using short tags <? or not as they are deprecated and now <?php is used Double check your file extension.

3- Make sure you are saving it as .php and not just renaming it as .php

4- Check Apache httpd.conf file for PHP module

5- Check Apache httpd.conf file for PHP mime type in it

Ahsan Mukhtar
  • 629
  • 10
  • 31
user4906240
  • 605
  • 1
  • 6
  • 20