rusty1001 Posted November 21, 2007 Share Posted November 21, 2007 Hi I have login box running across all pages for login, template based.. so the script is module based .. on login script page tep_redirect(tep_href_link(FILENAME_DEFAULT)); and it goes to index.php -- I want the filename to go the same page after login.... ie stay on the same page... how can I define this ? I thought I could define a _DEFAULT2 and define that where the filenames.php are located... what is the script for redirecting to the self/ same page in php..tried a few things but no luck,,,should be pretty simple? thanks Russell noob (can you tell?) Link to comment https://forums.phpfreaks.com/topic/78335-redirect-to-same-page-after-login/ Share on other sites More sharing options...
cooldude832 Posted November 21, 2007 Share Posted November 21, 2007 well if every login page you do has the same action just set the header("location: pageyouwant.php"); asnd you are all set Link to comment https://forums.phpfreaks.com/topic/78335-redirect-to-same-page-after-login/#findComment-396371 Share on other sites More sharing options...
rusty1001 Posted November 22, 2007 Author Share Posted November 22, 2007 Hi Thanks for the reply, I was wondering though as this login box repeats through the pages, it does not really know where it is an there really is only one file so could this have something to do with $PHP_SELF, or similar, thanks regards Link to comment https://forums.phpfreaks.com/topic/78335-redirect-to-same-page-after-login/#findComment-396515 Share on other sites More sharing options...
rusty1001 Posted November 22, 2007 Author Share Posted November 22, 2007 Ps sorry there are 4 templates(sections) , should I add this to header("location .... )to each page, which btw the way is html, ) I am using sts template which enables you create html template and it works around the php code, Link to comment https://forums.phpfreaks.com/topic/78335-redirect-to-same-page-after-login/#findComment-396518 Share on other sites More sharing options...
Evan69 Posted November 22, 2007 Share Posted November 22, 2007 just make sure you havent outputted anything before you use header("Location"), otherwise it wont work. Link to comment https://forums.phpfreaks.com/topic/78335-redirect-to-same-page-after-login/#findComment-396637 Share on other sites More sharing options...
snk Posted November 22, 2007 Share Posted November 22, 2007 if you want to do some stuff and then redirect then do something like that <?php ob_start(); session_start(); header("Cache-control: private"); // IE 6 Fix. $_SESSION['card'] = $_POST['card']; $_SESSION['dateF'] = $_POST['dateF']; $_SESSION['dateT'] = $_POST['dateT']; $_SESSION['hotelkey'] = $_POST['hotel']; $_SESSION['tprice'] = $_POST['price']; $_SESSION['roomkey'] = $_POST['roomkey']; $_SESSION['cvs'] = $_POST['cvs']; $_SESSION['name'] = $_POST['nameVisitor']; echo "i write something and then i redirect"; // BANK redirection to the below link header("Location: http://www.myfoxnet.com/project/paymentok.php5"); ob_flush(); ?> just pay attention to ob_start() and ob_flush() the $_session variables are just an example of copy paste of my code... you dont need to use them just use the ob_xxx() Link to comment https://forums.phpfreaks.com/topic/78335-redirect-to-same-page-after-login/#findComment-396708 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.