simple sessions/header problem
Posted: Wed Oct 22, 2003 5:45 pm
mail.php:
mailfinish.php:
I get this when I submit the form on mail.php:
Code: Select all
<?PHP
if($refresh=="yes" && un!="")
{
session_start();
$_SESSION['mailcontent'] = $mailcontent;
$_SESSION['un'] = $un;
$_SESSION['refresh'] = $refresh;
header("location: mailfinish.php");
} ?>
<html>
<head>
<title>Email Page</title>
<link rel="stylesheet" href="style.css" type="text/css">
</head>
<body bgcolor="<?PHP echo "$bgc"; ?>">
Email me without having to log into anything! Just fill out your message, and then your name or screen name and click submit! =)
<form name="mail" method="post" action="<?PHP echo "$PHP_SELF"; ?>">
<input type="textarea" name="mailcontent">
<input type="text" name="un" "size="25">
<input type="hidden" name="refresh" value="yes">
<input type="submit" name="submit" value="Send">
</form>
</body>
</html>mailfinish.php:
Code: Select all
<html>
<body>
<?PHP
session_start();
if($mailcontent!="" && $un!="" && refresh=="yes")
{
mail("lppunkskater@hotmail.com", "Automated Scipt", "$mailcontent");
echo "Mail sent!";
}
else
{
echo "Error sending mail. IM LPpunkSkateR please.";
}
?>
</body>
</html>Anyone?Warning: session_start(): Cannot send session cache limiter - headers already sent (output started at /home/des404/public_html/mailfinish.php:3) in /home/des404/public_html/mailfinish.php on line 4
Error sending mail. IM LPpunkSkateR please.