Page 1 of 1

A fork in the validation road

Posted: Wed Dec 11, 2002 11:28 pm
by virgil
Hey PHP's :)

Does any one have any ideas on how to send a user to another page after the user input is validated and checks out?

I start with a logon form page (email and password fields) called logon.php.

I validate a form by sending the user input back to the top of the logon page and check the input with a reg. expression, is it in the data base etc.

If it fails, the logon form (which is just code lower on the same page) just displays again with an invalid email message or such.

If it passes, I want to send the user to a new page in the same window.

I tried changing the form attribute action="logon.php"

but if I use an IF statement to change the action "address" you have to resubmit the info again to go to the new page. (it takes a second pass to hit the now changed action "address")


I could open and close windows with java but I'm really trying to stick to PHP for a very reliable and error free site.

Anyway to do it with just php?

A click simulator would do the trick.
This site seems to use one when submitting posts.
Does PHP have one?

If not...
I think java has a click simulator event handler that could be used with an IF statement, but I have minimal java exp. Can it force a href url? How does it work? (a quick code snippet would be very helpful, if anyone has one handy).


Any Ideas?


Thanks very much all for the time and advice.

Virgil :)

Posted: Wed Dec 11, 2002 11:39 pm
by mydimension

Posted: Thu Dec 12, 2002 9:42 am
by penguinboy
if( email & password == valid){
header("Location: nextpage.php");exit;
}

Posted: Thu Dec 12, 2002 3:37 pm
by Genteel Beaux
If has been my experience that

header("Location: whatever.php");
exit;

doesn't always work. Sometimes it works and other times I get sent to a blank screen.

Is there something else that works 100% of the time?

Posted: Thu Dec 12, 2002 5:30 pm
by mydimension
yeah, give it full url, not a realative one. i believe the HTTP/1.1 spec requires it.

Posted: Thu Dec 12, 2002 7:11 pm
by virgil
Thats it :D


Thanks PHPs...

I can't believe none of the php books I read ever mentioned it.

Are these the same "headers" that work with E-mail?

Ive been having some problems mailing to different E-mail services.

I tried to find a book on the ins and outs of E-mail headers but couldn't find one in the book store.

Does anyone know of a good one?

Online manuals are hard to read cover to cover.

I didnt even know a header function existed!

I'm workin like a Neanderthal over here!


Thanks....

Once again the PHPs (peeps)come thru!