0

Im trying out php to help me on the logic side
with my form but the php is just not working,
The folder is on the desktop, its not in the XAMPP
directory, I saved it as a php file, and still nothing
the only thing I could think of, is that the php
file needs to be in the localhost/xampp directory

heres the simple code:

<head><title>Register</title>
 </head>

<body>
<form  action = "regs.php" method = "get">
    Name: <input type= "text" name ="name"><br />
	<input type = "submit" value ="Submit">
  
</form >
</body>

<?php
  $name = $_GET['name'];
  
    if($name == "fernando")
	  echo "Aproved, please do wait";
	    else 
		 echo " Neein";
		 ?>

I have turned on or activated apache, still nothing.. So what can I do
I mean the html works just fine..., I will appreciate any help, thanks

2
Contributors
1
Reply
2
Views
5 Years
Discussion Span
Last Post by sv3tli0
0

If you have installed xampp. Open htdocs folder at xampp main folder.
You must set there your PHP file. And open it at http://localhost/FILE.php

The site folder is there on default. You can change this at your xampp - apache configuration.

PHP code will work only there. Your browser doesn't supports php files if they are not located on server with PHP support.

Edited by sv3tli0: n/a

This topic has been dead for over six months. Start a new discussion instead.
Have something to contribute to this discussion? Please be thoughtful, detailed and courteous, and be sure to adhere to our posting rules.