Topic: redirect after succesful registration.php??? (Read 1728 times)
What a dork
Posts: 17
110 credits Members referred : 0
« on: Aug 24, 2006, 07:33:05 PM »
Hello Olaf,
As I am a newby this must be a laughable to you. I am applying your class and everything works great!
But after the registration.php page I want to redirect to a new page. Ofcourse I know that the form in registration.php posts to itself validate the form and process the registration. So I can't put a url in action="http://" (is now action=$_POST['PHP_SELF']). So I put in a If statement to redirect to an other page if the registration was successfull by using header("Location: ").
Now I think I found that header( ) doesn't work together with $_POST? Is this true and is there an other way to redirect after succesful registration? - scooter
« Last Edit: Aug 24, 2006, 09:56:54 PM by scooter »
Moderator Community Supporter?
Jedai Sword Master
Gender:
Posts: 6274
38470 credits Members referred : 374
It's time to use PHP5!
Re: redirect after succesful registration.php
« Reply #1 on: Aug 24, 2006, 10:07:31 PM »
Hello,
The problem is only that you can't output data from a page and redirect together but you can create a "registration success" page within the register.php
What a dork
Posts: 17
110 credits Members referred : 0
« Reply #5 on: Aug 29, 2006, 02:39:49 AM »
Thanks Olaf. It took a few days, but I got it all nipped now. No output before header(). This was a good lesson on an interesting subject!!!
What a dork
Posts: 17
110 credits Members referred : 0
« Reply #6 on: Dec 09, 2006, 06:26:39 AM »
Step 1: I have an input form on page 1 (asks for only an e-mail address). I use this e-mail address to lookup the username, password and redirect to page 2. <form name="form1" method="post" action=<?PHP echo "/page_1/"; ?>> <label for="login">E-mail:</label> <input type="text" name="login" size="30" value="<?php echo (isset($_POST['login'])) ? $_POST['login'] : $my_access->user; ?>"> <input type="submit" name="Submit" value="Login"> </form> Step 2: On page 2 the user needs only to click on a second Submit-button (see below) with two hidden form-fields. These hidden fields already contain the username, password (from Step 1) so the user can automatically login to the external web-application (for example http://url.web-application.net). <form name="form1" method="post" action="http://url.web-application.net" <input type="hidden" name="login" size="30" value="<?php echo (isset($_POST['login'])) ? $_POST['login'] : $my_access->user; ?>"> <input type="hidden" name="password" size="8" value="<?php echo (isset($_POST['password'])) ? $_POST['password'] : $my_access->user_pw; ?>"> <input type="submit" value="Begin web-application" > </form>
Above procedure is a way to automatically login to an external web-application, with only your e-mail address and it works fine.
My question is how can I let the user: enter an e-mail address(1), lookup the username password in a database(2) and send them to the external web-application where to user is logged-in automatiacally(3) all on one page. I tried it with methodes like: $_POST['login'] = $login; $_POST['password'] = $password; heaser("location: ")
But I had no luck yet. Hope you have an idea?
« Last Edit: Dec 09, 2006, 06:29:05 AM by scooter »
Moderator Community Supporter?
Jedai Sword Master
Gender:
Posts: 6274
38470 credits Members referred : 374
It's time to use PHP5!
« Reply #7 on: Dec 09, 2006, 10:01:05 AM »
Quote
My question is how can I let the user: enter an e-mail address(1), lookup the username password in a database(2) and send them to the external web-application where to user is logged-in automatiacally(3) all on one page. I tried it with methodes like: $_POST['login'] = $login; $_POST['password'] = $password; heaser("location: ")
But I had no luck yet. Hope you have an idea?
I think that can be done cURL, but I'm sure that this more difficult than what you have done until now. btw. posting the login and password to a form is very unsafe...