hi guys i have this script to allow user registration with activation link. all data goes in a database.
the script works fine but when i add an user in my DB i see two records, the first one with the right data and the second one with a blank record. if i don't delete this record i can't add more users, in my web page compare Error: Duplicate entry ” for key 2
$db = mysql_connect($host, $username, $password) or die(\"Errore durante la connessione al database\"); mysql_select_db($database, $db) or die(\"Errore durante la selezione del database\");
if ($_POST['form_submitted'] == '1') {
## Form was submitted,the user is registering!
} else{
## No value found, user must be activating their account!
echo \"An email has been sent to $_POST[email] with an activation key. Please check your mail to complete registration.\";
##Send activation Email
$to = $_POST[email];
$subject = \" YOURWEBSITE.com Registration\";
$message = \"Welcome to our website!\r\r You, or someone using your email address, has completed registration at YOURWEBSITE.com. You can complete registration by clicking the following link:\rhttp://yourwebsite.com/registrant/verify.php?$activationKey\r\r If this is an error, ignore this email and you will be removed from our mailing list.\r\rRegards,\ YOURWEBSITE.com Team\";
$db = mysql_connect($host, $username, $password) or die("Errore durante la connessione al database"); mysql_select_db($database, $db) or die("Errore durante la selezione del database");
you are probably calling your ID column in upper case and the col name is actually in lower case. It is something like that. Else the ID col dosen't exist at all
you are probably calling your ID column in upper case and the col name is actually in lower case. It is something like that. Else the ID col dosen't exist at all
you got it dude!
now my form with activation email works pretty well.
now i've added with the help of dreamweaver cs4 the spry validation field and it works fine too.
my last question is, could a form with required field and activation email avoid spam?
i would like embed a captcha sistem. it works but the required fields are like not required, so if complete only the captcha the form sent data with blank field. I tried two different (reCAPTCHA google and another) but both have the same result.
The form works perfectly! I implemented this into a popup. However, once the person hits submit, they get the generic text "An email has been sent to THEIR EMAIL with an activation key. Please check your mail to complete registration." I created a nice looking success page to replace this, but I don't know how to code it in the PHP. Help!
i have this script to allow user registration with activation link. all data goes in a database.
the script works fine but when i add an user in my DB i see two records, the first one with the right data and the second one with a blank record.
if i don't delete this record i can't add more users, in my web page compare Error: Duplicate entry ” for key 2
this is the code that going me crazy
thanks for your help guys
Code for Textbox
<input type="text" value="" name="sample" size="15"/>
Code for Posting the value
$sample = $_POST['sample'];
Code for Inserting the values in the database
$sql = "INSERT INTO profile(image)" .
"VALUES('".$image."') ";
mysql_db_query($db, $sql);
Please assign all the values like this, now the values will insert the database only one time...
now i can't understand why i can't insert data into database, mysql_query function give me always error.
so this is my form
and my verify.php code
and at least my query for table
i wrote mysql_query($query) or die (mysql_error())
and i get this error, Unknown column 'ID' in 'field list'
where am i wrong?
you got it dude!
now my form with activation email works pretty well.
now i've added with the help of dreamweaver cs4 the spry validation field and it works fine too.
my last question is, could a form with required field and activation email avoid spam?
i must to embed a captcha field?
thanks
I tried two different (reCAPTCHA google and another) but both have the same result.
solution at this point that I could invent?