Go Back   Free website templates > Web Template Help > PHP and MySQL
User Name
Password
Register FAQ Members List Calendar Search Today's Posts Mark Forums Read


Join now to download all the free website templates or post on the forum. If you have never been on a forum before read the FAQ. It's quick, easy and free to join!
Reply
 
LinkBack Thread Tools Display Modes
  #1 (permalink)  
Old 05-23-2008, 06:32 PM
vareside's Avatar
Senior Member
 
Join Date: Jul 2007
Posts: 254
vareside is on a distinguished road
Post URL Param Script

Hi folks,
I need a php script that displays different contents depending on the parameters added to the URL.


An example:

URL: http://www.vareside.com/en/videos.php?vid=914
CONTENT: A

URL: http://www.vareside.com/en/videos.php?vid=173
CONTENT: B
Reply With Quote
  #2 (permalink)  
Old 05-24-2008, 06:53 AM
pezboy45's Avatar
Mod/Design & Coder [Pro]
 
Join Date: Nov 2006
Location: Hawaii
Posts: 686
pezboy45 is on a distinguished road
Send a message via AIM to pezboy45 Send a message via MSN to pezboy45
Default

__________________


If I ever don't follow up on something, please feel free to PM me. I've got a lot going on, so a friendly reminder helps.
Reply With Quote
  #3 (permalink)  
Old 06-30-2008, 11:23 AM
vareside's Avatar
Senior Member
 
Join Date: Jul 2007
Posts: 254
vareside is on a distinguished road
Default

Found a solution:

<?php

$content=$_GET['vid']; //Parameter defined

if ($content=='914') //Value of parameter and content
{
echo('CONTENT GOES HERE');
}

if ($content=='173') //Value of parameter and content
{
echo('SECOND CONTENT GOES HERE');
}

?>
Reply With Quote
  #4 (permalink)  
Old 06-30-2008, 11:51 AM
pezboy45's Avatar
Mod/Design & Coder [Pro]
 
Join Date: Nov 2006
Location: Hawaii
Posts: 686
pezboy45 is on a distinguished road
Send a message via AIM to pezboy45 Send a message via MSN to pezboy45
Default

Very nice.
What does your url look like?
__________________


If I ever don't follow up on something, please feel free to PM me. I've got a lot going on, so a friendly reminder helps.
Reply With Quote
  #5 (permalink)  
Old 06-30-2008, 03:03 PM
vareside's Avatar
Senior Member
 
Join Date: Jul 2007
Posts: 254
vareside is on a distinguished road
Default

I made a few advanced functions using this script.
For example a few URLs at VareSide:
http://www.vareside.com/portal/conte...ategory=action
www.vareside.com/portal/content.php?page=videos
my entire site is now in content.php except the homepage at index.php
Reply With Quote
Reply

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On



All times are GMT. The time now is 01:25 PM.



mouseover mouseover mouseover