arrays - More cookie problems, php -



arrays - More cookie problems, php -

i'm sorry maintain asking stupid questions, have tried research , couldn't find it.

this time, want able check _post against array, before deciding it's ok set cookie. here's snippet.

<?php header( 'location: http://www.site.com/ler.php' ) ; ?> <?php setcookie("choice1","true",time()+20); ?> <?php $match_id = strtoupper($_post["arr"]); //var_dump(implode($_post)); $barray = array( "a"=>"1", "b"=>"2", "c"=>"3", "d"=>"4", "etc"=>"5");

i need array , variable set before cookie, because want utilize array_key_exists conditional. tried switching order didn't anything. know it's not header because other code cookies , headers works fine. ideas??

not sure you're asking here, clear code you've presented not going work expect.

you're outputting body content before phone call setcookie(). unless you've got output buffering enabled it's going fail. setting expiry time of 20 seconds dumb thought - client side clock unlikely synchronised.

also there several browsers ignore subsequent headers after redirect. further, depending on timing of processing, browsers drop connection after redirect - in absence of ignore_user_abort() may cause premature termination of code.

further, presumably there's reason parsing info / setting cookie - how can sure has completed before redirect request browser procesed?

i want able check _post against array, before deciding it's ok set cookie

its apparent code you've provided not check before setting cookie - why have included in question?

php arrays cookies

Comments

Popular posts from this blog

How do I check if an insert was successful with MySQLdb in Python? -

delphi - blogger via idHTTP : error 400 bad request -

postgresql - ERROR: operator is not unique: unknown + unknown -