<?php
if(isset($_POST['submit'])){
header('Location: http://www.rate.ee');
}
?>
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"
"http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<title>
</title>
</head>
<body>
<input type="submit" name="submit" id="submit" class="button" value="Submit"/>
</body>
</html>
This is my code. Very simple, isn't it. But it doesn't work and I don't get it.. I always thought that PHP only executes when I load the page, but the other page where I use same code works very well without JS..
You need to wrap your button in a <form>
tag:
<form action="" method="post">
<input type="submit" name="submit" id="submit" class="button" value="Submit"/>
</form>
You need a form surrounding the input.
<body>
<form action="welcome.php" method="post">
<input type="submit" name="submit" id="submit" class="button" value="Submit"/>
</form>
</body>
</html>
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With