ted_chou12 Posted January 6, 2007 Share Posted January 6, 2007 This is my page structure;[code]<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd"><html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en"><head><link rel="stylesheet" href="images/css.css" type="text/css" /></head><body> <div id="main"> <?phpif(isset($_POST['submit'])){$subject = $_POST['subject'];$name = $_POST['name'];$email = $_POST['email'];$message = $_POST['message'];$datetime = date("Y-m-d H:i:s");$to = "[email protected]";$from = "$email";$return = "$email";$body = "Sender: $name, <br /> Sender e-mail: $email, <br /> Send time: $datetime, <br /> Message: <br /> $message"; if ($_SERVER['QUERY_STRING'] == "") {$page = "{$_SERVER['PHP_SELF']}";}else {$page = "{$_SERVER['PHP_SELF']}?{$_SERVER['QUERY_STRING']}";}$_SESSION['mail'] = $page;if ($invalid == false){header("location: confirm.php");//header redirection$subject = ""; $name = ""; $email = ""; $message = "";if ($_SESSION['mail'] == "true") {echo "<p><b>Message Successfully Delivered!</b></p>";} else {echo "<p><b>Message Delivery Failed</b></p>";}}}?><form name="supportsendemail" action="" method="post"><p> <label>Subject</label><input name="subject" value="<?echo"$subject"?>" type="text" size="30" /><label>Name</label><input name="name" value="<?echo"$name"?>" type="text" size="30" /><label>Your E-mail Address</label><input name="email" value="<?echo"$email"?>" type="text" size="30" /><label>Message</label><textarea name="message" rows="5" cols="5"><?echo"$message"?></textarea><br /><input class="button" name="submit" type="submit" /> </p> </form> </div> </body></html>[/code]The page above is a form without session start at the top.[code]<?phpob_start();session_start();require_once ("functions.php");?>!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd"><html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en"><link rel="stylesheet" href="../images/BrightSide.css" type="text/css" /><head><link rel="stylesheet" href="images/css.css" type="text/css" /></head><body> <div id="main"> <?phpif(isset($_POST['submit'])){$subject = $_POST['subject'];$name = $_POST['name'];$email = $_POST['email'];$message = $_POST['message'];$datetime = date("Y-m-d H:i:s");$to = "[email protected]";$from = "$email";$return = "$email";$body = "Sender: $name, <br /> Sender e-mail: $email, <br /> Send time: $datetime, <br /> Message: <br /> $message"; if ($_SERVER['QUERY_STRING'] == "") {$page = "{$_SERVER['PHP_SELF']}";}else {$page = "{$_SERVER['PHP_SELF']}?{$_SERVER['QUERY_STRING']}";}$_SESSION['mail'] = $page;if ($invalid == false){header("location: confirm.php");//header redirection as well$subject = ""; $name = ""; $email = ""; $message = "";if ($_SESSION['mail'] == "true") {echo "<p><b>Message Successfully Delivered!</b></p>";} else {echo "<p><b>Message Delivery Failed</b></p>";}}}?><form name="supportsendemail" action="" method="post"><p> <label>Subject</label><input name="subject" value="<?echo"$subject"?>" type="text" size="30" /><label>Name</label><input name="name" value="<?echo"$name"?>" type="text" size="30" /><label>Your E-mail Address</label><input name="email" value="<?echo"$email"?>" type="text" size="30" /><label>Message</label><textarea name="message" rows="5" cols="5"><?echo"$message"?></textarea><br /><input class="button" name="submit" type="submit" /> </p> </form> </div> </body></html>[/code]The two pages are almost identical, however, the header redirection for the second page works, but not for the first page, can anyone explain why this may be the case?thanksTed Link to comment https://forums.phpfreaks.com/topic/33054-problem/ Share on other sites More sharing options...
chronister Posted January 6, 2007 Share Posted January 6, 2007 Maybe I am missing something, but there is no header redirect in the first page???? Link to comment https://forums.phpfreaks.com/topic/33054-problem/#findComment-153995 Share on other sites More sharing options...
JasonLewis Posted January 6, 2007 Share Posted January 6, 2007 actually there is and the OP has commented the lines...try adding like a die statement above the header to see if it is actually getting to the appropriate spot, just keep doing that till your track your error to the source. Link to comment https://forums.phpfreaks.com/topic/33054-problem/#findComment-154007 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.