ILLstyle

msg:1278313 | 9:32 pm on Nov 11, 2004 (gmt 0) |
Using header() works like this header('Set-Cookie: $_COOKIE["the_cookie"]'); header("Location: [the_path_to_page.cgi");...] but I really want to do this with include(). Is there a way?
|
ergophobe

msg:1278314 | 4:55 pm on Nov 12, 2004 (gmt 0) |
You can't set a cookie and then use it in the same script - you need a seperate http request for both of those action. You need to send the data from the previous page and save it as a cookie or send it as post data or some such thing. Only then is it available to the page currently being generated. Tom
|
ILLstyle

msg:1278315 | 5:09 pm on Nov 12, 2004 (gmt 0) |
I can grab the cookie and echo it with the global $_COOKIE["the_cookie"]. So I have no problems seting it but, sending it is where Im having trouble. I know why it won't work: It is because the CGI is seeing PHP modual as the client and not the user. thanks for the input!
|
ergophobe

msg:1278316 | 6:12 pm on Nov 12, 2004 (gmt 0) |
I can grab the cookie and echo it with the global $_COOKIE["the_cookie"]. |
| Okay, I misunderstood a bit what you were doing. I thought you were setting the cookie in the same script that was calling the CGI. seeing PHP modual as the client and not the user. |
| ? You mean it's seeing PHP as the server and not the client?
|
freeflight2

msg:1278317 | 6:29 pm on Nov 12, 2004 (gmt 0) |
you might pass cookies / data by setting enviroment variables before an other script
|
ILLstyle

msg:1278318 | 6:39 pm on Nov 12, 2004 (gmt 0) |
Yes, What I should have said is the include() calls a CGI script that needs a cookie. The problem is when that CGI is requested it sees the PHP sever as the client and not the acctual client. I have tried seting variables before include but this still will not work. I also tried something like this include($_COOKIE['name'] . "/path/prog.cgi"); but this does not work. thanks for your help
|
ILLstyle

msg:1278319 | 6:44 pm on Nov 12, 2004 (gmt 0) |
the cookie has already been set long before I use this PHP script. In this script I have no problem echoing it or setting it to a variable. I just can't seem to get it passed when using the include. Im not even sure if you can do this but I hope you can.
|
freeflight2

msg:1278320 | 6:48 pm on Nov 12, 2004 (gmt 0) |
this: | include($_COOKIE['name'] . "/path/prog.cgi"); |
| wouldn't make sense... let's say your cookie name is sessionID then you would try to include sessionID/path/prog.cgi (in addition there might be potential security issues)
|
|