Re: [PHP] Re: why does this not work?
script if (screen.width1064) { document.write(link src=\style1.css\ type=\text/css\ rel=\stylesheet\); } else { document.write(link src=\style2.css\ type=\text/css\ rel=\stylesheet\); } /script or use cookie, js write screen.width to cookie,then php read screen.width from cookie. 2005/9/28, Oliver Grätz [EMAIL PROTECTED]: Ross schrieb: $width = script document.write(screen.width); /script; //$ross= intval($width); Yes, this is and will always be zero, because you are evaluating a string to an integer value. echo $width; if ($width 1064) { echo lower; $style= style1.css; } else { $style= style2.css; } OK, no I could insert the stuff about server side and client side. What you want to do is learn about the user's screen width. First of all, this is a bad idea if I you want to use it for design purposes like in this case where you include different CSS files. If I have a 1600x1200 screen, I can easily open a browser window at 640x480. And now? And even if you don't evaluate the screen width but the browser window's width: What about me resizing the already rendered page? Think about better designing the page so you don't need to switch the CSS... OK, enough of evangelism. If you really want to do what you told there: Evaluate the JavaScript on your entry page. Then do a redirect to that same page and insert the value into the URL (e.g. index.php?scrwidth=1280). You can then access this from PHP via $_GET. It is a good idea to store this value in the session once received so you don't have to send it around on each link. AllOLLi 63,000 bugs in the code, 63,000 bugs, ya get 1 whacked with a service pack, now there's 63,005 bugs in the code!! -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php -- Lendy Chen -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] Re: why does this not work?
Ross schrieb: $width = script document.write(screen.width); /script; //$ross= intval($width); Yes, this is and will always be zero, because you are evaluating a string to an integer value. echo $width; if ($width 1064) { echo lower; $style= style1.css; } else { $style= style2.css; } OK, no I could insert the stuff about server side and client side. What you want to do is learn about the user's screen width. First of all, this is a bad idea if I you want to use it for design purposes like in this case where you include different CSS files. If I have a 1600x1200 screen, I can easily open a browser window at 640x480. And now? And even if you don't evaluate the screen width but the browser window's width: What about me resizing the already rendered page? Think about better designing the page so you don't need to switch the CSS... OK, enough of evangelism. If you really want to do what you told there: Evaluate the JavaScript on your entry page. Then do a redirect to that same page and insert the value into the URL (e.g. index.php?scrwidth=1280). You can then access this from PHP via $_GET. It is a good idea to store this value in the session once received so you don't have to send it around on each link. AllOLLi 63,000 bugs in the code, 63,000 bugs, ya get 1 whacked with a service pack, now there's 63,005 bugs in the code!! -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Re: why does this not work?
bit off the point but... Oliver Grätz wrote: Ross schrieb: $width = script document.write(screen.width); /script; //$ross= intval($width); Yes, this is and will always be zero, because you are evaluating a for his paricular $width string, yes. string to an integer value. $butThereIsAlwaysAtLeast = 1 exception to every rule; var_dump(intval($butThereIsAlwaysAtLeast)); good points about CSS/design btw :-) ...and solving the OPs problem. -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] Re: why does my querry work in the mysql client but not in php?
Have you looked at what the value of what $result is? It might be informational. Jc -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] Re: Why does this not work??
In article [EMAIL PROTECTED], [EMAIL PROTECTED] (Jeffrey Means) wrote: In using the setcookie function I can not set a cookie if I specify a time period. ie. setcookie(Cookie_Name, Cookie_Value, time()+30); will not set a cookie, but setcookie(Cookie_Name, Cookie_Value); does work. What am I dooing wrong?? You need to read the docs more carefully, because time() returns a value in seconds, not minutes. Your time period is too short: the cookie expires 30 seconds after having been set. Whereas when you set no expiration, the cookie remains set until the window closes. -- CC -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] RE: why does it not work (fwd)
On 22 May 2001, Chris Searle wrote: Adrian == Adrian D'Costa [EMAIL PROTECTED] writes: Adrian // sql statement $searchStmt = select special.contid, Adrian special.cityid, special.curr1, special.catalogo, Adrian special.hf, special.curr2, special.vitofferta, special.fh, Adrian special.club, special.stars, city.city,RAND as r from Adrian special,city where DATE_SUB(special.periodo, INTERVAL 3 Adrian DAY) '$tdate' and city.id=special.cityid order by r limit Adrian 1 ; So far as I know - the RAND function was introduced in 3.23 - at least the order by RAND functionality. From the docs: In MySQL Version 3.23, you can, however, do: SELECT * FROM table_name ORDER BY RAND() If I cut and past this in the online mysql it works. It display the records randomly, why not in php? Adrian -- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED]