simon551 Posted June 11, 2008 Share Posted June 11, 2008 I don't know where to find the bad code. I haven't seen this error before. Can you help me troubleshoot my code. This is the full error: Warning: Unknown: Your script possibly relies on a session side-effect which existed until PHP 4.2.3. Please be advised that the session extension does not consider global variables as a source of data, unless register_globals is enabled. You can disable this functionality and this warning by setting session.bug_compat_42 or session.bug_compat_warn to off, respectively. in Unknown on line 0 full code: <?php session_start(); require_once('../connections/conn_org.php'); require_once('../scripts/math.php'); $travId=$_POST['emp1']; if ($travId==0) { $travelername=$_POST['trav_text']; } else { $query ="SELECT CONCAT(tblemployees.empFname, ' ', tblemployees.empLname) as 'employee', users.email, mgrs.mgrname, mgrs.mgremail from tblemployees LEFT JOIN users ON users.empId=tblemployees.empId INNER JOIN (SELECT tblemployees.empId, CONCAT(empFname, ' ', empLname) as 'mgrname', email AS 'mgremail' FROM tblemployees LEFT JOIN users ON users.empId=tblemployees.empId) AS mgrs ON mgrs.empId=tblemployees.teamId WHERE tblemployees.empId=$travId"; $rs=mysql_query($query, $conn_org) or die($query.mysql_error()); $row=mysql_fetch_assoc($rs); $travelername=$row['employee']; $traveleremail=$row['email']; $travelermanageremail=$row['mgremail']; $travelermanagername=$row['mgrname']; //over-ride the manager approval in cas of manager being email (top execs) if ($travelermanagername==$PRESIDENT) { $travelermanageremail=$travelername; $travelermanagername=$traveleremail; } } $_SESSION['traveler']=$travelername; $_SESSION['traveleremail']=$traveleremail; $_SESSION['travelermanageremail']=$travelmanageremail; $_SESSION['travelermanagername']=$travelmanagername; //on this page we just take all the 'post' data and echo it back to the user for approval. $empId=$_COOKIE['empid'.$companyName]; $projId=$_POST['projId']; $_SESSION['projId']=$projId; //look up the project Information mysql_select_db($database_conn_org, $conn_org); $query="SELECT concat(`tblclients`.`ClientName`,'-',tbldivisions.division,': ', `projects`.`ProjName`, ' | ', COALESCE(DATE_FORMAT(projects.ProjBegDate, '%m/%d/%y'),'unknown'), '-', COALESCE(DATE_FORMAT(projects.ProjEndDate, '%m/%d/%y'),'unknown'),' | ', COALESCE(`projects`.`projLocation`,'unknown')) AS project, projId, projects.contractId FROM projects Inner Join projtypes ON projtypes.ProjTypeID = projects.projTypeID Inner Join contracts ON projects.contractId = contracts.contractId Inner Join tblclients ON contracts.clientID = tblclients.ClientID Inner Join tbldivisions ON contracts.divisionId = tbldivisions.DivID Left Join tblemployees ON projects.empID_mgr = tblemployees.EmpID WHERE projects.projId=$projId"; $rs=mysql_query($query, $conn_org) or die(mysql_error()); $row=mysql_fetch_assoc($rs); $row['project'] = str_replace("&", "&", $row['project']); $row['project'] = str_replace("<", "-", $row['project']); $row['project'] = str_replace(">", "-", $row['project']); $project=$row['project']; $rentalCar=$_POST['rentalCar']; $_SESSION['rentalCar']=$rentalCar; $specialR=$_POST['specialRequests']; $_SESSION['specialRequests']=$specialR; $_SESSION['projectName']=$project; //These are the departure dates $date1= ($_POST['departDate1']); $_SESSION['departDate1']=$date1; $date2= ($_POST['departDate2']); $_SESSION['departDate2']=$date2; $date3= ($_POST['departDate3']); $_SESSION['departDate3']=$date3; $_SESSION['destination1'] = $_POST['destination1']; $_SESSION['airfareType1'] = $_POST['airfareType1']; $_SESSION['timeCriteria1'] = $_POST['timeCriteria1']; $_SESSION['firstTime1'] = $_POST['firstTime1']; $_SESSION['secondTime1'] = $_POST['secondTime1']; $_SESSION['thirdTime1'] = $_POST['thirdTime1']; $_SESSION['destination2'] = $_POST['destination2']; $_SESSION['airfareType2'] = $_POST['airfareType2']; $_SESSION['timeCriteria2'] = $_POST['timeCriteria2']; $_SESSION['firstTime2'] = $_POST['firstTime2']; $_SESSION['secondTime2'] = $_POST['secondTime2']; $_SESSION['thirdTime2'] = $_POST['thirdTime2']; $_SESSION['destination3'] = $_POST['destination3']; $_SESSION['airfareType3'] = $_POST['airfareType3']; $_SESSION['timeCriteria3'] = $_POST['timeCriteria3']; $_SESSION['firstTime3'] = $_POST['firstTime3']; $_SESSION['secondTime3'] = $_POST['secondTime3']; $_SESSION['thirdTime3'] = $_POST['thirdTime3']; //there may be up to 3 detail entries ?> <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> <html xmlns="http://www.w3.org/1999/xhtml"> <head> <!--[if IE]> <script type="text/javascript"> window.location="../browsererror.html"; </script> <![endif]--> <meta http-equiv="Content-Type" content="text/html; charset=utf-8" /> <title>Travel Request -- Confirm Details</title> <link href="../Styles/global.css" rel="stylesheet" type="text/css" /> <link href="../Styles/layout.css" rel="stylesheet" type="text/css" /> </head> <body> <div id="main"> <h2>Please review your travel request:</h2> <?php echo '<h3>General Information</h3> <h4> Traveler: '.$_SESSION['traveler'].' </h4> <h4> Traveling for Project: '.$project. '</h4> <h3>Travel Details</h3> <h4> First Destination: '. $_POST['destination1'].'</h4>'. 'Departure Date: '. $date1.'<br />'. 'Airfare Type: '. $_POST['airfareType1'].'<br />'. 'Arrival or Departure: '. $_POST['timeCriteria1'].'<br/ >'. 'First Time Option: '. $_POST['firstTime1'].'<br />'. 'Second Time Option: '. $_POST['secondTime1'].'<br />'. 'Third Time Option: '. $_POST['thirdTime1'].'<br />'; if (! ($_POST['destination2'])=='') { echo '<br /> <h4> Second Destination: '. $_POST['destination2'].'</h4>'. 'Departure Date: '. $date2.'<br />'. 'Airfare Type: '. $_POST['airfareType2'].'<br />'. 'Arrival or Departure: '. $_POST['timeCriteria2'].'<br/ >'. 'First Time Option: '. $_POST['firstTime2'].'<br />'. 'Second Time Option: '. $_POST['secondTime2'].'<br />'. 'Third Time Option: '. $_POST['thirdTime2'].'<br />'; } if (! ($_POST['destination3'])=='') { echo '<br /> <h4> Third Destination: '. $_POST['destination3'].'</h4>'. 'Departure Date: '. $date3.'<br />'. 'Airfare Type: '. $_POST['airfareType3'].'<br />'. 'Arrival or Departure: '. $_POST['timeCriteria3'].'<br/ >'. 'First Time Option: '. $_POST['firstTime3'].'<br />'. 'Second Time Option: '. $_POST['secondTime3'].'<br />'. 'Third Time Option: '. $_POST['thirdTime3'].'<br />'; } $car=$_SESSION['rentalCar']; if ($car=='') { $car='None'; } echo '<br /> <h4>Rental Car Requested: </h4>'.$car.'<br /> <h4>Special Requests: </h4>'.$specialR.'<br />'; ?> <h3> If everything looks okay, press the Submit Request button. Otherwise, please press the Edit Request button.</h3> <form> <input type="button" onclick="window.location='../postingfiles/travelRequest.php'" value="Submit Request" class="quietButton"/> <input type="button" onclick="window.location='../travel/request.php'" value="Edit Request" class="mimicButton"/> </form> </div> </body> </html> Thanks! Link to comment https://forums.phpfreaks.com/topic/109792-solved-warning-unknown-your-script-possibly-relies-on-a-session-side-effect-whic/ Share on other sites More sharing options...
Orio Posted June 11, 2008 Share Posted June 11, 2008 I think this should solve your problem: You wrote on line 27 $travelmanageremail instead of $travelermanageremail. Change line 27 into: $_SESSION['travelermanageremail']=$travelermanageremail; Orio. Link to comment https://forums.phpfreaks.com/topic/109792-solved-warning-unknown-your-script-possibly-relies-on-a-session-side-effect-whic/#findComment-563418 Share on other sites More sharing options...
simon551 Posted June 11, 2008 Author Share Posted June 11, 2008 thank you so much for digging through that. so, if I understand, it's reading $_SESSION['travelermanageremail']= ; and the error I got was generated by that? yikes. thanks again. Link to comment https://forums.phpfreaks.com/topic/109792-solved-warning-unknown-your-script-possibly-relies-on-a-session-side-effect-whic/#findComment-563447 Share on other sites More sharing options...
Orio Posted June 11, 2008 Share Posted June 11, 2008 The problem (as far as I understood after reading about this problem) was that because that variable name was misspelled, that session variable got a null value, and then there's some bug with that and register_globals. Not too sure whats the problem. But the fact is that you had one variable set as null so I guessed the problem was a misspelled variable name. Orio. Link to comment https://forums.phpfreaks.com/topic/109792-solved-warning-unknown-your-script-possibly-relies-on-a-session-side-effect-whic/#findComment-563453 Share on other sites More sharing options...
simon551 Posted June 11, 2008 Author Share Posted June 11, 2008 thanks again. I read the blurb about bug with register_globals but didn't understand it so I posted here. cheers. Link to comment https://forums.phpfreaks.com/topic/109792-solved-warning-unknown-your-script-possibly-relies-on-a-session-side-effect-whic/#findComment-563501 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.