Hi,
i have a form that sends an email. If the person is not logged in, then clicking on the SUBMIT button to send the email will first redirect to a login.php page which will display a form. Then when the login is succesfull I want to send the email without returning to the email form again.
For example:
email.htm:
<form name="emailform" action="email.php" method="post">
<textarea name="emailtext" cols="20" rows="4"></textarea>
<input type="submit" name="Submit" value="submit">
</form>
email.php
if (!user_logged_in()) {
header("Location:/login.php");
} else {
send email
}
login.php
Display a login form (username and password), and a submit button. When the user clicks on SUBMIT, then I want to return to email.php and send the email.
My problem is to find out how to transport the initial form variables to login.php, then back to email.php.
I could pass the variables as parameters to the login.php url (Location:/login.php?return=$PHP_SELF&emailtext=Hi%20there%20%this%20is%20the%20email), then construct a form inside login.php with a javascript script that would click "submit" for me, but that's UGLY and I want to avoid seeing the variables on the URL line too.
How would you do it?
F.