Goldensquare Goldensquare - 7 months ago 48
PHP Question

get and post with php not working properly

I am new at php. I am using a wamp server and I created two php pages in the www directory.
One is index.php with the code below:

<!DOCTYPE html>
<form action = "formprocess.php" method = "post">
Your name : <input type = "text" name = "name"> <br>
<input type = "submit">

and another formprocess.php with the code below:

$name = $_POST["name"];
echo "your name is " . $name;

Whenever I try to submit the form, it just displays the entire formprocess.php code as it is in the browser. It does not matter also if I use the get method. Please tell me where am I going wrong.


See link, there basic first steps for run php code. I hope, this will help!