Jump to content


Photo

Switch linking?


  • Please log in to reply
3 replies to this topic

#1 XFactordx

XFactordx
  • New Members
  • Pip
  • Newbie
  • 4 posts

Posted 19 March 2006 - 05:25 PM

I'm trying to setup a system with links like [a href=\"http://www.blahblah.com/something.php?p=\" target=\"_blank\"]http://www.blahblah.com/something.php?p=[/a]variabletolinkto

I can't figure out how to set this up, and have the variabetolinkto cause the something.php to do something. Thanks.

#2 keeB

keeB
  • Staff Alumni
  • Advanced Member
  • 1,078 posts
  • LocationCalifornia

Posted 19 March 2006 - 08:07 PM

<?php

switch ($_GET['p']) {

CASE 'links':
  include('links.php');
  break();

CASE default:
  include('index.php');
  break();
}

Come visit my site to see my latest projects
http://nick.stinemates.org/wordpress/


#3 XFactordx

XFactordx
  • New Members
  • Pip
  • Newbie
  • 4 posts

Posted 19 March 2006 - 09:48 PM

I was asking along the lines of, lets say i get a link to index.php?p=feb02 then feb02 would get shot into a query/function or whatever and then do its thing that way. any way to set that up?

thanks for the start.

side note, feb02 IS NOT concrete, it changes. thats why im asking, i dont want to make new cases every day lol

#4 hitman6003

hitman6003
  • Members
  • PipPipPip
  • Advanced Member
  • 1,807 posts

Posted 19 March 2006 - 09:54 PM

You should read the manual.

Specifically the sections on variables and $_GET variables.

[a href=\"http://us2.php.net/manual/en/reserved.variables.php#reserved.variables.get\" target=\"_blank\"]http://us2.php.net/manual/en/reserved.vari...d.variables.get[/a]

Essentially any variable that you pass in the url is available through the $_GET array. From there you can use it and manipulate it however you want...for a query, for deciding which page to display, etc.




0 user(s) are reading this topic

0 members, 0 guests, 0 anonymous users