PDA

View Full Version : Can i do this another way?


thiago1983
08-15-2006, 08:58 PM
I have a form which i validate the user input. It does all the validating in the same php. Once all the user input is validated and verified i use the header() function to redirect to the next page.

Now my problem is this: I have some user input that needs to go to the next page and i was just wondering how can you do this without using the GET method.

For example: header("Location: http://www.example.com&text=asac");

How can i pass the text variable without using the GET method? Anybody can help. I would appreciate it. Thanks a lot

Glass Casket
08-15-2006, 09:28 PM
You could possibly use a session variable.

Anyone else have a better idea?

Fumigator
08-15-2006, 09:32 PM
If you're using sessions, simply save the data to $_SESSION and it'll be available to you in the next page.

If you're not using sessions, you may want to. :)

You can also store the data in a cookie, but that's dependant on the client cookie settings so it can't be guaranteed to work.

You can use curl, or so I hear (I've never tried it). Documentation (http://us2.php.net/manual/en/ref.curl.php)

You can load the data into hidden form input elements; it will then be available in the $_POST array on the following page, but you won't be able to redirect using header(); you'll have to use Javascript to force a form submit (probably not the best solution).

thiago1983
08-15-2006, 09:59 PM
Thanks a lot :). I think i will use the sessions option :). Probably the best solution in my case.