Banner

Sponsor

Login


Welcome Back!
Guest
Guest

Register

Lost your password?

74 users online



Query Strings Question [read before locking/deleting]

Query Strings Question [read before locking/deleting]

Currently viewing this thread: 1 (0 members and 1 guests)


Aki

Aki

Neverside Newbie
Status: Offline!

Query Strings Question [read before locking/deleting]

Ok:

switch( $_GET['page'] ) {
case 'news' :
include 'news.php';
break;
case 'portfolio' :
include 'portfolio.php';
break;
default:
include 'news.php';
break;
}

now how do I make like a index.php?page=news&pagetype=viewnews or something like that with the coding above (with the default function so when they go to index.php it would pull up news)? That coding above only produces index.php?page=news

I asked you something like this before, but it never got answered.

I could use something like this:

PHP:

<?php
if($_GET['type'] == "guides" && $_GET['id']== "ahugeguide")
{
include 
'myfilehere.php';
}
?>

However, that doesn't include that "default" function... which is what I want?

SO: basically how can I produce a "somepage.php?page=this&id=that" query string WITH THE "DEFAULT" FUNCTION? Smile Get it? Errr, sorry if it's long and confusing.... heheh

angelessme

angelessme

Neversidian
Status: Offline!
PHP:

<?php
if($_GET['type'] == "guides" && $_GET['id']== "ahugeguide")

{

include 
'myfilehere.php';

}

elseif(
$_GET['type'] == "pants" && $_GET['id']== "childrens")

{

include 
'pants.php';

}

else
{
include 
'megacooldefaultpage.php';
}
?>

___________________

angelessme, antagonising neverside members, staff and administration since 2001.

Aki

Aki

Neverside Newbie
Status: Offline!

That doesnt work. It just repeats the "default" page over and over and OVER again... :grumpy

epyon

epyon

16, staying Asian.
Status: Offline!

That should work.
Let's see what you're using.

___________________

http://whatpulse.bounceme.net/sig/epyon.png

Aki

Aki

Neverside Newbie
Status: Offline!

Exactly that. I think it has something to do w/ my host because... o_O It's not even giving me and error nothing, and when I go to index.php?type=pants&id=childrens it's not even giving me anything.

I am awaiting activation at another hoster and I'll test it there. Wink

I'll post again when... I get to my new hoster. Roll Eyes

Aki

Aki

Neverside Newbie
Status: Offline!

Hey, I got on my new host and finally got off my butt and decided to test it.

Oddly, it worked. Thanks guys! Wink

Quick Jump:

Main Navigation


Site & Graphic Design by Aeon Tan
Developed by Jeremie Pelletier & Scott Roach


NeverAPI generated this page in 0.0075 seconds.