Goldensquare Goldensquare - 25 days ago 13
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>
<html>
<body>
<form action = "formprocess.php" method = "post">
Your name : <input type = "text" name = "name"> <br>
<input type = "submit">
</form>
</body>
</html>


and another formprocess.php with the code below:

<?php
$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.

Answer

See link, there basic first steps for run php code. I hope, this will help! http://www.tutorialspoint.com/articles/run-a-php-program-in-xampp-server

Comments