Forum Moderators: coopster

Message Too Old, No Replies

Using PHP to post to a page

how?

         

DashTwo

11:49 am on Mar 5, 2006 (gmt 0)

10+ Year Member



Alright, I have my html page with input forms that posts to mail.php

In mail.php I have it send the variables from index.html to my email address

But I also want to use the same variables to post to another page, say to log the user in.

Could I get some advice?

Thanks,
Drew

Habtom

1:53 pm on Mar 5, 2006 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



You could carry the values in Session values and use them in the next PHP page to do what you want with them.

Habtom

Birdman

3:40 pm on Mar 5, 2006 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



Curl [us2.php.net] will do it.

Welcome to WW!

DashTwo

4:57 am on Mar 7, 2006 (gmt 0)

10+ Year Member



I'll look into that, is there any easier ways though?

omoutop

8:24 am on Mar 7, 2006 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member Top Contributors Of The Month



all the ways i can think :
database, text file, cookie, session, autosubmited form( in email.php), merge email.php and login.php into 1 fiule. Pick one!

DashTwo

4:51 am on Mar 8, 2006 (gmt 0)

10+ Year Member



haha, I'm glad there's so many options, any idea on some advice for any of them?

percentages

5:14 am on Mar 8, 2006 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member Top Contributors Of The Month



If I follow you:

index.html has a form actioned by mail.php.

mail.php processes the data and sends you an email.

Now you want to use the same data elements in another script to login someone?

If so at the end of mail.php add:

$domain="Location:http://www.mydomain/login.php?var1=".$var1."&var2=".$var2;
header($domain);

The var1, var2 from index.html will get passed to mail.php and then mail.php will redirect to login.php with the same values where you can process them again.

Simple & dirty solution that will work :)