How to link php and html code? Do I have to set the server first?

putra p

New member
Help, I am an amateur in php and html programming. I create a simple html code to create a form with a submit button.
When I click the submit button, a php script should print out the data input. But it doesn't.
What do I do wrong? I use xampp for the php and apache server.
Any idea? Thank you very much
 
so is it like:
<form action"phpfile.php">
<input type="text" name="foo">
<input type="submit" value="Submit">
</form>

Php file:

<?php
echo $_GET['foo'];
?>

if not make some changes

sometimes you have to use $_GET[ ] and not $_POST[ ]
 
Back
Top