Jump to content


Photo

Dynamic Links.. How to?


  • Please log in to reply
4 replies to this topic

#1 spfoonnewb

spfoonnewb
  • Members
  • PipPipPip
  • Advanced Member
  • 276 posts

Posted 27 October 2006 - 03:28 AM

How do I make dynamic links that look like this:

http://www.domain.com/index.php?page=category/subject

that use an array, or switch statement? Just how do you do that is the real question!?

Each category would have to be a different directory, and each subject a different file.. or I need to be able to specify.

It would be used to include pages that already exist in off root level directories.

It would also need to have a default page, or message; for security reasons.

#2 ldsmike88

ldsmike88
  • Members
  • PipPipPip
  • Advanced Member
  • 168 posts
  • LocationFlorida

Posted 27 October 2006 - 04:41 AM

It sounds like you need one page and on that page have two variables (category and subject). From those to variables you could change the site all you want. The link would look like this though:
http://www.domain.com/index.php?page=category&subject=laundry

Hope this helps!

Michael

#3 redarrow

redarrow
  • Members
  • PipPipPip
  • Advanced Member
  • 7,308 posts
  • Locationlondon

Posted 27 October 2006 - 08:04 AM

<?php
echo"<a href='http://www.domain.com/index.php?page=$category'>category/a>";
echo"<a http://www.domain.com/index.php?subject=$laundry'>subject</a>";
?>

Then this ok
<?php
if($_GET['page']=="category"){

//do somethink

}elseif($_GET['subject']=="laundry"){

//do some think

}else{}

?>

Wish i new all about php DAM i will have to learn
((EMAIL CODE THAT WORKS))
http://simpleforum.ath.cx/mail2.inc
((PAYPAL INTEGRATION THAT WORKS))
http://simpleforum.a...aypal1_info.inc

#4 spfoonnewb

spfoonnewb
  • Members
  • PipPipPip
  • Advanced Member
  • 276 posts

Posted 27 October 2006 - 12:49 PM

I know how to do all those, I was wondering how you make the links "look" like this:
(Ive seen it on a few sites..)

http://www.domain.com/index.php?page=category/subject


#5 spfoonnewb

spfoonnewb
  • Members
  • PipPipPip
  • Advanced Member
  • 276 posts

Posted 27 October 2006 - 09:55 PM

Noone knows?




0 user(s) are reading this topic

0 members, 0 guests, 0 anonymous users