I’m going to give a basic example of what I need to be able to do, in the hopes that somebody can point me in the right direction, although I’m sure what I’m asking somebody is going to facepalm themselves when they read it. Anyway, here goes.
I have a form on a page on Site Y (let’s call it form.php), that form looks like this (asks for just a username & password):
<form action="http://SiteX.com/validate.php" method="post">
Email Address: <input type="text" name="email">
Password: <input type="password" name="password">
<input type="submit">
</form>
As you can see, the form is hosted on Site Y, and is submitting the information to a page on Site X.
validate.php on Site X checks the submitted login details from Site Y and returns whether or not the login details are valid, sort of like this (obviously something more complex than this):
$SubmittedEmail = $_POST['email'];
$SubmittedPassword = $_POST['password'];
$CrossReferenceEmail = 'someemail@dontcare.com';
$CrossReferencePassword = 'apassword';
if ( ($SubmittedEmail == $CrossReferenceEmail) && ($SubmittedPassword == $CrossReferencePassword) ) {
echo 'Valid';
} else {
echo 'Not Valid'; }
What I need to do, that I don’t know how to do, is how do I make “form.php” wait for a reply (whether the login details are valid or not) and then do something based on that reply?
1 Answer