Thanks. The cookie sets fine using the redirect. The problem is accessing
the cookie when the script is called via the image tag. If the script is
called directly, the cookie is accessible.

http://trackerurl/blahblah/script.php    --- called directly can see the
Cookie

<img src=http://trackerurl/blahblah/script.php height=1 width=1>    --- does
not see the Cookie

Not sure what else to do other than try something different. Using Cookie
seems to be the only way to store the value on the client side for later
retrieval.

Thanks,

Nicole

"Diego Fulgueira" <[EMAIL PROTECTED]> wrote in message
news:[EMAIL PROTECTED]
> Nothing is too advanced for this newgroup and there is not other better. I
> did not read your problem very carefully, but I think you are trying to
set
> a cookie on a page that does a redirect, that is just impossible unless
you
> do the redirect with a meta tag on the client.
>
> Anyway, if that suggestion doesn't do it for you, I once used the
following
> function to set cookies and it worked for me:
>
> function MySetCookie
> ($CkyName, $CkyVal, $exp, $pth, $Domain)
> {
>  $exp = strftime("%A, %d-%b-%Y %H:%M:%S", $exp);
>  $cookiestr = sprintf ("%s=%s; domain=%s; path=%s; expires=%s",
>  $CkyName, $CkyVal, $Domain, $pth, $exp);
>  $mycky = (isset($mycky) ? "$mycky\n" : "")."Set-Cookie: $cookiestr";
>  header($mycky);
> }
>
>
> Cheers,
> Diego
>
> ----- Original Message -----
> From: "Nicole" <[EMAIL PROTECTED]>
> To: <[EMAIL PROTECTED]>
> Sent: Wednesday, September 03, 2003 3:57 PM
> Subject: [PHP] Too Advanced? Re: Cookies & Hidden Image
>
>
> > Is this question too advanced for this newsgroup? Is there a better
> > newsgroup to post this one too?
> >
> > Thanks,
> >
> > --
> > Nicole
> >
> >
> > "Nicole" <[EMAIL PROTECTED]> wrote in message
> > news:[EMAIL PROTECTED]
> > > Hi,
> > >
> > > I am working on a script that uses cookie to store some info on the
> client
> > > side.  The user will click a link that contains info about where the
> link
> > > was placed. The script will then store that info so that when the user
> > > returns later and makes a purchase, I can see where they came from.
> > >
> > > The problem I am having is this:
> > >
> > > The link is a redirect url that first goes to one domain where the
> cookie
> > is
> > > created by. Then they are taken to the site where products are sold.
> > >
> > > Then, after they make a purchase, they are taken to a thank you page
> that
> > > has a hidden tracker to track that sale.
> > >
> > > <img src=http://trackerurl.com/?var=1&var=2&blahbla height=0 width=>
> > >
> > > The image loads the script from a different domain (where the cookie
was
> > > initialy created by).  The problem now is that the script gets a blank
> > > cookie when using the hidden image to load the script.
> > >
> > > So does anyone know why this is happening?
> > >
> > > I have   setCookie('CookieName', $value, $expires);
> > >
> > > Then I try to retrieve that cookie again later with
> > $_COOKIE['CookieName']
> > > ... but the value stored is not there when the script is called from
the
> > > hidden image.  HOWEVER, the value is there when the script is called
> > > directly.
> > >
> > > Any ideas?
> > >
> > > Thanks!!
> > >
> > > Nicole
> >
> > --
> > PHP General Mailing List (http://www.php.net/)
> > To unsubscribe, visit: http://www.php.net/unsub.php
> >
>

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php

Reply via email to