Forum Moderators: open
When I found a few scripts that allowed me to confirm email addresses and check passwords they showed that I needed my form to process a different onsubmit rather than the one to post my data.
How do I do all three?
[edited by: tedster at 8:33 pm (utc) on May 7, 2003]
[edit reason] too much code [/edit]
as Yahama_R1 says, you can do this all in one script. You would have to decide the order thay should happen in first and where you need them to happen.
The email check could be on the same page as the form (javascript?) and you could call that function and if it succeeds then post to your other script.
How you do them also depends on what language they are in.
What is the password checker for? Is it to find out whether they can view the form or if they can submit it?
The db insert, I would think, should be last.
I know not much about javascript, so when it is suggested that I "Try creating a sub script for the input, then have that script call the other three with the appropriate data" I have no clue as to how to do this. I tried reading a few articles but had no luck. The best way I learn is from seeing the code someplace and just playing with it for my own personal use.
Perl and PHP CGI Scripting [webmasterworld.com]
I may be wrong but i think it will be much simpler, except for having to learn it. The things you want to do are fairly straight forward and not overly difficult to learn.
simple not too code intensive example using PHP
if you had a simple form with your fields
basic name, email, user id, password and confirm password
you could then post them to a "processing script"
the processing script could easily check if the passwords match
if ($password!= $confirm_password) {
echo "passwords dont match";
}
this is a simple if statement that says
if the value entered into the password field is not equal to the value entered into the confirm password field then echo (output to screen) "passwords dont match".
I dont know how much knowledge you have of programming or if you even want to learn any but these things can be accomplished with a little work.
If you are interested see www.php.net or just comeone over to the scripting forum. We're always up for new blood. :)
I also saw the code you posted originally but understood more from your short response than from that large code post, no offence intended by any means.