Jump to content

multiple form troubles


sandbudd

Recommended Posts

had this working and am not sure what I did...this is 3 part form with sessions.  The second and the third page populate but the first does not.  I am sure that I am missing something easy...

 

session page 2

<?php

//let's start the session
session_start();

//now, let's register our session variables
session_register('firstname');
session_register('lastname');
session_register('address');
session_register('city');
session_register('state');
session_register('zip');
session_register('homephonearea');
session_register('homephoneprefix');
session_register('homephone');
session_register('cellphonearea');
session_register('cellphoneprefix');
session_register('cellphone');
session_register('email');
session_register('addressyears');
session_register('addressmonths');
session_register('previousaddressyears');
session_register('previousaddressmonths');
session_register('rent');
session_register('monthlyrent');
session_register('yearsarea');
session_register('monthsarea');
session_register('birthdateday');
session_register('birthdatemonth');
session_register('birthdateyears');
session_register('soc1');
session_register('soc2');
session_register('soc3');
session_register('drlyes');



//finally, let's store our posted values in the session variables
$_SESSION['firstname'] = $_POST['firstname'];
$_SESSION['lastname'] = $_POST['lastname'];
$_SESSION['address'] = $_POST['address'];
$_SESSION['city'] = $_POST['city'];
$_SESSION['state'] = $_POST['state'];
$_SESSION['zip'] = $_POST['zip'];
$_SESSION['homephonearea'] = $_POST['homephonearea'];
$_SESSION['homephoneprefix'] = $_POST['homephoneprefix'];
$_SESSION['homephone'] = $_POST['homephone'];
$_SESSION['cellphonearea'] = $_POST['cellphonearea'];
$_SESSION['cellphoneprefix'] = $_POST['cellphoneprefix'];
$_SESSION['cellphone'] = $_POST['cellphone'];
$_SESSION['email'] = $_POST['email'];
$_SESSION['addressyears'] = $_POST['addressyears'];
$_SESSION['addressmonths'] = $_POST['addressmonths'];
$_SESSION['previousaddressyears'] = $_POST['previousaddressyears'];
$_SESSION['previousaddressmonths'] = $_POST['previousaddressmonths'];
$_SESSION['rent'] = $_POST['rent'];
$_SESSION['monthlyrent'] = $_POST['monthlyrent'];
$_SESSION['yearsarea'] = $_POST['yearsarea'];
$_SESSION['monthsarea'] = $_POST['monthsarea'];
$_SESSION['birthdateday'] = $_POST['birthdateday'];
$_SESSION['birthdatemonth'] = $_POST['birthdatemonth'];
$_SESSION['birthdateyears'] = $_POST['birthdateyears'];
$_SESSION['soc1'] = $_POST['soc1'];
$_SESSION['soc2'] = $_POST['soc2'];
$_SESSION['soc3'] = $_POST['soc3'];
$_SESSION['drlyes'] = $_POST['drlyes'];


?>

 

page 3

<?php

//let's start the session
session_start();

//now, let's register our session variables
session_register('firstname');
session_register('lastname');
session_register('address');
session_register('city');
session_register('state');
session_register('zip');
session_register('homephonearea');
session_register('homephoneprefix');
session_register('homephone');
session_register('cellphonearea');
session_register('cellphoneprefix');
session_register('cellphone');
session_register('email');
session_register('addressyears');
session_register('addressmonths');
session_register('previousaddressyears');
session_register('previousaddressmonths');
session_register('rent');
session_register('monthlyrent');
session_register('yearsarea');
session_register('monthsarea');
session_register('birthdateday');
session_register('birthdatemonth');
session_register('birthdateyears');
session_register('soc1');
session_register('soc2');
session_register('soc3');
session_register('drlyes');
session_register('employer');
session_register('jobtitle');
session_register('employeryears');
session_register('employermonths');
session_register('netincome');
session_register('previousemployeryears');
session_register('previousemployermonths');
session_register('employerphone');
session_register('repo');
session_register('reponumber');
session_register('repobank');
session_register('repoyears');
session_register('repomonths');
session_register('repobanktwo');
session_register('repoyearstwo');
session_register('repomonthstwo');
session_register('cosign');
session_register('tradeyes');
session_register('genre');
session_register('player');
session_register('tradepayoff');
session_register('bk');
session_register('discharged');
session_register('bkyears');
session_register('bkmonths');
session_register('dpamount');




