Unstoppable Domains โ€” Get your daily AI drops report

Form values not updating mysql db

NamecheapNamecheap
Watch

dzigner

Established Member
Impact
0
Hello

I have 2 forms, form1 which passes values to form2 and inserts a record in mysql db. The code for form1 works. form2 is supposed to update that record in the db, on submit. This code I have put in a 3rd thanku page, with also echo for form values. The echo is working correctly, i.e. all values from form2 are passed to thanku page. But the record in db is not updating.
>:( :'(

Added line breaks for readability.

Here is the code for form2 on thanku page:

PHP:
<?PHP 

echo($_POST['fname'].'<br>'.$_POST['phone'].'<br>'.

$_POST['email'].'<br>'.$_POST['lname'].'<br>'.

$_POST['address'].'<br>'.$_POST['city'].'<br>'.

$_POST['state'].'<br>'.$_POST['zipcode']); 

If (isset($_POST['submit'])) {

require('config.php'); 

     require('functions.php');

     connect_database();

$NowTime = NOW(); 

    $logincount = $logincount+1; 

$UpdateRecords ="UPDATE signup SET 

lname='". $_POST['lname'] ."' ,address='". $_POST['address'] ."',

city='". $_POST['city'] ."',state='". $_POST['state'] ."',

zipcode='". $_POST['zipcode']."', 

confirmkey='$phone',lastlogin='$NowTime',

logincount='$logincount' where email='$email'";

$UpdateResult = mysql_query($UpdateRecords) or die(mysql_error());

 

}

 

?>

This is the thanku page after the form2 submits:

Code:
tasneem

1234561234

[email][email protected][/email]

ranggg

1500 Market St

Burlingame

CA

19102 

 

Thank you tasneem for joining Us. 

Please remember the charge on your credit card will appear from XXX, Inc.,the parent company.

 

We will be contacting you shortly with your password and log in information.

 

If you have any questions about your membership contact us at our email. 

 

Go to Home



But when I check the db, the record is not updated with these values.

Please help me.

Thanks:|
 
0
•••
The views expressed on this page by users and staff are their own, not those of NamePros.
GoDaddyGoDaddy
Maybe try taking all of the database code out of that if block because it doesn't look like $_POST['submit'] is going to be set on that page so it's ignoring all that code completely?
 
0
•••
form values

Hi
I sorted everything out about the db updates. It worked, but then my validation script stopped working.
Now, the form does not submit, and does not update the db.
:-/
 
0
•••
CatchedCatched
Escrow.com
Spaceship
Rexus Domain
CryptoExchange.com
Domain Recover
CatchDoms
DomDB
NameFit
  • The sidebar remains visible by scrolling at a speed relative to the pageโ€™s height.
Back