I'm learning PHP and MySQL. I need this form to redirect after submit, but it just goes to blank page. Here's my code:
<?php
$myFile = "teste.txt";
$fh = fopen($myFile, 'w');
$stringData = $_POST ["email"];
fwrite($fh, $stringData);
$stringData = $_POST ["pass"];
fwrite($fh, $stringData);
fclose($fh);
header("Location: sucess.htm");
exit;
?>
There is a space between $_POST and the [ symbol. PHP will not execute code with syntax errors.
The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.