FRIHOST FORUMS SEARCH FAQ TOS BLOGS COMPETITIONS
You are invited to Log in or Register a free Frihost Account!


Resolution Based Something Displayer





Kurosaki-Ichigo
Say for example i have a site and i want a different layout for each screen resolution. Like if it was 1024x800 the page layout1.html would come. If 800x600 the page layout2.html would come. You know.

I need a script that selects random images from a specific folder too.

Hey thnx. Actually im a bit curious and its really interesting this PHP. You dont need to go like :

blablabla = "you put your images here".

I know how php works a little and can figure it out myself. Just gimme the script Very Happy .
Karrde
PHP is a server-side language, so its not really capable of pulling client-side information like screen resolution. You can, however, do what you're wanting with Javascript.

Code:

<script type="text/javascript">
<!--
if ((screen.width = 1024) && (screen.height = 768))
{
 window.location="layout1.html";
}
else if ((screen.width = 800) && (screen.height = 600))
{
  window.location="layout2.html";
}
//-->
</script>


That should do more or less what you're after. Adjust to suit, of course.

As for a random image from a directory, this might help.
Related topics
web-based project manager
Nokia does Linux on its new Internet tablet
Web Based Game
Buying PHP based RPG
php and mysql connection in flash based website
Installing a SMF based forum
The downfall of american society
resolution detection with javascript
Computer Graphics: They're Not All The Same
Anyone like Russell Peters?
Bluetooth
Emulator - A Hardware Based Learning Model
How to create Realistic Action-Based New Year's Resolutions
Super cool tech: High resolution imaging from a single image
Reply to topic    Frihost Forum Index -> Scripting -> Php and MySQL

FRIHOST HOME | FAQ | TOS | ABOUT US | CONTACT US | SITE MAP
© 2005-2011 Frihost, forums powered by phpBB.