Jump to content

[SOLVED] ?=


verdrm

Recommended Posts

I personally find that method the best.  It many benefits of using an iframe without actually using one.  You would need to use index.php page GET variable as a switch.

 

switch (htmlentities($_REQUEST['page'])) {
 case 'pagename':
   require_once('content/news.php');
   break;
 case 'details':
   require_once('content/productdetails.php');
   break;
 default:
   require_once('content/index.php');
}

 

I'm guessing you meant something like http://www.url.com/file.php?page=pagename

 

Right?

 

There is nothing wrong with what he posted.

Link to comment
https://forums.phpfreaks.com/topic/68262-solved/#findComment-343193
Share on other sites

Can anyone tell me the purpose and use of, for example, http://www.url.com/?page=pagename? How do you design a website to use ?page=pagename and is it a good idea to do that instead of just linking to each individual page?

You'd only be able to use the following url:

http://www.url.com/?page=pagename

 

If you have a index.php file in the root of your website. If you don't have an index.php file you'll have to specify a file, so

http://www.url.com/?page=pagename is the same as http://www.url.com/index.php?page=pagename

 

When you have a index.php file in the root of folder/your sites root that file will always get called if not file is requested.

Link to comment
https://forums.phpfreaks.com/topic/68262-solved/#findComment-343250
Share on other sites

No, sorry, I was replying to your post and squiggerz as well at the same time.

 

Ok, then hit the topic solved button.

 

If you have a index.php file in the root of your website. If you don't have an index.php file you'll have to specify a file, so

 

Though it could be .asp, .jsp, .html, etc.

Link to comment
https://forums.phpfreaks.com/topic/68262-solved/#findComment-343258
Share on other sites

Archived

This topic is now archived and is closed to further replies.

×
×
  • 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.