/    Sign up×
Community /Pin to ProfileBookmark

resolution

i am trying to create a php script of resolution

[CODE]
<?php
if (screen.width >= 1024)
{
document.write(“<IFRAME width=”1024″ height=”100%” left=”0″ top=”0″ frameborder=”0″ border=”0″ >”
}
else {
document.write(“<IFRAME width=”100%” height=”100%” left=”0″ top=”0″ frameborder=”0″ border=”0″>”

}
?>
[/CODE]

i try test it but it doesnt work… i am curious are there possible to create other way like this script?

to post a comment
PHP

4 Comments(s)

Copy linkTweet thisAlerts:
@SamApr 06.2004 — while the tags around your script were php, the rest of it was javascript (which is a client side), which is the only way to sniff resolution. PHP is proccessed before the page is servered to the browser, thus can't find things like screen resolutions.
Copy linkTweet thisAlerts:
@cmaauthorApr 06.2004 — so i made some mistakes... i mean this is not working on php eh?

ok i will try to turn it into javascript and test it

like this

[CODE]
<SCRIPT LANGUAGE="JavaScript">
if (screen.width >= 800)
{
document.write("<IFRAME width="1024" height="100%" left="0" top="0" frameborder="0" border="0">"
}
else {
document.write("<IFRAME width="100%" height="100%" left="0" top="0" frameborder="0" border="0">"

}
</script>
[/CODE]


*tests it *

darn it doesn't work :?

umm can you create a script like this? [ you can call me moron, idiot or whatever... i am half waking up and sleepy]
Copy linkTweet thisAlerts:
@shimonApr 06.2004 — You would have more luck getting help with your javascript in the javascript forum, php is irrelevant to your cause.







[SIZE=1]anyone else have a sense of deja vu here?[/SIZE]
Copy linkTweet thisAlerts:
@cmaauthorApr 06.2004 — ok thanks i will create a new thread in javascript

BUT i don't want to be very annoying to do it... SO can someone move this thread to javascript forum?

thank you.
×

Success!

Help @cma spread the word by sharing this article on Twitter...

Tweet This
Sign in
Forgot password?
Sign in with TwitchSign in with GithubCreate Account
about: ({
version: 0.1.9 BETA 5.19,
whats_new: community page,
up_next: more Davinci•003 tasks,
coming_soon: events calendar,
social: @webDeveloperHQ
});

legal: ({
terms: of use,
privacy: policy
});
changelog: (
version: 0.1.9,
notes: added community page

version: 0.1.8,
notes: added Davinci•003

version: 0.1.7,
notes: upvote answers to bounties

version: 0.1.6,
notes: article editor refresh
)...
recent_tips: (
tipper: @AriseFacilitySolutions09,
tipped: article
amount: 1000 SATS,

tipper: @Yussuf4331,
tipped: article
amount: 1000 SATS,

tipper: @darkwebsites540,
tipped: article
amount: 10 SATS,
)...