Jump to content

Recommended Posts

I am creating a multi-page form for data on an html form and processing it with PHP.

 

i am using a hidden input tage within the forms with the data i want to carry to the next page.

 

I embedded php into the 'value' of the input tag:

 

<td><input type="hidden" name="userid" value="<?php echo $userid; ?>"/></td>

 

however the data is on the page i am currently on because i tested it elsewhere on the page with the echo statement, but it is not being carried over to the next page.

Is there something wrong in the PHP echo statement?

 

Thanks,

jcjst21

sure.  The output will be later in another area of the system.  I haven't built that page yet; but I am testing to make sure the data populates in the myPHPadmin area and it's not.  Actually in this code; NOTHING is writing to the table. 

 

<?php
$insuranceName=$_POST['InsuranceName'];
$insurancePolicyNo=$_POST['insurancePolicyNo'];
$insuranceGroupNo=$_POST['insuranceGroupNo'];
$subscriberFName=$_POST['subscriberFName'];
$subscriberLName=$_POST['subscriberLName'];
$camperID=$_POST['camperID'];
session_start();
$userid=$_SESSION['userID'];
$firstName=$_SESSION['fname'];
$lastName=$_SESSION['lname'];

$con=mysql_connect("xxxx", "xxxx", "xxxx") or die ("cannot connect");
mysql_select_db("testcamp") or die ("cannot select database");

$sql="INSERT INTO camperInsurance(camperID, cInsuranceNameID, cInsurancePolicyNo, camperInsurancePolicyGroupNo, subscriberOtherFName, subscriberOtherLName) VALUES('$camperID', '$insuranceName', '$insurancePolicyNo', '$insuranceGroupNo', '$subscriberFName', '$subscriberLName')";

mysql_close($con);
?>

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.