Jump to content

Recommended Posts

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

Link to comment
https://forums.phpfreaks.com/topic/75292-solved-page/#findComment-380788
Share on other sites

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.

Link to comment
https://forums.phpfreaks.com/topic/75292-solved-page/#findComment-380792
Share on other sites

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

Link to comment
https://forums.phpfreaks.com/topic/75292-solved-page/#findComment-380798
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.