0
我得到變量$email
未定義。我知道emailParser()
方法的工作原理與它應該做的所有事情一樣。保持一個PHP變量貫穿多個HTML頁面/階段
如何使變量$ email持久化,以便我可以在index.php的第二次迭代中訪問它?
<?php
if ($_SERVER["REQUEST_METHOD"] == "POST") {
$message = $_POST["message"];
include "etext.php";
//Run etext
$email = emailParser($message); //set by running etext
header("Location: index.php?status=submitted");
exit;
}
?>
<h1>Etext Email Converter</h1>
<?php
if (isset($_GET["status"]) AND $_GET["status"] == "submitted") {
$output_file_path = $email->generateParsedEmailFile();
?>
<p> File located at: <?php echo $output_file_path; ?> </p><br>
<a href=<?php echo $output_file_path;?> >Click Here to Access</a>
<?php
} else { ?>
<form method="POST" action="index.php">
<label for"message"></label>
<textArea rows="30" cols="40" name="message" id="message"></textArea>
<input type="submit" value="Submit">
</form>
<?php } ?>
您試過'$ _SESSION'嗎? –
不,我是一個HTML/PHP新手 – Pinwheeler