Jump to content

Archived

This topic is now archived and is closed to further replies.

XFactordx

Switch linking?

Recommended Posts

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][u]variabletolinkto[/u]

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

Share this post


Link to post
Share on other sites
[code]<?php

switch ($_GET['p']) {

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

CASE default:
  include('index.php');
  break();
}[/code]

Share this post


Link to post
Share on other sites
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

Share this post


Link to post
Share on other sites
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.

Share this post


Link to post
Share on other sites

×

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.