PDA

View Full Version : "if($_GET['logout'])" type thing . . . You there DJ?


Rob_Che
09-01-2010, 08:02 PM
OK... not really sure how to describe this but here goes...

I want to create a template that displays videos under a particular category from the database but using the same page template.

What I want to do is create a query based on the url...

So general query is:
SELECT * FROM database WHERE 'category' = cat1

I want to use "template.php?c=cat1"
and use the ?c=cat1 to generate a variable that I can use in the query... Am I making sense?

So I could have:
SELECT * FROM database WHERE 'category' = $cat1

Any questions/answers welcomed,,,,
Cheers
Rob

Rob_Che
09-01-2010, 08:40 PM
Woot!

$var1 = $_GET['cat']

It really wasn't that hard :roll:

:-D
Rob

davidj
09-01-2010, 09:01 PM
nice one mate

Rob_Che
09-01-2010, 09:31 PM
Thanks DJ... I actually got the answer from our old login/logout tutorial (as you can probably see from the title I posted) :wink:

I've never used it because it looks a bit crap on the URL but I can adjust that through the .htaccess and make it look nice "URL.com/category/cat1" etc...

Cheers DJ!
Rob