jkewlo Posted October 30, 2007 Share Posted October 30, 2007 hello im wondering how i would go about getting a url like to look like this www.blah.com/?page=index and now www.blah.com/index.php please get back to me asap thanks a million! Quote Link to comment https://forums.phpfreaks.com/topic/75292-solved-page/ Share on other sites More sharing options...
Wuhtzu Posted October 30, 2007 Share Posted October 30, 2007 Your question is lost in the incorrect sentence... You mention two types of urls: www.blah.com/?page=index and www.blah.com/index.php Which do you want? Quote Link to comment https://forums.phpfreaks.com/topic/75292-solved-page/#findComment-380787 Share on other sites More sharing options...
jkewlo Posted October 30, 2007 Author Share Posted October 30, 2007 i want it to look like www.blah.com/?page=index or when u click a link it would be www.blah.com/?page=login etc... instead of having the links show in the address bar like www.blah.com/index.php? or www.blah.com/login.php? what would i do to make it like that i know i have to use the $_GET method to do it i just need a guide to show me Quote Link to comment https://forums.phpfreaks.com/topic/75292-solved-page/#findComment-380788 Share on other sites More sharing options...
pocobueno1388 Posted October 30, 2007 Share Posted October 30, 2007 It sounds like you have a mod rewrite on the url...go to your .htaccess file and look for code that looks similar to this - http://www.trap17.com/index.php/php-mod-rewrite-tutorial_t10219.html Quote Link to comment https://forums.phpfreaks.com/topic/75292-solved-page/#findComment-380790 Share on other sites More sharing options...
jkewlo Posted October 30, 2007 Author Share Posted October 30, 2007 hemm not sure if that is it. kk here is a example elcire.no-ip.org/elcire if u look at the links u will see what i am talking about Quote Link to comment https://forums.phpfreaks.com/topic/75292-solved-page/#findComment-380791 Share on other sites More sharing options...
Dragen Posted October 30, 2007 Share Posted October 30, 2007 it could be .htaccess or it could just be a simple get function. It could all be running off the index.php page which collects the get var and includes the correct file. eg: <a href="http://www.blah.com/?page=index">link</a> then in blah.com/index.php: require($_GET['page'] . '.php'); obviously this is a very simple example. You'll want some security on it. Quote Link to comment https://forums.phpfreaks.com/topic/75292-solved-page/#findComment-380792 Share on other sites More sharing options...
jkewlo Posted October 30, 2007 Author Share Posted October 30, 2007 so it would have to include page and then $_GET it Quote Link to comment https://forums.phpfreaks.com/topic/75292-solved-page/#findComment-380794 Share on other sites More sharing options...
Dragen Posted October 30, 2007 Share Posted October 30, 2007 no. What my example was doing was using the index,php, it was collecting the value of $_GET['page']. Then using 'require' to include another php page, where the filename was the value of $_GET['page'], with the added .php part at the end for the file extension. So if you had a link like this: <a href="http://www.mydomain.com/?page=info Then this code: require($_GET['page'] . '.php'); Would include the file http://www.mydomain.com/info.php Quote Link to comment https://forums.phpfreaks.com/topic/75292-solved-page/#findComment-380798 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.