Re: Newbie question

From: Date: Fri, 02 May 2003 05:47:41 +0000
Subject: Re: Newbie question
References: 1  Groups: php.general 
Request: Send a blank email to php-general+get-146067@lists.php.net to get a copy of this message
on 02/05/03 4:36 PM, Michael Lewis (michael@nichestaffing.com) wrote: > Do you think this could be used, to possibly set a cookie > inside <noframes>?? It looks like it has possibilities, > but like I said, I'm a newbie No. Remember that PHP all happens SERVER SIDE. All cookies will be set before the browser receives any HTML.... 1. .php combo file of PHP & HTML exists on the server 2. browser requests .php page off the server 3. PHP engine PARSES the PHP/HTML page, resulting in plain HTML code ONLY 4. Plain HTML code sent to the browser 5. Page is rendered The point is, the <noframes> tag is evaluated by the browser, CLIENT SIDE, long after PHP has had anything to do with it. So you only option would be to set the cookie VIA JAVASCRIPT client side in the <noframes> tags... even then, I'm not 100% certain this will work in all, or even most cases... you'll have to check out some javascript sites/lists to get some code, and give it a try. And of course it won't work at all if the browser does not support, or have turned on, JavaScript. So, right about this point, most developers start to ask themselves if they really need all this grief just for the sake of frames (or javascript, or DHTML, or whatever) :) Justin

« previous php.general (#146067) next »