8 Replies Latest reply on May 4, 2008 3:01 AM by (Dale_Andrew)

    Getting two session varibles into one hidden form field

      In a hypothetical exaple, if my first session variable is kt_user_name and it's value is bestperson, and my second variable session is kt_exerreference and it's value is ex1a, I'd like have the value submitted in the hidden form field to be bestpersonex1a (without any spaces if possible). This is the code that I have for the hidden form field that submits the server variables: <br /> <br /> <form> <input type="hidden" name="exerreference" id="exerreference" value="<?php echo $_SESSION['kt_user_name'].$_SESSION['kt_login_user']; ?>" /> <br /> <br />But the form also has a php section above the head that seems to add the values to the databse. Here is the beginning of the code with the the first 4 values: <br /> <br />// Add columns <br />$ins_exer1-&gt;setTable("exer1"); <br />$ins_exer1-&gt;addColumn("user_name", "STRING_TYPE", "SESSION", "kt_user_name"."kt_login_user"); <br />$ins_exer1-&gt;addColumn("exerreference", "STRING_TYPE", "SESSION", "kt_user_name"); <br />$ins_exer1-&gt;addColumn("Shapes_present_with_target", "STRING_TYPE", "POST", "Shapes_present_with_target"); <br /> <br />My question is how do I also configure the code in the 2nd string of this "Add Columns" code to insert both server variables? When I put one server variable as the value in this code (0n line 2), it only inserted the one session varialbe value (not 2 as are in the form field). As you can see, I currently have "kt_user_name"."kt_login_user" which is givig me server errors. <br /> <br />Here's another idea that didn't work yet: <br /> <br />// Add columns <br />$user = $_SESSION['kt_user_name'].$_SESSION['kt_login_user']; <br />$ins_exer1-&gt;setTable("exer1"); <br />$ins_exer1-&gt;addColumn("user_name", "STRING_TYPE", "SESSION", "$user"); <br />$ins_exer1-&gt;addColumn("exerreference", "STRING_TYPE", "SESSION", "kt_user_name"); <br />$ins_exer1-&gt;addColumn("Shapes_present_with_target", "STRING_TYPE", "POST", "Shapes_present_with_target"); <br /> <br />Any ideas on the correct syntax? <br /> <br />Thanks for any help.</form>