PHP programming forum. Ask questions or help people concerning PHP code. Don't understand a function? Need help implementing a class? Don't understand a class? Here is where to ask. Remember to do your homework!
Everything works perfect until if the user disables the javascript(i tested it in firefox) in his browser, then the page stops suddenly in the middle. If i use
I searched the forum and found that no HTML should be sent before header. Atleast the title will be sent. The situation is this.
1. Can't use javascript (if user disables the javascript).
2. Using html to send atleast title and some meta tags and sometimes more html to design tables and etc..
satheshf12000 wrote:2. Using html to send atleast title and some meta tags and sometimes more html to design tables and etc..
What is the point in sending a html document (even only parts of if) when there's a "hey client, don't fetch this document, load another one" header?;)
satheshf12000 wrote:How can i redirect then ? Using
..? If I use meta to redirect, what are the disadvantages ?? Any other way ??
disadvantages:
http://www.w3.org/TR/html4/struct/global.html#edef-META wrote:Note. Some user agents support the use of META to refresh the current page after a specified number of seconds, with the option of replacing it by a different URI. Authors should not use this technique to forward users to different pages, as this makes the page inaccessible to some users. Instead, automatic page forwarding should be done using server-side redirects.
If you have to bother with such browsers (not supporting meta/refresh) in the real world you may use
<html>
<head>
<title>redirect test</title>
<meta http-equiv="refresh" content="1;url=www.php.net">
</head>
<body>
<div>
If your browser does not support meta redirection please click
<a href="http://www.php.net">here</a>
</div>
</body>
</html>
It's not possible to detect if Javascript is enabled in PHP alone. It needs some help from the browser. Basically, you write a piece of Javascript in the initial page request that requests (in some fashion) a file/url or something that will signal your server that they have Javascript on. You also supply a <noscript> so that it doesn't break functionality.