I need this script to detect if a user has javascript on. and if they dont, redirect them AUTOMATICALLY to enable_javascript.php where it will refresh every 5 seconds to check and see if they re-enabled javascript. and if they did, take them back to index.php
PHP Code:
I need this to refresh a page every 5 seconds
and if it detects javascript is on then take user to index
pretty sure you don't need the quotes around the URL. You haven't really specified a problem with the script. Clearly you must have a problem but you haven't specified what it is
I need this script to detect if a user has javascript on. and if they dont, redirect them AUTOMATICALLY to enable_javascript.php where it will refresh every 5 seconds to check and see if they re-enabled javascript.
Wow, that's annoying. Why would you want to do such a thing?
The refresh is pointless every five seconds. You should just redirect to a page with "JavaScript not enabled - Please change your settings and re-visit the site" or something like that. What is the point in wasting all that bandwidth with refreshes?
And like I said, you havent specified a problem, so how do you expect people to help you ffs
Yea, you guys are SOME help >< My site runs on javascript and I don't want people without javascript on my site because it won't work right.
Then your site is poorly designed.
Quote:
W/e, i'm going to solve this on irc. cuz you guys are NO help at all..
Alls you do is complain
When such a retarded idea is mentioned, (and on a public forum where you are open to any opinion or suggestion), what do you expect? Btw, you've never had previous help? Nice way of showing gratitude if you have.
Now, if you'd spent even five minutes looking at any documentation, you would know that the meta tag method posted above is the one you need. Header doesn't have a refresh option. Never did and probably never will.
Yea, you guys are SOME help >< My site runs on javascript and I don't want people without javascript on my site because it won't work right.
My comment / question was honestly meant to help, in a round about way. I wanted to know why you'd want to do such a thing. If your goal is to have a "JS required" website, then simply place a message letting the user know and give them the option of enabling JS to view the site. Why find some rinky-dink way to redirect them and force them to enable it?
The bottom line is, your goal should be designing an unobtrusive site that degrades gracefully when non-JS users or users with older browsers visit. That's the reasoning behind my "complaint".
Quote:
Originally Posted by ShadowIce
W/e, i'm going to solve this on irc. cuz you guys are NO help at all..
Yes! Because we all know IRC is the last bastion of humanity left in this cruel world. You will find NO criticism there!
Just wanted to call you on this MattF. Though it's not part of an official standard, it's very use in HTTP-EQUIV attributes in <head> sections of HTML is functionally identical to it's use in header() calls in PHP.
Just wanted to call you on this MattF. Though it's not part of an official standard, it's very use in HTTP-EQUIV attributes in <head> sections of HTML is functionally identical to it's use in header() calls in PHP.
The term for that situation is 'correct', not 'call'. You 'call' someone when they are intentionally stating an untruth or similar. You 'correct' someone if they are unintentionally incorrect.
Relying on practically undocumented and unofficial behaviour is hardly good practice, however. There's no guarantee that it will be consistent across various clients, however. I will concede the point that it exists though.