//finally, let's store our posted values in the session variables
$_SESSION['firstname'] = $_POST['firstname'];
$_SESSION['lastname'] = $_POST['lastname'];
$_SESSION['address'] = $_POST['address'];
$_SESSION['city'] = $_POST['city'];
$_SESSION['state'] = $_POST['state'];
$_SESSION['zip'] = $_POST['zip'];
$_SESSION['homephonearea'] = $_POST['homephonearea'];
$_SESSION['homephoneprefix'] = $_POST['homephoneprefix'];
$_SESSION['homephone'] = $_POST['homephone'];
$_SESSION['cellphonearea'] = $_POST['cellphonearea'];
$_SESSION['cellphoneprefix'] = $_POST['cellphoneprefix'];
$_SESSION['cellphone'] = $_POST['cellphone'];
$_SESSION['email'] = $_POST['email'];
$_SESSION['addressyears'] = $_POST['addressyears'];
$_SESSION['addressmonths'] = $_POST['addressmonths'];
$_SESSION['previousaddressyears'] = $_POST['previousaddressyears'];
$_SESSION['previousaddressmonths'] = $_POST['previousaddressmonths'];
$_SESSION['rent'] = $_POST['rent'];
$_SESSION['monthlyrent'] = $_POST['monthlyrent'];
$_SESSION['yearsarea'] = $_POST['yearsarea'];
$_SESSION['monthsarea'] = $_POST['monthsarea'];
$_SESSION['birthdateday'] = $_POST['birthdateday'];
$_SESSION['birthdatemonth'] = $_POST['birthdatemonth'];
$_SESSION['birthdateyears'] = $_POST['birthdateyears'];
$_SESSION['soc1'] = $_POST['soc1'];
$_SESSION['soc2'] = $_POST['soc2'];
$_SESSION['soc3'] = $_POST['soc3'];
$_SESSION['drlyes'] = $_POST['drlyes'];
$_SESSION['employer'] = $_POST['employer'];
$_SESSION['jobtitle'] = $_POST['jobtitle'];
$_SESSION['employeryears'] = $_POST['employeryears'];
$_SESSION['employermonths'] = $_POST['employermonths'];
$_SESSION['netincome'] = $_POST['netincome'];
$_SESSION['previousemployeryears'] = $_POST['previousemployeryears'];
$_SESSION['previousemployermonths'] = $_POST['previousemployermonths'];
$_SESSION['employerphone'] = $_POST['employerphone'];
$_SESSION['repo'] = $_POST['repo'];
$_SESSION['reponumber'] = $_POST['reponumber'];
$_SESSION['repobank'] = $_POST['repobank'];
$_SESSION['repoyears'] = $_POST['repoyears'];
$_SESSION['repomonths'] = $_POST['repomonths'];
$_SESSION['repobanktwo'] = $_POST['repobanktwo'];
$_SESSION['repoyearstwo'] = $_POST['repoyearstwo'];
$_SESSION['repomonthstwo'] = $_POST['repomonthstwo'];
$_SESSION['cosign'] = $_POST['cosign'];
$_SESSION['tradeyes'] = $_POST['tradeyes'];
$_SESSION['genre'] = $_POST['genre'];
$_SESSION['player'] = $_POST['player'];
$_SESSION['tradepayoff'] = $_POST['tradepayoff'];
$_SESSION['bk'] = $_POST['bk'];
$_SESSION['discharged'] = $_POST['discharged'];
$_SESSION['bkyears'] = $_POST['bkyears'];
$_SESSION['bkmonths'] = $_POST['bkmonths'];
$_SESSION['dpamount'] = $_POST['dpamount'];



?>

 

submit

 

<?php

//let's start our session, so we have access to stored data
session_start();
$con = mysql_connect("","","");
if (!$con)
  {
  die('Could not connect: ' . mysql_error());
  }

mysql_select_db("", $con);
//let's create the query


//let's run the query
mysql_query($insert_query);
$sql="INSERT INTO application (firstname, lastname, address, city, state, zip, homephonearea, homephoneprefix, homephone, cellphonearea, cellphoneprefix, cellphone, email, addressyears, addressmonths, previousaddressyears, previousaddressmonths, rent, monthlyrent, yearsarea, monthsarea, birthdateday, birthdatemonth, birthdateyears, soc1, soc2, soc3, drlyes, employer, jobtitle, employeryears, employermonths, netincome, previousemployeryears, previousemployermonths, employerphone, repo, reponumber, repobank, repoyears, repomonths, repobanktwo, repoyearstwo, repomonthstwo, cosign, tradeyes, genre, player, tradepayoff, bk, discharged, bkyears, bkmonths, dpamount, genre3, player3)
VALUES
('$_SESSION[firstname]','$_SESSION[lastname]','$_SESSION[address]','$_SESSION[city]','$_SESSION[state]','$_SESSION[zip]','$_SESSION[homephonearea]','$_SESSION[homephoneprefix]','$_SESSION[homephone]','$_SESSION[cellphonearea]','$_SESSION[cellphoneprefix]','$_SESSION[cellphone]','$_SESSION[email]','$_SESSION[addressyears]','$_SESSION[addressmonths]','$_SESSION[previousaddressyears]','$_SESSION[previousaddressmonths]','$_SESSION[rent]','$_SESSION[monthlyrent]','$_SESSION[yearsarea]','$_SESSION[monthsarea]','$_SESSION[birthdateday]','$_SESSION[birthdatemonth]','$_SESSION[birthdateyears]','$_SESSION[soc1]','$_SESSION[soc2]','$_SESSION[soc3]','$_SESSION[drlyes]','$_SESSION[employer]','$_SESSION[jobtitle]','$_SESSION[employeryears]','$_SESSION[employermonths]','$_SESSION[netincome]','$_SESSION[previousemployeryears]','$_SESSION[previousemployermonths]','$_SESSION[employerphone]','$_SESSION[repo]','$_SESSION[reponumber]','$_SESSION[repobank]','$_SESSION[repoyears]','$_SESSION[repomonths]','$_SESSION[repobanktwo]','$_SESSION[repoyearstwo]','$_SESSION[repomonthstwo]','$_SESSION[cosign]','$_SESSION[tradeyes]','$_SESSION[genre]','$_SESSION[player]','$_SESSION[tradepayoff]','$_SESSION[bk]','$_SESSION[discharged]','$_SESSION[bkyears]','$_SESSION[bkmonths]','$_SESSION[dpamount]','$_POST[genre3]','$_POST[player3]')";

if (!mysql_query($sql,$con))
  {
  die('Error: ' . mysql_error());
  }

mysql_close($con)
?>

 

 

 

like I said had it all working and am not sure what happened.

 

 

Link to comment
https://forums.phpfreaks.com/topic/156286-multiple-form-troubles/
Share on other sites

Archived

This topic is now archived and is closed to further replies.

×
×
  • 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.