|
-
January 3rd, 2003, 11:06 AM
#1
Cookies
I want to write the cookie-status of a browser into the variable $cookies using PHP and Javascript.
My solution is the following command, but it doesn't work :-((
echo "Cookie status:<script type='text/javascript'>if(navigator.cookieEnabled == 'true') {$cookies='allowed';}</script>".$cookies;
Does someone have an idea how to solve that problem? (the status must be in $cookies because I want to use it somewhere else in the code!)

[Goodz13:Moved from Java Fourm]
Last edited by Goodz13; January 3rd, 2003 at 01:58 PM.
-
January 8th, 2003, 06:24 AM
#2
Your problem is that you are trying to combine server-side and client side code. You must remember that ALL php code will be parcesd on the server and than results willbe sent to clients browser. Browser will run javascript (if this option enabled). Browser has no idea that you are a php programmer.
Try evaluate all php code and see what you have.
You don't send information from clients computer to the server!
So php program don't know about javascript results.
--------------------
Sincerely,
Serg Dzysyak
AlarIT programmer
http://www.AlarIT.com
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|