Page 1 of 1

redirect issue

Posted: Wed Jul 18, 2007 5:57 am
by aschandra27
feyd | Please use

Code: Select all

,

Code: Select all

and [syntax="..."] tags where appropriate when posting code. Your post has been edited to reflect how we'd like it posted. Please read:  [url=http://forums.devnetwork.net/viewtopic.php?t=21171]Posting Code in the Forums[/url] to learn how to do it too.[/color]


hi

i am having a problem with redirect. the page which works fine with my localhost, when copied to a different server doesnt work. the code is below

Code: Select all

<?
session_start();
if(!session_is_registered(myusername)){
header("location:template.php");
}
?>

<html>
<body>
<?php
header( 'Location: showrec.php' ) ;
?>
</body>
</html>
when copied to a differnt server it stops redirecting the page and sits there. please help


feyd | Please use

Code: Select all

,

Code: Select all

and [syntax="..."] tags where appropriate when posting code. Your post has been edited to reflect how we'd like it posted. Please read:  [url=http://forums.devnetwork.net/viewtopic.php?t=21171]Posting Code in the Forums[/url] to learn how to do it too.[/color]

Posted: Wed Jul 18, 2007 6:31 am
by Gente
1. You shouldn't use header( 'Location: showrec.php' ); after output as header are sent
2. Use '<?php' + '?>' instead of '<?' + '?>' (PHP5 required '<?php' tag)

thank you

Posted: Wed Jul 18, 2007 6:40 am
by aschandra27
tried even that approach. the whole bunch of files are having problem with redirect. its able to redirect it back , but not to front. the scripts running on my local machine/local server are fine.. but on remote getting all kind of redirect problems.

Posted: Wed Jul 18, 2007 6:57 am
by feyd
Have you read the Tutorial we've had available for several years?