Jump to content

Archived

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

spfoonnewb

Dynamic Links.. How to?

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.

Share this post


Link to post
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

Share this post


Link to post
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]

Share this post


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

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

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.