好的,我有一个链接,我希望被同一文件的另一部分访问,但是$_GET
将用户发送到正确的部分。我觉得我正试图绕圈子 - 我知道它不是“GET”变量因为它还没有到达页面,但是在我抓住变量之前我无法到达页面......我只是不明白我需要做什么才能让我能够进入$deck=$_GET['deck'];
的页面。我希望一切都有意义,非常感谢任何帮助!!
$qs=$_SERVER['QUERY_STRING'];
if ( $qs == "id=".$row['id']."&where=collect") {
echo "<h1>Profile > <a href=\"profile.php?id=".$id."\">".$name."</a> > Collecting</h1><center>";
$select=mysqli_query($connect, "SELECT * FROM `cards` ORDER BY `filename` ASC");
while($row2=mysqli_fetch_assoc($select)) {
$filename=$row2['filename'];
$deckname=$row2['deckname'];
$cardcount=$row2['count'];
$count=substr_count($collecting, $filename);
$num=rand(1, $cardcount);
$n=sprintf('%02d', $num);
if($count!=0) {
echo "<a href=\"profile.php?id=".$id."&where=collect&deck=".$filename."\"><img src=\"".$cardurl.$filename.$n.".png\"></a>";
}
}
echo "</center>";
}
$deck=$_GET['deck'];
if ( $qs == "id=".$row['id']."&where=collect&deck=".$deck) {
echo "This is the ".$deck." page";
}