ethan6 Posted June 5, 2009 Share Posted June 5, 2009 So I have a couple pages.. page one has a variable $screen_type coming into it via $_POST.. so i have this on top: <?php session_start(); $_SESSION['screen_type2'] = $_POST[ "screen_type"]; ?> This puts the variable into the $_SESSION array, correct? Next, from that page I want to send that same variable to a third page, so I use the $SESSION and put it into $screen_type3: <?php session_start(); $screen_type3 = $_SESSION['screen_type2']; ?> And now I will use that variable $screen_type3 later on in this same page. Why is this not working? Or is there a better way to move a variable through one page into a third (I have lots of other php stuff going on, so i wanted to just move this one variable in a different manner?) Thanks! Quote Link to comment Share on other sites More sharing options...
ldougherty Posted June 5, 2009 Share Posted June 5, 2009 Mostly everything is correct except you do not need the session_start(); on the second page. You only need to initiate the session on the first page as the session exists then until it is cleared. Quote Link to comment Share on other sites More sharing options...
jpratt Posted June 5, 2009 Share Posted June 5, 2009 if you are working with various forms you can pass data using hidden fields, or if is insensitive small ammounts of data you can pass it the url with GET, or you can store a cookie on a users machine, or like you are trying you can use a session variable. If this is not working you might have sessions not allowed in your php.ini file. Quote Link to comment Share on other sites More sharing options...
jpratt Posted June 5, 2009 Share Posted June 5, 2009 Mostly everything is correct except you do not need the session_start(); on the second page. You only need to initiate the session on the first page as the session exists then until it is cleared. this is true in some cases. Depends on the auto start setting in the php.ini file if he needs the second session_start(); declaration. Either way if sessions were on, his code would still work just give a warning that the session was already started. Quote Link to comment Share on other sites More sharing options...
PFMaBiSmAd Posted June 5, 2009 Share Posted June 5, 2009 And it would be best to find out why sessions are not working. Do you know for a fact that $_POST["screen_type"] contains a value on the first page? For debugging purposes (remove this when you are done) add the following two lines of code immediately after your first opening <?php tag on both pages - ini_set("display_errors", "1"); error_reporting(E_ALL); Quote Link to comment Share on other sites More sharing options...
ethan6 Posted June 5, 2009 Author Share Posted June 5, 2009 hey thanks for the replies.. how do i check if my php.ini file has sessions allowed? everything seems to work, until i get to the third page, the variable just shows up empty. Quote Link to comment Share on other sites More sharing options...
ethan6 Posted June 5, 2009 Author Share Posted June 5, 2009 yes, i know there are values on the first and second pages, i've checked. when using $_SESSION, can i use the variables later in the file, right? Quote Link to comment Share on other sites More sharing options...
PFMaBiSmAd Posted June 5, 2009 Share Posted June 5, 2009 Sessions cannot be disabled/enabled, they are part of the php core system. There are settings that could be messed up that would prevent them from working. Find out why they are not working (see my post above about adding the two lines of code to show all errors.) until i get to the third page What third page? You only mentioned two pages worth of code. Perhaps the code on the third page contains an error. Post it. Quote Link to comment Share on other sites More sharing options...
ethan6 Posted June 5, 2009 Author Share Posted June 5, 2009 no i didn't post the first page.. it's working fine, it just submits a value via $_POST that is retrieved fine on the second page (where the first session starts). my pages are here and i added the extra code you posted: http://myipodbroke.com/repair2.html > http://myipodbroke.com/repair3a.php > http://myipodbroke.com/repair4.php Quote Link to comment Share on other sites More sharing options...
ethan6 Posted June 5, 2009 Author Share Posted June 5, 2009 So right now here's my setup: PAGE1: ... <body> <form action="repair3a.php" method="post"> <select name="screen_type" value="screen_type"> <option value="">--choose one-- <option value="video">Video Screen Repair <option value="nano">Nano Screen Repair <option value="mini">Mini Screen Repair </select> <input type="submit" value="This is my iPod"> </form> </body> ... PAGE2: <?php session_start(); $_SESSION['screen_type2'] = $_POST[ "screen_type"]; ?> <head>...</head> <body> ... </body> PAGE3: <?php $screen_type3 = $_SESSION['screen_type2']; ?> <head>...</head> <body> <?php echo $screen_type3; ?> </body> The problem is that echo $screen_type3 shows nothing. Thanks again for all the help! Quote Link to comment Share on other sites More sharing options...
jpratt Posted June 5, 2009 Share Posted June 5, 2009 try putting a session_start() on the third page. Edit: Make sure and put it before everything else. Quote Link to comment Share on other sites More sharing options...
ethan6 Posted June 5, 2009 Author Share Posted June 5, 2009 ok i tried adding the session_start(); but no luck.. is there any way i can use php to change pages and use method="$_GET" like this: PAGE A: <?php ...?> window.href='repair4.php?variable=<?php $variable ?>' i just need to move this one variable over, but since i have this form that needs to run an outside mailer php script, i can't seem to do it simply, since if i just add the variable to the form, it doesn't get posted but rather gets mailed. Thanks, ethan Quote Link to comment Share on other sites More sharing options...
PFMaBiSmAd Posted June 5, 2009 Share Posted June 5, 2009 Your code on your page is likely clearing the variable, so no changing to a $_GET won't help because your code will then clear the $_GET variable on the page. You are going to need to post the actual code for the page if you expect someone else to help you find out why the variable is being cleared. Quote Link to comment Share on other sites More sharing options...
ethan6 Posted June 5, 2009 Author Share Posted June 5, 2009 ok here's the full code: PAGE1 (repair2.html): <myipodbroke.com> <head> <title>MyiPodBroke: iPod Repair</title> <link rel=stylesheet type="text/css" href="style.txt"> <meta name="description" content="This is a site to help you either fix your iPod, or get it repaired by us, MyiPodBroke.com. I have quick and efficient service, and would love to help you. This is for any iPod problems or troubles, broken iPods, and for any iPods that need to be fixed, repaired, helped, saved, restored, renewed, or otherwise mended!"> <meta name="keywords" content="ipod repair, ipod help, fix ipods, ipod, fix, repair, help, ipod diagnostics, ipod secrets, my ipod broke!, myipodbroke, myipodbroke.com, help my ipod, ipodmedic, theipodmedic.com, fast ipod repair, ipod screen repair, ipod parts, ipod accessories, ipod troubles, ipod problems, ipod dianostics, ipodreair, ipodrepair, ipod nano, ipod nano repair, ipod nano screen repair, ipod video, ipod video repair, ipod video screen repair, ipod screen repair, ipod sad face, sad face, unhappy ipod, sick ipod, ipod, ipods, ipods for sale, buy ipods, buy ipod, sell your old ipod, sell broken ipod, sell my ipod, buy broken ipods, ipod secrets, ipod self diagnostics, ipod diagnostics, free ipod diagnostics, self diagnostics, ipod diagnosing, ipod diagnose, ipod problem fixer, myipodbroke, my ipod broke"> </head> <body bgcolor="#000000"> <center> <table width="800" height="65" cellpadding="0" cellspacing="0" border="0"> <tr valign="top"> <td width="300" height="65" cellpadding="0" cellspacing="0" border="0"> <img src="img/logo.jpg" width="300" height="65"> </td> <td width="300" height="65" cellpadding="0" cellspacing="0" border="0" bgcolor="#000000"> </td> <td width="200" height="65" cellpadding="0" cellspacing="0" border="0" bgcolor="#000000"> <!-- DATE SCRIPT START ********** --> <font color="#10E500"> <SCRIPT Language="JavaScript"> <!-- hide from old browsers function GetDay(intDay){ var DayArray = new Array("Sunday", "Monday", "Tuesday", "Wednesday", "Thursday", "Friday", "Saturday") return DayArray[intDay] } function GetMonth(intMonth){ var MonthArray = new Array("January", "February", "March", "April", "May", "June", "July", "August", "September", "October", "November", "December") return MonthArray[intMonth] } function getDateStrWithDOW(){ var today = new Date() var year = today.getYear() if(year<1000) year+=1900 var todayStr = GetDay(today.getDay()) + ", " todayStr += GetMonth(today.getMonth()) + " " + today.getDate() todayStr += ", " + year return todayStr } //--> </SCRIPT> <SCRIPT Language="JavaScript"> <!-- hide from old browsers document.write(getDateStrWithDOW()) //--> </SCRIPT> </font> <!-- DATE SCRIPT END ********** --> </td> </tr> </table> <table width="800" height="25" cellpadding="0" cellspacing="0" border="0"> <tr valign="top"> <td width="48" height="25" cellpadding="0" cellspacing="0" border="0" bgcolor="#000000"> <a href="index.html" onMouseOver = "rollover('home')" onMouseOut = "rollout('home')"> <img id="home" src="img/navigation/home.jpg" width="48" height="25" onMouseOver="document.images['home'].src = 'img/navigation/home-over.jpg'" onMouseOut="document.images['home'].src = 'img/navigation/home.jpg'" onMouseDown="document.images['home'].src = 'img/navigation/home-down.jpg'" onMouseUp="document.images['home'].src = 'img/navigation/home-over.jpg'" onLoad="new Image().src='img/navigation/home-over.jpg'; new Image().src='img/navigation/home-down.jpg'" hspace="0" border="0" alt="Home"> </a> </td> <td width="88" height="25" cellpadding="0" cellspacing="0" border="0" bgcolor="#000000"> <a href="repair.html"> <img id="repair" src="img/navigation/repair-over.jpg" width="88" height="25" onMouseOver="document.images['repair'].src = 'img/navigation/repair-over.jpg'" onMouseOut="document.images['repair'].src = 'img/navigation/repair-over.jpg'" onMouseDown="document.images['repair'].src = 'img/navigation/repair-down.jpg'" onMouseUp="document.images['repair'].src = 'img/navigation/repair-over.jpg'" onLoad="new Image().src='img/navigation/repair-over.jpg'; new Image().src='img/navigation/repair-down.jpg'" hspace="0" border="0" alt="Repair"> </a> </td> <td width="122" height="25" cellpadding="0" cellspacing="0" border="0" bgcolor="#000000"> <a href="diagnostics.html"> <img id="ipoddiagnostics" src="img/navigation/ipoddiagnostics.jpg" width="122" height="25" onMouseOver="document.images['ipoddiagnostics'].src = 'img/navigation/ipoddiagnostics-over.jpg'" onMouseOut="document.images['ipoddiagnostics'].src = 'img/navigation/ipoddiagnostics.jpg'" onMouseDown="document.images['ipoddiagnostics'].src = 'img/navigation/ipoddiagnostics-down.jpg'" onMouseUp="document.images['ipoddiagnostics'].src = 'img/navigation/ipoddiagnostics-over.jpg'" onLoad="new Image().src='img/navigation/ipoddiagnostics-over.jpg'; new Image().src='img/navigation/ipoddiagnostics-down.jpg'" hspace="0" border="0" alt="iPod Diagnostics"> </a> </td> <td width="64" height="25" cellpadding="0" cellspacing="0" border="0" bgcolor="#000000"> <a href="support.html"> <img id="support" src="img/navigation/support.jpg" width="64" height="25" onMouseOver="document.images['support'].src = 'img/navigation/support-over.jpg'" onMouseOut="document.images['support'].src = 'img/navigation/support.jpg'" onMouseDown="document.images['support'].src = 'img/navigation/support-down.jpg'" onMouseUp="document.images['support'].src = 'img/navigation/support-over.jpg'" onLoad="new Image().src='img/navigation/support-over.jpg'; new Image().src='img/navigation/support-down.jpg'" hspace="0" border="0" alt="Support"> </a> </td> <td width="110" height="25" cellpadding="0" cellspacing="0" border="0" bgcolor="#000000"> <a href="contactabout.html"> <img id="contactabout" src="img/navigation/contactabout.jpg" width="110" height="25" onMouseOver="document.images['contactabout'].src = 'img/navigation/contactabout-over.jpg'" onMouseOut="document.images['contactabout'].src = 'img/navigation/contactabout.jpg'" onMouseDown="document.images['contactabout'].src = 'img/navigation/contactabout-down.jpg'" onMouseUp="document.images['contactabout'].src = 'img/navigation/contactabout-over.jpg'" onLoad="new Image().src='img/navigation/contactabout-over.jpg'; new Image().src='img/navigation/contactabout-down.jpg'" hspace="0" border="0" alt="Contact/About"> </a> </td> <td width="368" height="25" cellpadding="0" cellspacing="0" border="0" bgcolor="#000000"> </td> </tr> </table> <table width="800" height="15" cellpadding="0" cellspacing="0" border="0"> <tr> <td width="800" height="15" cellpadding="0" cellspacing="0" border="0" background="img/subbar.jpg"> <a href="repair.html">iPod Repair</a> <a href="diagnostics.html">Self Diagnostics</a> <a href="diagnosticservice.html">FREE Diagnostic Service!</a> </td> </tr> </table> <!-- MAIN TABLE START **************** --> <table width="800" height="100%" cellpadding="0" cellspacing="0" border="0"> <tr valign="top"> <td width="800" height="100%" cellpadding="0" cellspacing="0" border="0"> <br> <!-- MAIN CONTENT START ******************************************* ##########START EDIT SECTION ##########*********************** --> <div class="main"> <img src="img/progress_repair/progress2.jpg" width="800" height="25"> <br> <form action="repair3a.php" method="post"> <select name="screen_type" value="screen_type"> <option value="">--choose one-- <option value="video">Video Screen Repair <option value="nano">Nano Screen Repair <option value="mini">Mini Screen Repair </select> <input type="submit" value="This is my iPod"> </form> </div> <!--END MAIN CONENT ***********************************************########## END EDIT SECTION ##########********************** --> <br><br><br><br><br> <br><br><br><br><br> <center>Web site and all contents © MyiPodBroke.com 2005-2008, All rights reserved.</center> <br><br> </td> <!--END CONTENT AREA ****************************************************************** --> </tr> </table> <!-- END MAIN TABLE --> </body> PAGE 2 (repair3a.php): <?php session_start(); $_SESSION['screen_type2'] = $_POST[ "screen_type"]; ?> <myipodbroke.com> <head> <title>MyiPodBroke: iPod Repair</title> <link rel=stylesheet type="text/css" href="style_repair.txt"> <meta name="description" content="This is a site to help you either fix your iPod, or get it repaired by us, MyiPodBroke.com. I have quick and efficient service, and would love to help you. This is for any iPod problems or troubles, broken iPods, and for any iPods that need to be fixed, repaired, helped, saved, restored, renewed, or otherwise mended!"> <meta name="keywords" content="ipod repair, ipod help, fix ipods, ipod, fix, repair, help, ipod diagnostics, ipod secrets, my ipod broke!, myipodbroke, myipodbroke.com, help my ipod, ipodmedic, theipodmedic.com, fast ipod repair, ipod screen repair, ipod parts, ipod accessories, ipod troubles, ipod problems, ipod dianostics, ipodreair, ipodrepair, ipod nano, ipod nano repair, ipod nano screen repair, ipod video, ipod video repair, ipod video screen repair, ipod screen repair, ipod sad face, sad face, unhappy ipod, sick ipod, ipod, ipods, ipods for sale, buy ipods, buy ipod, sell your old ipod, sell broken ipod, sell my ipod, buy broken ipods, ipod secrets, ipod self diagnostics, ipod diagnostics, free ipod diagnostics, self diagnostics, ipod diagnosing, ipod diagnose, ipod problem fixer, myipodbroke, my ipod broke"> </head> <body bgcolor="#000000"> <center> <table width="800" height="65" cellpadding="0" cellspacing="0" border="0"> <tr valign="top"> <td width="300" height="65" cellpadding="0" cellspacing="0" border="0"> <img src="img/logo.jpg" width="300" height="65"> </td> <td width="300" height="65" cellpadding="0" cellspacing="0" border="0" bgcolor="#000000"> </td> <td width="200" height="65" cellpadding="0" cellspacing="0" border="0" bgcolor="#000000"> <!-- DATE SCRIPT START ********** --> <font color="#10E500"> <SCRIPT Language="JavaScript"> <!-- hide from old browsers function GetDay(intDay){ var DayArray = new Array("Sunday", "Monday", "Tuesday", "Wednesday", "Thursday", "Friday", "Saturday") return DayArray[intDay] } function GetMonth(intMonth){ var MonthArray = new Array("January", "February", "March", "April", "May", "June", "July", "August", "September", "October", "November", "December") return MonthArray[intMonth] } function getDateStrWithDOW(){ var today = new Date() var year = today.getYear() if(year<1000) year+=1900 var todayStr = GetDay(today.getDay()) + ", " todayStr += GetMonth(today.getMonth()) + " " + today.getDate() todayStr += ", " + year return todayStr } //--> </SCRIPT> <SCRIPT Language="JavaScript"> <!-- hide from old browsers document.write(getDateStrWithDOW()) //--> </SCRIPT> </font> <!-- DATE SCRIPT END ********** --> </td> </tr> </table> <table width="800" height="25" cellpadding="0" cellspacing="0" border="0"> <tr valign="top"> <td width="48" height="25" cellpadding="0" cellspacing="0" border="0" bgcolor="#000000"> <a href="index.html" onMouseOver = "rollover('home')" onMouseOut = "rollout('home')"> <img id="home" src="img/navigation/home.jpg" width="48" height="25" onMouseOver="document.images['home'].src = 'img/navigation/home-over.jpg'" onMouseOut="document.images['home'].src = 'img/navigation/home.jpg'" onMouseDown="document.images['home'].src = 'img/navigation/home-down.jpg'" onMouseUp="document.images['home'].src = 'img/navigation/home-over.jpg'" onLoad="new Image().src='img/navigation/home-over.jpg'; new Image().src='img/navigation/home-down.jpg'" hspace="0" border="0" alt="Home"> </a> </td> <td width="88" height="25" cellpadding="0" cellspacing="0" border="0" bgcolor="#000000"> <a href="repair.html"> <img id="repair" src="img/navigation/repair-over.jpg" width="88" height="25" onMouseOver="document.images['repair'].src = 'img/navigation/repair-over.jpg'" onMouseOut="document.images['repair'].src = 'img/navigation/repair-over.jpg'" onMouseDown="document.images['repair'].src = 'img/navigation/repair-down.jpg'" onMouseUp="document.images['repair'].src = 'img/navigation/repair-over.jpg'" onLoad="new Image().src='img/navigation/repair-over.jpg'; new Image().src='img/navigation/repair-down.jpg'" hspace="0" border="0" alt="Repair"> </a> </td> <td width="122" height="25" cellpadding="0" cellspacing="0" border="0" bgcolor="#000000"> <a href="diagnostics.html"> <img id="ipoddiagnostics" src="img/navigation/ipoddiagnostics.jpg" width="122" height="25" onMouseOver="document.images['ipoddiagnostics'].src = 'img/navigation/ipoddiagnostics-over.jpg'" onMouseOut="document.images['ipoddiagnostics'].src = 'img/navigation/ipoddiagnostics.jpg'" onMouseDown="document.images['ipoddiagnostics'].src = 'img/navigation/ipoddiagnostics-down.jpg'" onMouseUp="document.images['ipoddiagnostics'].src = 'img/navigation/ipoddiagnostics-over.jpg'" onLoad="new Image().src='img/navigation/ipoddiagnostics-over.jpg'; new Image().src='img/navigation/ipoddiagnostics-down.jpg'" hspace="0" border="0" alt="iPod Diagnostics"> </a> </td> <td width="64" height="25" cellpadding="0" cellspacing="0" border="0" bgcolor="#000000"> <a href="support.html"> <img id="support" src="img/navigation/support.jpg" width="64" height="25" onMouseOver="document.images['support'].src = 'img/navigation/support-over.jpg'" onMouseOut="document.images['support'].src = 'img/navigation/support.jpg'" onMouseDown="document.images['support'].src = 'img/navigation/support-down.jpg'" onMouseUp="document.images['support'].src = 'img/navigation/support-over.jpg'" onLoad="new Image().src='img/navigation/support-over.jpg'; new Image().src='img/navigation/support-down.jpg'" hspace="0" border="0" alt="Support"> </a> </td> <td width="110" height="25" cellpadding="0" cellspacing="0" border="0" bgcolor="#000000"> <a href="contactabout.html"> <img id="contactabout" src="img/navigation/contactabout.jpg" width="110" height="25" onMouseOver="document.images['contactabout'].src = 'img/navigation/contactabout-over.jpg'" onMouseOut="document.images['contactabout'].src = 'img/navigation/contactabout.jpg'" onMouseDown="document.images['contactabout'].src = 'img/navigation/contactabout-down.jpg'" onMouseUp="document.images['contactabout'].src = 'img/navigation/contactabout-over.jpg'" onLoad="new Image().src='img/navigation/contactabout-over.jpg'; new Image().src='img/navigation/contactabout-down.jpg'" hspace="0" border="0" alt="Contact/About"> </a> </td> <td width="368" height="25" cellpadding="0" cellspacing="0" border="0" bgcolor="#000000"> </td> </tr> </table> <table width="800" height="15" cellpadding="0" cellspacing="0" border="0"> <tr> <div class="black"> <td width="800" height="15" cellpadding="0" cellspacing="0" border="0" background="img/subbar.jpg"> <a href="repair.html"></a> <a href="diagnostics.html"></a> <a href="diagnosticservice.html"></a> </td> </div> </tr> </table> <!-- MAIN TABLE START **************** --> <table width="800" height="100%" cellpadding="0" cellspacing="0" border="0"> <tr valign="top"> <td width="800" height="100%" cellpadding="0" cellspacing="0" border="0"> <br> <!-- MAIN CONTENT START ******************************************* ##########START EDIT SECTION ##########*********************** --> <img src="img/progress_repair/progress3.jpg" width="800" height="25"> <?php echo $_POST[ "screen_type"]; ?> <?php echo $_SESSION['screen_type2'] ?> <!-- <?php $screen_type2 = $_POST[ "screen_type"]; ?> <?php echo $screen_type2 ?> --> <?php include("configure_repair.php"); if (isset($_POST['submit'])) { if (!eregi("^[A-Z0-9._%-]+@[A-Z0-9._%-]+\.[A-Z]{2,6}$", $sendemail)) { $msg9="<br><font color ='red'>Please enter your email. You may have not entered it, or entered it incorrectly."; $pass="false"; $error9 = "<b><font face='arial' color ='red' size='5'>*</font></b>"; $style9 = "error";} if ($fname == ""){ $msg1="<br><font color ='red'>Please enter your first name.</font>"; $error1 = "<b><font face='arial' color ='red' size='5'>*</font></b>"; $pass="false"; $style1 = "error";} if ($lname == ""){ $msg2="<br><font color ='red'>Please enter your last name.</font>"; $error2 = "<b><font face='arial' color ='red' size='5'>*</font></b>"; $pass="false"; $style2 = "error";} if ($address1 == ""){ $msg3="<br><font color ='red'>Please enter the first line of your address.</font>"; $error3 = "<b><font face='arial' color ='red' size='5'>*</font></b>"; $pass="false"; $style3 = "error";} if ($address2 == ""){ $msg4="<br><font color ='red'>Please enter the second line of your address.</font>"; $error4 = "<b><font face='arial' color ='red' size='5'>*</font></b>"; $pass="true"; $style4 = "error";} if ($city == ""){ $msg5="<br><font color ='red'>Please enter your city.</font>"; $error5 = "<b><font face='arial' color ='red' size='5'>*</font></b>"; $pass="false"; $style5 = "error";} if ($state == ""){ $msg6="<br><font color ='red'>Please enter your state.</font>"; $error6 = "<b><font face='arial' color ='red' size='5'>*</font></b>"; $pass="false"; $style6 = "error";} if ($zip == ""){ $msg7="<br><font color ='red'>Please enter your zip code.</font>"; $error7 = "<b><font face='arial' color ='red' size='5'>*</font></b>"; $pass="false"; $style7 = "error";} if ($sendemail == ""){ $msg9="<br><font color ='red'>Please enter your email address.</font>"; $error9 = "<b><font face='arial' color ='red' size='5'>*</font></b>"; $pass="false"; $style9 = "error";} if ($phone == ""){ $msg8="<br><font color ='red'>Please enter your phone number.</font>"; $error8 = "<b><font face='arial' color ='red' size='5'>*</font></b>"; $pass="false"; $style8 = "error";} if ($refer == ""){ $msg11="<br><font color ='red'>Please enter how you found out about this site.</font>"; $error11 = "<b><font face='arial' color ='red' size='5'>*</font></b>"; $pass="false"; $style11 = "error";} if ($refer2 == ""){ $msg12="<br><font color ='red'>Please enter how you found out about this site.</font>"; $error12 = "<b><font face='arial' color ='red' size='5'>*</font></b>"; $pass="true"; $style12 = "error";} if ($sendemail != $sendemail2){ $msg10="<br><font color ='red'>Please verify your email address (both fields must be identical).</font>"; $error10 = "<b><font face='arial' color ='red' size='5'>*</font></b>"; $pass="false"; $style10 = "error";} echo $msg1; echo $msg2; echo $msg3; echo $msg4; echo $msg5; echo $msg6; echo $msg7; echo $msg8; echo $msg9; echo $msg10; echo $msg11; echo $msg12; if (!$pass) { if (!isset($email)) echo "Error, please re-send $fname" ; $todayis = date("l, F j, Y, g:i a") ; $message ="$todayis [EST] \n"; $message .="First Name: $fname \n"; $message .="Last Name: $lname \n"; $message .="Address1: $address1 \n"; $message .="Address2: $address2 \n"; $message .="City: $city \n"; $message .="State: $state \n"; $message .="Zip Code: $zip \n"; $message .="Email: $sendemail \n"; $message .="Phone: $phone \n"; $message .="Reference: $refer \n"; $message .="Reference2: $refer2 \n"; $from = "From: $sendemail\r\n"; if ($email != "") mail($email, $subject, $message, $from); ?> <script language="JavaScript"><!-- location.href = 'repair4.php'; //--></script> <?php exit();}} ?> <link href="style_repair.txt" rel="stylesheet" type="text/css"> <table width="80%" border="0" cellpadding="5"> <tr> <th align="left" valign="top" scope="col"> <form action="" method="post"> <table width="80%" border="0" cellpadding="5"> <tr> <td></td> <td><div align="left"><b>*=required fields</b></div></td> </tr> <tr> <?php if ($fnameq == true) { ?><td><div align="right"><?php echo $error1; ?><b>*</b>First Name: </div></td> <td><div align="left"><input name="fname" type="text" size="25" maxlength="40" value="<?php echo $_POST['fname']; ?>" class="<?php echo $style1; ?>"></td><?php } ?> </tr> <tr> <?php if ($lnameq == true) { ?><td><div align="right"><?php echo $error2; ?><b>*</b>Last Name: </div></td> <td><div align="left"><input name="lname" type="text" size="25" maxlength="40" value="<?php echo $_POST['lname']; ?>" class="<?php echo $style2; ?>"></td><?php } ?> </tr> <tr> <?php if ($address1q == true) { ?><td><div align="right"><?php echo $error3; ?><b>*</b>Address 1: </div></td> <td><div align="left"><input name="address1" type="text" size="25" maxlength="40" value="<?php echo $_POST['address1']; ?>" class="<?php echo $style3; ?>"></td><?php } ?> </tr> <tr> <?php if ($address2q == true) { ?><td><div align="right"><?php echo $error4; ?><b>*</b>Address 2: </div></td> <td><div align="left"><input name="address2" type="text" size="25" maxlength="40" value="<?php echo $_POST['address2']; ?>" class="<?php echo $style4; ?>"></td><?php } ?> </tr> <tr> <?php if ($cityq == true) { ?><td><div align="right"><?php echo $error5; ?><b>*</b>City: </div></td> <td><div align="left"><input name="city" type="text" size="25" maxlength="40" value="<?php echo $_POST['city']; ?>" class="<?php echo $style5; ?>"></td><?php } ?> </tr> <tr> <?php if ($stateq == true) { ?><td><div align="right"><?php echo $error6; ?><b>*</b>State: </div></td> <td><div align="left"><input name="state" type="test" size="25" maxlength="40" value="<?php echo $_POST['state']; ?>" class="<?php echo $style6; ?>"></td><?php } ?> </tr> <tr> <?php if ($zipq == true) { ?><td><div align="right"><?php echo $error7; ?><b>*</b>Zip Code: </div></td> <td><div align="left"><input name="zip" type="test" size="25" maxlength="40" value="<?php echo $_POST['zip']; ?>" class="<?php echo $style7; ?>"></td><?php } ?> </tr> <tr> <?php if ($phoneq == true) { ?><td><div align="right"><?php echo $error8; ?><b>*</b>Phone: </div></td> <td><div align="left"><input name="phone" type="text" size="25" maxlength="40" value="<?php echo $_POST['phone']; ?>" class="<?php echo $style8; ?>"></td><?php } ?> </tr> <tr> <?php if ($sendemailq == true) { ?><td><div align="right"><?php echo $error9; ?><b>*</b>Email: </div></td> <td><div align="left"><input name="sendemail" type="text" size="25" maxlength="40" value="<?php echo $_POST['sendemail']; ?>" class="<?php echo $style9; ?>"></td><?php } ?> </tr> <tr> <?php if ($sendemail2q == true) { ?><td><div align="right"><?php echo $error10; ?><b>*</b>Re-enter Email: </div></td> <td><div align="left"><input name="sendemail2" type="text" size="25" maxlength="40" value="<?php echo $_POST['sendemail2']; ?>" class="<?php echo $style10; ?>"></td><?php } ?> </tr> <tr> <?php if ($referq == true) { ?><td><div align="right"><?php echo $error11; ?><b>*</b>How did you find us? </div></td> <td><div align="left"> <select name="refer" value="<?php echo $_POST['refer']; ?>" class="<?php echo $style11; ?>"> <option value="">--choose one-- <option value="google">Google <option value="yahoo">Yahoo <option value="online advertisement">Online Advertisement <option value="StumbleUpon.com">StumbleUpon.com <option value="Facebook.com">Facebook.com <option value="newspaper">Newspaper/Printed Ad <option value="friend">Friend <option value="other search engine">Other Search Engine <option value="other">Other </select> </td><?php } ?> </tr> <tr> <?php if ($refer2q == true) { ?><td><div align="right"><?php echo $error12; ?><b>*</b>If other, please specify: </div></td> <td><div align="left"><input name="refer2" type="text" size="25" maxlength="40" value="<?php echo $_POST['refer2']; ?>" class="<?php echo $style12; ?>"></td><?php } ?> </tr> <tr> <td><div align="right?> <b><font color ='red'> <u>IMPORTANT</u>: In order to make sure you receive your confirmation email, be sure to check your junk email folder in the next 72 hours, and add the following email to your address book:<br><u> <h2><script language="javascript"> <!-- var part1 = "repair"; var part2 = "myipodbroke"; document.write(part1 + '@' + part2 + '.com'); // --> </script></h2> </u></font></b><br> </div></td> <td><div align="left"><input type="hidden" name="screen_type2" value="<?php $screen_type2 ?>"> <input type="submit" name="submit" value="Submit and Continue to Payment"></td> </td> </tr> </table> </form> </th> </tr> </table> <!--END MAIN CONENT ***********************************************########## END EDIT SECTION ##########********************** --> <br><br><br><br><br> <br><br><br><br><br> <center>Web site and all contents © MyiPodBroke.com 2005-2008, All rights reserved.</center> <br><br> </td> <!--END CONTENT AREA ****************************************************************** --> </tr> </> <!-- END MAIN TABLE --> </body> PAGE 3 (repair4.php): <?php session_start(); $screen_type3 = $_SESSION['screen_type2']; ?> <myipodbroke.com> <head> <title>MyiPodBroke: iPod Repair</title> <link rel=stylesheet type="text/css" href="style_repair.txt"> <meta name="description" content="This is a site to help you either fix your iPod, or get it repaired by us, MyiPodBroke.com. I have quick and efficient service, and would love to help you. This is for any iPod problems or troubles, broken iPods, and for any iPods that need to be fixed, repaired, helped, saved, restored, renewed, or otherwise mended!"> <meta name="keywords" content="ipod repair, ipod help, fix ipods, ipod, fix, repair, help, ipod diagnostics, ipod secrets, my ipod broke!, myipodbroke, myipodbroke.com, help my ipod, ipodmedic, theipodmedic.com, fast ipod repair, ipod screen repair, ipod parts, ipod accessories, ipod troubles, ipod problems, ipod dianostics, ipodreair, ipodrepair, ipod nano, ipod nano repair, ipod nano screen repair, ipod video, ipod video repair, ipod video screen repair, ipod screen repair, ipod sad face, sad face, unhappy ipod, sick ipod, ipod, ipods, ipods for sale, buy ipods, buy ipod, sell your old ipod, sell broken ipod, sell my ipod, buy broken ipods, ipod secrets, ipod self diagnostics, ipod diagnostics, free ipod diagnostics, self diagnostics, ipod diagnosing, ipod diagnose, ipod problem fixer, myipodbroke, my ipod broke"> </head> <body bgcolor="#000000"> <center> <table width="800" height="65" cellpadding="0" cellspacing="0" border="0"> <tr valign="top"> <td width="300" height="65" cellpadding="0" cellspacing="0" border="0"> <img src="img/logo.jpg" width="300" height="65"> </td> <td width="300" height="65" cellpadding="0" cellspacing="0" border="0" bgcolor="#000000"> </td> <td width="200" height="65" cellpadding="0" cellspacing="0" border="0" bgcolor="#000000"> <!-- DATE SCRIPT START ********** --> <font color="#10E500"> <SCRIPT Language="JavaScript"> <!-- hide from old browsers function GetDay(intDay){ var DayArray = new Array("Sunday", "Monday", "Tuesday", "Wednesday", "Thursday", "Friday", "Saturday") return DayArray[intDay] } function GetMonth(intMonth){ var MonthArray = new Array("January", "February", "March", "April", "May", "June", "July", "August", "September", "October", "November", "December") return MonthArray[intMonth] } function getDateStrWithDOW(){ var today = new Date() var year = today.getYear() if(year<1000) year+=1900 var todayStr = GetDay(today.getDay()) + ", " todayStr += GetMonth(today.getMonth()) + " " + today.getDate() todayStr += ", " + year return todayStr } //--> </SCRIPT> <SCRIPT Language="JavaScript"> <!-- hide from old browsers document.write(getDateStrWithDOW()) //--> </SCRIPT> </font> <!-- DATE SCRIPT END ********** --> </td> </tr> </table> <table width="800" height="25" cellpadding="0" cellspacing="0" border="0"> <tr valign="top"> <td width="48" height="25" cellpadding="0" cellspacing="0" border="0" bgcolor="#000000"> <a href="index.html" onMouseOver = "rollover('home')" onMouseOut = "rollout('home')"> <img id="home" src="img/navigation/home.jpg" width="48" height="25" onMouseOver="document.images['home'].src = 'img/navigation/home-over.jpg'" onMouseOut="document.images['home'].src = 'img/navigation/home.jpg'" onMouseDown="document.images['home'].src = 'img/navigation/home-down.jpg'" onMouseUp="document.images['home'].src = 'img/navigation/home-over.jpg'" onLoad="new Image().src='img/navigation/home-over.jpg'; new Image().src='img/navigation/home-down.jpg'" hspace="0" border="0" alt="Home"> </a> </td> <td width="88" height="25" cellpadding="0" cellspacing="0" border="0" bgcolor="#000000"> <a href="repair.html"> <img id="repair" src="img/navigation/repair-over.jpg" width="88" height="25" onMouseOver="document.images['repair'].src = 'img/navigation/repair-over.jpg'" onMouseOut="document.images['repair'].src = 'img/navigation/repair-over.jpg'" onMouseDown="document.images['repair'].src = 'img/navigation/repair-down.jpg'" onMouseUp="document.images['repair'].src = 'img/navigation/repair-over.jpg'" onLoad="new Image().src='img/navigation/repair-over.jpg'; new Image().src='img/navigation/repair-down.jpg'" hspace="0" border="0" alt="Repair"> </a> </td> <td width="122" height="25" cellpadding="0" cellspacing="0" border="0" bgcolor="#000000"> <a href="diagnostics.html"> <img id="ipoddiagnostics" src="img/navigation/ipoddiagnostics.jpg" width="122" height="25" onMouseOver="document.images['ipoddiagnostics'].src = 'img/navigation/ipoddiagnostics-over.jpg'" onMouseOut="document.images['ipoddiagnostics'].src = 'img/navigation/ipoddiagnostics.jpg'" onMouseDown="document.images['ipoddiagnostics'].src = 'img/navigation/ipoddiagnostics-down.jpg'" onMouseUp="document.images['ipoddiagnostics'].src = 'img/navigation/ipoddiagnostics-over.jpg'" onLoad="new Image().src='img/navigation/ipoddiagnostics-over.jpg'; new Image().src='img/navigation/ipoddiagnostics-down.jpg'" hspace="0" border="0" alt="iPod Diagnostics"> </a> </td> <td width="64" height="25" cellpadding="0" cellspacing="0" border="0" bgcolor="#000000"> <a href="support.html"> <img id="support" src="img/navigation/support.jpg" width="64" height="25" onMouseOver="document.images['support'].src = 'img/navigation/support-over.jpg'" onMouseOut="document.images['support'].src = 'img/navigation/support.jpg'" onMouseDown="document.images['support'].src = 'img/navigation/support-down.jpg'" onMouseUp="document.images['support'].src = 'img/navigation/support-over.jpg'" onLoad="new Image().src='img/navigation/support-over.jpg'; new Image().src='img/navigation/support-down.jpg'" hspace="0" border="0" alt="Support"> </a> </td> <td width="110" height="25" cellpadding="0" cellspacing="0" border="0" bgcolor="#000000"> <a href="contactabout.html"> <img id="contactabout" src="img/navigation/contactabout.jpg" width="110" height="25" onMouseOver="document.images['contactabout'].src = 'img/navigation/contactabout-over.jpg'" onMouseOut="document.images['contactabout'].src = 'img/navigation/contactabout.jpg'" onMouseDown="document.images['contactabout'].src = 'img/navigation/contactabout-down.jpg'" onMouseUp="document.images['contactabout'].src = 'img/navigation/contactabout-over.jpg'" onLoad="new Image().src='img/navigation/contactabout-over.jpg'; new Image().src='img/navigation/contactabout-down.jpg'" hspace="0" border="0" alt="Contact/About"> </a> </td> <td width="368" height="25" cellpadding="0" cellspacing="0" border="0" bgcolor="#000000"> </td> </tr> </table> <table width="800" height="15" cellpadding="0" cellspacing="0" border="0"> <tr> <td width="800" height="15" cellpadding="0" cellspacing="0" border="0" background="img/subbar.jpg"> <a href="repair.html"></a> <a href="diagnostics.html"></a> <a href="diagnosticservice.html"></a> </td> </tr> </table> <!-- MAIN TABLE START **************** --> <table width="800" height="100%" cellpadding="0" cellspacing="0" border="0"> <tr valign="top"> <td width="800" height="100%" cellpadding="0" cellspacing="0" border="0"> <br> <!-- MAIN CONTENT START ******************************************* ##########START EDIT SECTION ##########*********************** --> <img src="img/progress_repair/progress4.jpg" width="800" height="25"> <?php echo $screen_type3; ?> <!-- <?php $screen = $_GET[ "screen_type3"]; if ($screen == "video") { $cost = "50"; } else { $cost = "20"; } echo $cost; ?> --> <h1>Complete your order...</h1> <br> By clicking below to order MyiPodBroke.com's Diagnostic Service,<br>you are agreeing to the <a href="terms.html" target="_blank">terms & conditions</a> of MyiPodBroke.com.<br><br> All payments are secure through PayPal. By clicking the "Purchase Service!" button below, you will be redirected to PayPal's secure page, where you can pay with PayPal or other major credit cards. <br> <br> <b><font color ='red'> <u>IMPORTANT</u>: In order to make sure you receive your confirmation email, be sure to check your junk email folder in the next 72 hours, and add the following email to your address book:<br><u> <h2><script language="javascript"> <!-- var part1 = "repair"; var part2 = "myipodbroke"; document.write(part1 + '@' + part2 + '.com'); // --> </script></h2> </u></font></b> <br> <br> <!-- START PAYPAL BUTTON --> <form action="https://www.paypal.com/cgi-bin/webscr" method="post"> <input type="hidden" name="cmd" value="_xclick"> <input type="hidden" name="business" value="repair@myipodbroke.com"> <input type="hidden" name="item_name" value="<?php echo $screen_type2 ?> iPod Screen Repair"> <input type="hidden" name="item_number" value="400"> <input type="hidden" name="amount" value="<?php echo $cost ?>"> <input type="hidden" name="shipping" value="8.99"> <input type="hidden" name="no_shipping" value="2"> <input type="hidden" name="return" value="http://myipodbroke.com/repair5.html"> <input type="hidden" name="cancel_return" value="http://myipodbroke.com/cancel_order.html"> <input type="hidden" name="currency_code" value="USD"> <input type="hidden" name="tax" value="0.00"> <input type="hidden" name="lc" value="US"> <input type="hidden" name="bn" value="PP-BuyNowBF"> <input type="image" src="http://myipodbroke.com/img/service_button.jpg" border="0" name="submit" alt="Make payments with PayPal - it's fast, free and secure!"> <img alt="" border="0" src="https://www.paypal.com/en_US/i/scr/pixel.gif" width="1" height="1"> </form> (You will be transferred to a secure PayPal checkout page to confirm your order.) <!-- END PAYPAL BUTTON --> <br> <br> <!--(Note: the $0.01 for the service is only because PayPal requires the item to have some cost. In actuallity, you are paying $8.99 for return shipping, and nothing for the service, so it is "Free".) <br><br>--> You will be sent a confirmation email with instructions on where to send your iPod within three (3) business days. <br><br> Best of Luck!<br> Peder, MyiPodBroke.com </fieldset> <!-- <object width="800" height="500"> <param name="movie" value="repair.swf"> <embed src="repair.swf" width="800" height="500"> </embed> </object> --> <!--END MAIN CONENT ***********************************************########## END EDIT SECTION ##########********************** --> <br><br><br><br><br> <br><br><br><br><br> <center>Web site and all contents © MyiPodBroke.com 2005-2008, All rights reserved.</center> <br><br> </td> <!--END CONTENT AREA ****************************************************************** --> </tr> </table> <!-- END MAIN TABLE --> </body> Quote Link to comment Share on other sites More sharing options...
jpratt Posted June 5, 2009 Share Posted June 5, 2009 Looking at the site and going thru the process it looks like the session is still there because it writes the session cookie name to my machine. there is just a problem with the variable from the post im guessing. Quote Link to comment Share on other sites More sharing options...
jpratt Posted June 5, 2009 Share Posted June 5, 2009 i dont think these thing will help but dont put a space when getting the post value $_POST[ "screen_type"] use this instead $_POST["screen_type"]. Also good html has closing tags, so your option tags need to close. Quote Link to comment Share on other sites More sharing options...
PFMaBiSmAd Posted June 5, 2009 Share Posted June 5, 2009 What does a phpinfo(); statement show for register_globals? Quote Link to comment Share on other sites More sharing options...
ethan6 Posted June 5, 2009 Author Share Posted June 5, 2009 any idea what's wrong with the post of the variable? Quote Link to comment Share on other sites More sharing options...
PFMaBiSmAd Posted June 5, 2009 Share Posted June 5, 2009 This is the most likely cause - What does a phpinfo(); statement show for register_globals? Are you going to check what the setting is? Quote Link to comment Share on other sites More sharing options...
ethan6 Posted June 5, 2009 Author Share Posted June 5, 2009 This is the most likely cause - What does a phpinfo(); statement show for register_globals? Are you going to check what the setting is? how do i check it? sorry i'm not to familiar with all of this Quote Link to comment Share on other sites More sharing options...
PFMaBiSmAd Posted June 5, 2009 Share Posted June 5, 2009 http://us2.php.net/phpinfo Quote Link to comment Share on other sites More sharing options...
ethan6 Posted June 6, 2009 Author Share Posted June 6, 2009 hey thanks everybody.. i figured it out: i switched to using $_GET instead of $_POST and it worked.. i think something in my mailer script was clearing the $_POST or something. THANKS again! Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.