Forum Moderators: coopster

Message Too Old, No Replies

how to redirect a web page in php

         

Heeren

12:29 pm on Aug 17, 2006 (gmt 0)

10+ Year Member



Please help me
like asp response.redirect , is it any command in php to redirect a wab page.
i am already used header() function , how is it work , please tell me asap
thanks
Atul

Little_G

12:52 pm on Aug 17, 2006 (gmt 0)

10+ Year Member



Hi,

try:
header("Location: http://www.example.com/");

Andrew

Heeren

1:17 pm on Aug 17, 2006 (gmt 0)

10+ Year Member



hello

i add this in my page , its working in the top of the page but not working in the middle and last as i want , please give me other suggestion how to redirect the page in php

dreamcatcher

1:38 pm on Aug 17, 2006 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



Heeren,

Welcome to Webmaster World. :)

The header function cannot be used before any other content is sent to the browser, hence the reason why it fails in the middle of your script. Another alternative would me a meta refresh.

dc

Heeren

1:53 pm on Aug 17, 2006 (gmt 0)

10+ Year Member



i found another altrenative to redirect page here it is
<?php echo("<script>location.href=abc.php'</script>");
?>
thanks
atul