Re: PHP + Cookies + resolution + redirection
| From: | Justin French | Date: | Fri, 23 May 2003 02:56:17 +0000 |
| Subject: | Re: PHP + Cookies + resolution + redirection | ||
| References: | 1 | Groups: | php.general |
| Request: | Send a blank email to php-general+get-148692@lists.php.net to get a copy of this message | ||
For starters,
I did a search on google for "detect screen resolution javascript js" and
this was the first hit:
http://www.zimmertech.com/tutorials_resdetect.html
Good start eh?
Then I did search for "set a cookie with javascript". There were plenty of
hits, including:
http://hotwired.lycos.com/webmonkey/reference/javascript_code_library/wm_cki
e_lib/?tw=reference&category=forms_data
Then go to the PHP manual and check out the cookie functions, and the
$_COOKIE array (if PHP >= 4.1), and learn how to read cookie data (in this
case, set by javascript).
You may want to also look at sessions rather than cookies, and will want
contingency planning for those without either JS or Cookies (what default do
they get?).
Justin
on 23/05/03 1:25 PM, César Aracena (lists@icaam.com.ar) wrote:
> Hi all,
>
> I've been doing some reading about this and I can't believe there's not a
> solution for what I'm trying to do. I'm building a site for myself and I
> want a nice one, so I decided to create 2 title banners for each part of
> the site... 800x600 one and another for 1024x768 screen resolution. The
> rest of the site is rezisable.
>
> I figured out (and it's logical) that PHP is server-based so it cannot
> know the visitor's screen resolution, but what about one page searching
> for it and another one making the decision? I mean, I don't wanna do 2
> pages for every part of my site but instead, after the visitor sees the
> index.php page, which he will HAVE TO (here comes the cookies part),
> another cookie sets a value with either 800 or 1024 value, and an IF -
> ELSEIF statement indicates which banner to display... sounds logical to
> me...
>
> Ok, let's say that PHP CANNOT tell what resolution a visitor has, but what
> about java? Is there someone here who can finally show me what to do to
> set a cookie or variable from within java??? PLEASE??? and by the way, to
> trow me some java script which will do the trick along with PHP.
>
> Another thing... the desicion MUST be taken at index.php and never bother
> again, because I use a header.inc as a template for ALL my site.
>
> Thanks in advanced,
>
> -----------------------
> Cesar Aracena
> lists@icaam.com.ar
> http://www.icaam.com.ar
> Cel: +54.299.635-6688
> Tel/Fax: +54.299.477-4532
> Cipolletti, Rio Negro
> R8324BEG
> Argentina
>
>
>
>
> ---------------------------
> Soluciones profesionales en
> Internet y Comunicaciones
> http://www.icaam.com.ar
>
>