TIP93 Posted May 27, 2015 Share Posted May 27, 2015 I have a template in page.php in which I like accessing pages like this: $podstr = basename(parse_url($_SERVER['REQUEST_URI'], PHP_URL_PATH)); if($podstr==''){include "pages/index2.php";} elseif($podstr=='registration'){include "registration.php"; } elseif($podstr=='login'){include "pages/login.php";} else echo 'ERROR 404'; It basically takes text in URL after the last slash and I therefore I can use nice URLS such aswww.mydomain.com/registration I also have a registration form in reg.php. The form (if filled in correctly) redirects to ok.php, especially www.mydomain.com/ok if(isset($_POST['submitted'])) { if($fgmembersite->RegisterUser()) { $fgmembersite->RedirectToURL("ok"); } } If I open www.mydomain.com/reg.php (which is without my template of course), everything works perfectly! If I open www.mydomain.com/registration. The form does not save any data to my database and redirects me do index.php. Do you have idea where the problem might be? Thank you very much! Quote Link to comment Share on other sites More sharing options...
ginerjm Posted May 27, 2015 Share Posted May 27, 2015 When it "doesn't work", what exactly does happen? Do you get your error 404 message? When one types in "..../registration" how does one get to 'page.php'? Did you replace 'index.php' as your default home page? Did you try to do some echoes to see where you are ending up? 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.