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