Forum Moderators: coopster
widgets.com/index.php?article=1
i know how to get 1
echo $_GET['article'];
is there anyway to get article?
I am trying to make my page dynamic, but I need a way to get article.
for instance I'm using the following script for part of my site.
while ($fetch = mysql_fetch_object($urls)){
$linkage2 = $fetch->link;
if (isset($_GET[$linkage2])){
${$linkage2} = $_GET[$linkage2];
}
}
now i need some way to figure out what the ${$linkage2} variable is. so I can use it elseware, the problem is since it's dynamic it will never be the same thing so I can't just do one of my known gets, like $widgets
if I don't do it inside the loop $key is always equal to my last $_GET
which makes sense. However when I have a link that looks like this
index.php?page=1&topic=3&subsection=2
$key is always subsection and $val is always 2.
I've tried using a loop like this
for($i = 1; $i<=10; $i++){
foreach ($_GET as ${"key" . $i} => $val) {
}
echo "${"key" . $i}<br>";
}
which obviously doesn't work because for 1 it does the loop, then for 2 it does the loop, so everything still ends up being page. this is driving me nuts...
I need to get it so this is true below
$key1 = "page";
$key2 = "topic";
$key3 = "subsection";
any help would be great