you will have to do this with javascript on the client side with an
onClick()  call in the submit button.  but the bad thing is, you wont be
able to check this with the mysql db, unless you load the entire field set
into the current page.

my suggestion would be to send the form to one single page no-matter what.
do the validating and then if the email address isn't there, redirect with
the php header() function to the custom page that you are talking about.

Jim lucas
----- Original Message -----
To: "php list" <[EMAIL PROTECTED]>
Sent: Friday, May 31, 2002 1:46 PM
Subject: [PHP] Running a script to check something before submitting a form.
Can this be done?


I think I need to use PHP here which is why I'm posting to this ng.  I have
a form that upon the user pressing submit, calls a PHP form handler.  What
I'd like to do is upon the user pressing submit, I need to validate an email
field within a MySQL database and only if it does NOT exist, call the form
handler.  If it exists, I'll juets return a custom page and NOT call the
form handler.  I'm wondering if I need some JavaScript here?

If PHP is not involved, I apologize for the post.


PHP General Mailing List (
To unsubscribe, visit:

Reply via email to