Kelvie Posted September 12, 2007 Share Posted September 12, 2007 What are the limits of the header() function?? I have tried using this: header("Location: ./index.php"); But it just refuses to load it. It goes from rpg.php?RPGlink=overview to just rpg.php, not back to index.php ANy ideas? Quote Link to comment Share on other sites More sharing options...
Kelvie Posted September 12, 2007 Author Share Posted September 12, 2007 any ideas? :\ Quote Link to comment Share on other sites More sharing options...
phat_hip_prog Posted September 12, 2007 Share Posted September 12, 2007 ../index.php two dots back? (not checked!) Quote Link to comment Share on other sites More sharing options...
xyn Posted September 12, 2007 Share Posted September 12, 2007 depends where index.php is ../index.php <= back one level /index.php <= your root index ../../ <= two directories etc. Quote Link to comment Share on other sites More sharing options...
Kelvie Posted September 12, 2007 Author Share Posted September 12, 2007 rpg.php and index.php are in the same directory folder. I know for sure the ehader actually runs. What happens is it goes from 'rpg.php?RPG=overview' to 'rpg.php' instead of changing header to 'index.php'. Basically removing the variables and refreshing the page.. the exact script used for header is: header("Location: index.php"); Now before you say ' its cause the path isnt right' well wouldn't that still change the webpage but just say Page cannont be Displayed? Note 2 things about my script. 1, the page is decided by rpg.php, in its script, and the page decided by rpg.php is included in the script. eg, include("filename"). I'm trying to convert my site from using meta-equiv to change the URL to using header(). Hope this helps in understanding my problem. One more thing, since meta-equiv is used perhaps because its sending an additional header its causing an issue? --MORE ----------------------- http://rpg.root51.com/index.php <--- see for yourself there. It's in absolute alpha stage so its completely sucky, it's more of 'testing' before I continue with my actual game. Anyway register up, and then login and then logout. The logout button runs the condition to use the header() function. ----------------------------- An exact copy of rpg.php ---- <?php @include("session.php"); if(empty($_SESSION[*removed*])){ echo "Not logged in; redirecting.."; echo '<meta http-equiv="refresh" content="0;URL=index.php" />'; die(); } switch($_GET[RPG]){ case 'ranks': @include("./pages/ranks.php"); break; case 'profile': @include("./pages/profile.php"); break; case 'overview': @include("./pages/overview.php"); break; case 'mail': @include("./pages/mail.php"); break; case 'inbox': @include("./pages/inbox.php"); break; case 'sendmail': @include("./pages/write.php"); break; case 'viewmail': @include("./pages/viewmail.php"); break; default: @include("./pages/overview.php"); break; } ?> Thanks -Aaron Quote Link to comment Share on other sites More sharing options...
Kelvie Posted September 13, 2007 Author Share Posted September 13, 2007 bump. :\ Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.