vForums Support Banner



 

Welcome Guest! Please Login or Register
vForums Support :: Programming & Coding :: Programming Discussion :: ?area= ???? - View Topic
Topic Rating: *****
Printable View
dog199200
Guest
?area= ???? (30th May 09 at 8:42am UTC)
This may sound like an odd question, but who here has tried to take there website url and get it so it says something like http://www.domainname.com/index.php  index2 or something along those lines? I've been trying to do it for a while now in a staff area on a website of mine and I can't figure it out, so I am wondering if I am the only person taht can't figure it out {Tongue Out}

Though I do know is that the "area" you want needs to be names accordingly, so for like the example i used above, in your host it should be names index-index2.php, or so i've been told, and if done it will convert, but one problem I can't get it. Anyways i'm wondering does anyone know where I can find like guides on how to do this stuff, and if there is any coding involved which i about imagine there is. Anything would help right about now because i'm getting annoyed lol.
Ross
Administrator
*****

[Avatar]

Posts: 3,709
Status: Offline
Gender: Male
Age: 9 14
Joined:  

Additional Groups:
Support Team
***


Reputation: 45%  


pmwwwtwittergtalkvForum
Re: ?area= ???? (30th May 09 at 10:15am UTC)
I'm a little confused. What is it you're trying to achieve? You want lots of pages to go somewhere like your-site.com/?area=admin, your-site.com/?area=news etc. {Confused}

Image
dog199200
Guest
Re: ?area= ???? (30th May 09 at 8:12pm UTC)
kind of, more like subpages, not exactly all pages. So like if the webpage is in a staff are like staffcp.php its sub pages would be something like staffcp-help.php, staffcp-test.php, exc. I've seen it done a lot and I just don't know how they do it.
Ross
Administrator
*****

[Avatar]

Posts: 3,709
Status: Offline
Gender: Male
Age: 9 14
Joined:  

Additional Groups:
Support Team
***


Reputation: 45%  


pmwwwtwittergtalkvForum
Re: ?area= ???? (30th May 09 at 9:37pm UTC)
Posted By dog199200 on 30th May 09 at 8:12pm
 
kind of, more like subpages, not exactly all pages. So like if the webpage is in a staff are like staffcp.php its sub pages would be something like staffcp-help.php, staffcp-test.php, exc. I've seen it done a lot and I just don't know how they do it.


There's a few ways it could be done but all are based on the global $_GET information. That array contains any parameters passed to the page in the URL that way (&key=value). You can then check the contents of the one called id/action/page/whatever you want to call it and use that to decide what code to use or what file to include. For example:

$action = (isset($_GET['action']) && !empty($_GET['action']))? addslashes($_GET['action']) : 'home';

switch($action) {
case 'some-id1':
include 'includes/some-file-name.php';
break;

case 'some-id-2':
include 'pages/do-something.php';
break;
default:
echo "Choose a function to use:...";
break;
}

Image
dog199200
Guest
Re: ?area= ???? (31st May 09 at 8:58pm UTC)
Ah i see, ok I get the idea. I was just told that a code wasn't needed, but it wasn't working, so i figured i'd look into the matter {Tongue Out}
 Printable View

All times are GMT+0 :: The current time is 6:12am
Page generated in 0.1767 seconds
This Forum is Powered By vForums (v2.4)
Create a Forum for Free | Find Forums