lvspeedy Posted February 20, 2004 Report Share Posted February 20, 2004 nu es taisu kounteri ar cepumiem, tacu zinu ka visiem tie cepumi nav iesleegti, kaa paarbaudiit vai lietotaajs ir iesleedzis cepumus? Link to comment Share on other sites More sharing options...
Venom Posted February 20, 2004 Report Share Posted February 20, 2004 hm, pilnīgi iditotiski, bet, varbūt: $_COOKIE['set']=1; /* mēģinām ieglabāt iekš cūkija kādu infu un uzreiz pārbaudām, vai tā ir ieglabājusies; neaizmirstam, ka cūkijs kļūst pieejams tikai pēc lapas pārlādes un to uztaisām atsevišķi. pēc tam čekojam: */ if (!isset($_COOKIE['set'])) echo 'Ņo cūkīz'; un of koz pārbaudam, vai setcookie() atrgriež true (kas nemaz nenozīmē, ka cūkijs tomēr "aizies") Link to comment Share on other sites More sharing options...
lvspeedy Posted February 20, 2004 Author Report Share Posted February 20, 2004 Biski pats veel pamekleejos un reku ir javascript codins tiesa nebija laika man veel vinu paarveidot <script type="text/javascript"> var cookieEnabled=(navigator.cookieEnabled)? true : false //if not IE4+ nor NS6+ if (typeof navigator.cookieEnabled=="undefined" && !cookieEnabled){ document.cookie="testcookie" cookieEnabled=(document.cookie=="testcookie")? true : false document.cookie="" //erase dummy value } //if (cookieEnabled) //if cookies are enabled on client's browser //do whatever </script> Link to comment Share on other sites More sharing options...
Venom Posted February 20, 2004 Report Share Posted February 20, 2004 tā kā foruma tēma ir PHP un PHP, incanti, ko tu ar JS darīsi? Link to comment Share on other sites More sharing options...
lvspeedy Posted February 20, 2004 Author Report Share Posted February 20, 2004 pagaidaam tas man ir labakais variants, nu varbuut teemai vins neatbilst, laikam nebuushu pareizo teemu izveeleejies Link to comment Share on other sites More sharing options...
Venom Posted February 21, 2004 Report Share Posted February 21, 2004 padoms; uztaisi hidden inputu un liec tam iekšā cookie.enabled - no php tad varēs attiecīgi darboties (ja vien tu cūkijus cūko no php). Link to comment Share on other sites More sharing options...
Recommended Posts