PDA

View Full Version : Migrating from ASP to PHP


boskyvora
06-14-03, 08:11 AM
Hello,

I have just migrated from ASP to PHP. Could u please tell me the replacement of the following statement : Response.Redirect "xyz.asp" in PHP.

This statement redirects user to another page.

Regards,
Bosky

Steven
06-14-03, 08:43 AM
<?php

header("Location: abc.php");

?>

SilkySmooth
06-14-03, 02:29 PM
Hi,

I just thought I would point out that you should always try and use an absolute URI when using the header function in PHP, here is a quick example of how you can do that taken from the PHP Manual.


<?php
header("Location: http://".$_SERVER['HTTP_HOST']
.dirname($_SERVER['PHP_SELF'])
."/".$relative_url);
?>


Taken from http://www.php.net/header

HTH

corley
06-15-03, 09:43 PM
Originally posted by Steven
<?php

header("Location: abc.php");

?>

Will it even work like that? I have always used the full URI so I wouldn't know and I am too lazy to test it out.

amailer
06-15-03, 09:47 PM
err... that works

corley
06-15-03, 09:48 PM
thanks :)