Jump to content

Dynamic Links.. How to?


spfoonnewb

Recommended Posts

How do I make dynamic links that look like this:

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

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.
Link to comment
https://forums.phpfreaks.com/topic/25267-dynamic-links-how-to/
Share on other sites

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:[code]http://www.domain.com/index.php?page=category&subject=laundry[/code]

Hope this helps!

Michael
Link to comment
https://forums.phpfreaks.com/topic/25267-dynamic-links-how-to/#findComment-115228
Share on other sites

[code]
<?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>";
?>
[/code]

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

//do somethink

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

//do some think

}else{}

?>[/code]
Link to comment
https://forums.phpfreaks.com/topic/25267-dynamic-links-how-to/#findComment-115270
Share on other sites

Archived

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

×
×
  • Create New...

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.