NYCPHP Meetup

[nycphp-talk] PHP and MSIE 6.0

Chris Shiflett shiflett at php.net
Mon Feb 3 21:52:49 EST 2003


--- betenoir at echonyc.com wrote:
> Are you referring to having a privacy policy?

That's part of compliance, yes.

> We've done that. But it's not the third party that's
> setting the cookie.

Then it doesn't matter anyway. :-)

> However, the variables do not appear (print)
> consistently even though there is a javascript
> error-checking routine on the previous page.

I would trust your code over client-side scripting. Are the
inconsistencies you have observed a result of your own
testing or from users? If it is not a controlled
environment (you testing and documenting all conditions),
perhaps the inconsistency stems from whether your users
have client-side scripting enabled.

> And submitting the same page 5 minutes later on the
> same machine under identical circumstances has
> produced different results.

That does seem rather odd. Do you have any logs of the raw
HTTP transactions to verify the behavior you have observed?
This would be the best way to isolate whether this is a
browser issue or something in the server's handling of the
data (including your script's logic).

> The BIG problem is reading the cookie(s) that I am
> setting on the review_form.php page.
> 
> $postString = $_POST;
> $cC = 0;
> $N100D = "";
> $expiry = time() + 60 * 60 * 24 * 365;
> foreach ($postString as $key => $value) {
>    if ($value != "") {
>       $cienCenas = array ($key => $value);
>       setcookie($key,$value,$expiry);
>       $N100D = $N100D . $key . ",";
>       $N100D = $N100D . $value . ",";
>    }
> }
> setcookie('$ciento',$N100D,$expiry);

I might be stating the obvious, but shouldn't you be
looking for $_COOKIE["$ciento"]? Also, since your variable
name is determined dynamically, you might be using the
wrong key. Try something like this to see all cookies sent
by the client for the current resource:

<pre>
<? print_r($_COOKIE); ?>
</pre>

Hopefully some of this helps.

Chris



More information about the talk mailing list