[PHP] Re: Output (Urgent!)
This fixed it, but I don't like it! If you have any other suggestions, feel free to email me. SCRIPT LANGUAGE=JavaScript if (screen.width = 1024) { var resolution = (1024) } else { var resolution = (800) } /SCRIPT Best Regards Fredrik A. Takle Fredrik A -- 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]
[PHP] RE: Output (Urgent!)
all this is happening on the server. on the server $resolution is just a string so if ($resolution = '1024') compares the two strings (using ascii values) and finds that (60) is greater than 1(49). If you want the server to know the screen width of the client you'll need to dig into the header info sent with the request, or you may need to get javascript to send it back to you, I'm not too sure about this. Tim Ward Senior Systems Engineer Please refer to the following disclaimer in respect of this message: http://www.stivesdirect.com/e-mail-disclaimer.html -Original Message- From: Fredrik A. Takle [mailto:[EMAIL PROTECTED]] Sent: 17 July 2001 08:35 To: [EMAIL PROTECTED] Subject: Output (Urgent!) Why doesn't this work? Any ideas?! $resolution = SCRIPT LANGUAGE=\JavaScript\document.write(screen.width)/SCRIPT; if ($resolution = '1024') { $resolution = 1024; } else { $resolution = 800; } echo $resolution; It always output 1024 Best regards Fredrik A. Takle Bergen, Norway -- 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]
[PHP] Re: Output (Urgent!)
Well, Yes... you have to stick to JavaScript + JavaScript and not JavaScript + PHP! You can let PHP talk w/ JavaScript and not the reverse! SCRIPT LANGUAGE=JavaScript type=text if (screen.width = 1024) { var resolution = 1024; } else { var resolution = 800; } document.write(resolution); /SCRIPT btw, why don't you like it? Fredrik A. Takle [EMAIL PROTECTED] wrote in message [EMAIL PROTECTED]">news:[EMAIL PROTECTED]... This fixed it, but I don't like it! If you have any other suggestions, feel free to email me. SCRIPT LANGUAGE=JavaScript if (screen.width = 1024) { var resolution = (1024) } else { var resolution = (800) } /SCRIPT Best Regards Fredrik A. Takle Fredrik A -- 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]