OK, bad wording maybe, you have to create a form with 3 inputs and their default values (value=“” as in the example below) are blank, but their names are “email” and so on.
I don’t know whether the script is working because the verify.php is giving me an error on line 32. I can’t debug any client side problems because the client side scripts on my page are being completely ignored.
$sql="INSERT INTO users (username, password, email, activationkey, status)
VALUES ('$username', '$password', '$email', '$activationKey', 'verify')";
('$_POST[username]', '$_POST[password]', '$_POST[email]','$activationKey', 'verify')";
//Form submitted, user must be registering
//Do something here
}
else
{
// No value found, user must be activating their account!
}
}
else
I didn’t enter in the values there, but one thing the activationkey and verify what values go into that area ? The SQL database doesn’t have any “activation key” number to put in ? Unless I’m missing something.
unless I missed it, which is a possibility, you are trying to enter verify into your database but there is no $var name verify that I can see in the code you have posted. Again, if I missed it, sorry. Plus in your insert you have $ in front of all your var but with verify you don’t.
unless I missed it, which is a possibility, you are trying to enter verify into your database but there is no $var name verify that I can see in the code you have posted. Again, if I missed it, sorry. Plus in your insert you have $ in front of all your var but with verify you don’t.
I want to have the form communicate with the verify.php script. What is happening is I’m getting an error on line 32 when I submit the form. Prior to the verify.php script the form would submit the client side script would tell the user the form was sent, and that was it. Since I have introduced verify.php none of that happens because I assume there is not communication with the Javascript, I can fill in the following; with a user name password but what about activationKey and verify what must I place in those fields ?
Ok in your script you have
$activationKey = mt_rand() . mt_rand() . mt_rand() . mt_rand() . mt_rand(); So that is where that value is coming from. I have no idea where or what verify is. You now mention JavaScript? Are you checking for verification with this? For what you are doing you could use php for validation; What is line 32 - I am guessing the insert line
Ok in your script you have
$activationKey = mt_rand() . mt_rand() . mt_rand() . mt_rand() . mt_rand(); So that is where that value is coming from. I have no idea where or what verify is. You now mention JavaScript? Are you checking for verification with this? For what you are doing you could use php for validation; What is line 32 - I am guessing the insert line
No I’m not checking the verification with Javascript, Javascript calls the PHP to send out the email notification, doesn’t it ?
It’s most likely then not throwing back a error on line 32 because I haven’t entered in a UserName / Password / eMail address for it to send out the notification but it may continue to throw an error until there is a value for activationkey and Verify. I want to get Verify.php working so when the form submits, the user will be notified that there was a form submitted and they will receive an email notification but that task is done with JS without this working that can’t work in cooperation
Upon reading about security features for PHP forms I came across one of a few but I’ll ask one at a time.
function show_error($myError)
{
?>
<html>
<body>
<b>Please correct the following error:</b><br />
<?php echo $myError; ?>
</body>
</html>
<?php
exit();
}
?>
If the HTML form is using typical classes would it be necessary to add this if the client side of the page won’t let the user submit unless the form is complete ?
If I understand your question, this only will let you notify the user that they have entered something in wrong or missed something. This is good so the user will know what they need to fix to be able to complete what they need. If I am following you this is a separate issue from the error in line 32. Need to fix that first.
Post #36 is a separate issue, but how do I fix my previous issue so that I don’t get the Error no longer, I’ve looked over the script to find any fault besides some username and password fields missing and I can’t figure out even with my lack of PHP knowledge.