I got a very simple problem and I've searched for it for hours. But I just don't fix my error... I try to get the value of my textbox (I know, there are lots of posts but no one of them could've helped me).
I got this HTML code:
<form action="" method="post">
<input type="text" id="address" name="address" placeholder="Enter your zip code" style="width:250px;" />
<input type="submit" id="submit" value="Submit" />
</form>
And this is PHP code #1 I tried:
<?php
$textboxValue = $_POST['address'];
echo $textboxValue;
?>
This doesn't work and I don't know why. After trying this, I found another code:
<?php
if(isset($_POST['submit'])){
$textboxValue = $_POST['address'];
echo $textboxValue;
}
?>
This doesn't seem to work. Like the other one.
Is there an error or why is the $textboxValue not displayed when I call it with echo?
action=""will do this?