2 Replies Latest reply on May 8, 2008 1:55 PM by (Dale_Andrew)

    Need Help With Combining Two Variables For A Redirect

    Level 1
      Hello- <br /> <br />In a different part of my site (built with ADDT) I have this script that creates a variable by combining two session variables, and then the new variable is submitted into a mysqul database table using a hidden form field: <br /> <br /> <form> <input type="hidden" name="exerreference" id="exerreference" value="<?php echo $_SESSION['kt_login_user']; ?><?php echo $_SESSION['kt_exer_reference']; ?> <br />" /> <br /> <br />There is also this part of the script in the header script: <br /> <br />$ins_exer1-&gt;addColumn("exerreference", "STRING_TYPE", "POST", "exerreference"); <br /> <br />What I am trying to do now on another page is combine a session variable "kt_login_user" with a piece of dynamic text "AA" so that I can compare it to the field "exerreference" that was inserted into the database using the above script. If the two variables match, the idea is to have a redirect to another page. <br /> <br />So in a hypothetical example, if the value of the session variable "kt_login_user " is "bestperson," and static text is "AA" then I need to create the variable bestpersonAA (because this is how the variables exist in the exerreference recordset). This variable bestpersonAA then needs to be compared to the recordset value exerreference and if they match, the page redirects to ../previous/portalpre.php. If the two variables do not match, then there is no redirect. <br /> <br />Here is what I have so far: <br /> <br />if (isset($_SESSION['kt_login_user'])) <br />{ <br />if ($_SESSION['kt_login_user'.'AA'] = $row_Recordsetexer1['exerreference']) <br />{ <br /> header ("Location: ../previous/portalpre.php"); <br />} <br />} <br /> <br />The script doesn't work yet - it's redirecting regardless of if the two varibles match. Any ideas on the correct syntax to get this working correctly? <br /> <br />Thanks <br />Dale</form>