fl00d
06-29-2007, 06:04 AM
Hello,
I'm trying to figure out how to make a page URL like www.example.com/index.php?page=username
With some help of another guy, I've come up with this.
$nick = "test";
$query = "SELECT * FROM members WHERE user_name = '$nick'";
$result = mysql_query($query,$db);
$row = mysql_fetch_array($result);
$userid = $row['user_id'];
Then he showed me for the link, I'd use something like this:
echo "<a href=\"index.php?page=$userid\">Asdissimo</a>";
Now the part that really confuses me is that when I press the link, he told me this comes into play
if(isset($_GET['page'])) {
your code here
}
I have no idea where the $_GET['page' comes from, or how to use it.
Can someone possibly help?
I'm trying to figure out how to make a page URL like www.example.com/index.php?page=username
With some help of another guy, I've come up with this.
$nick = "test";
$query = "SELECT * FROM members WHERE user_name = '$nick'";
$result = mysql_query($query,$db);
$row = mysql_fetch_array($result);
$userid = $row['user_id'];
Then he showed me for the link, I'd use something like this:
echo "<a href=\"index.php?page=$userid\">Asdissimo</a>";
Now the part that really confuses me is that when I press the link, he told me this comes into play
if(isset($_GET['page'])) {
your code here
}
I have no idea where the $_GET['page' comes from, or how to use it.
Can someone possibly help?