[thelist] GET/POST PHP Question

Tiele Declercq tiele at staff.start.be
Tue Jan 29 06:28:00 CST 2002


This is a multi-part message in MIME format.
--
[ Picked text/plain from multipart/alternative ]
A quiet common problem i think is the passing of data from script to script when you do not want the user to see this data.  This is why there is POST. But what if the data was generated by one script but has to be displayed by another (think of a default error message with the looks of your site).

a few possiblities to transfer the data from one script to the other:
- Put everything in the url...  and use GET to retrieve & display them. Fine if you don't care for hackers...
- Let the script generate a FORM and automaticly POST it. Would work but is just playing stupid...
- Store the vars in a session, retrieve then with session_register. Probably the best sollution, but the server would have to create an extra session for every user and keep it active for a while.

So i'm thinking that there must be other ways...  one of them that i'd think should exist but haven't found yet is that right before you forward from your script to the other that you would write the data into the header like this:
header("Include-variable: id=$id; name=$name; message=$msg");
header("Location: error_script.php");

Does anyone know if this is possible and/or how it's done ?

Groetjes,
Tiele Declercq [ tiele at staff.start.be ]

---

Projectleider Start.be
http://start.be
--





More information about the thelist mailing list