PDA

View Full Version : REDIRECT problem


tanhaha_how
01-16-2007, 09:01 AM
hi everyone,i hav a problem here....


if(...){
.....
....
}else{
....
....
echo "<meta http-equiv=\"Content-Type\" content=\"text/html; charset=iso-8859-1\">";
echo "<meta http-equiv=\"REFRESH\" content=\"0; URL=login.php\">";


actually this red color 1 is refresh that page...is it any other way to use method of redirect????i hav tried header(""); before....but it cant works....help me pls

kehers
01-16-2007, 09:21 AM
What is the exact problem? That doesnt work? Hope you are not echoing it out after you have closed your head tag?
For header(),

Remember that header() must be called before any actual output is sent, either by normal HTML tags, blank lines in a file, or from PHP

and also remember that the syntax is

header("location: login.php");

If all this fails, then try using javascript.
Instead of the
echo "<meta http-equiv=\"REFRESH\" content=\"0; URL=login.php\">";

do

echo "<script type=\"text/javascript\">
<!--
window.location=\"login.php\";
-->
</script>";


Hope it helps

tanhaha_how
01-16-2007, 01:34 PM
yeah!!!it works very well.....thanks man....u solve my problem...

thank you very much...:thumbsup: :thumbsup: :thumbsup: :thumbsup: :thumbsup: