[PHP] ID From Url

Newbie Spellweaver
Joined
Aug 19, 2008
Messages
34
Reaction score
5
Hello,
first time using this section. Would like a little help, if its not to much too ask.

I have a pretty nice site, but i'm trying to get the layout page to display the persons 'layout', and 'info' on the site. But to get their layout, I need their member ID, which is displayed as " example.profile.php?id= ", how do I get the ID # from the url, and use it in my page, for mysql?
 
Hello,
first time using this section. Would like a little help, if its not to much too ask.

I have a pretty nice site, but i'm trying to get the layout page to display the persons 'layout', and 'info' on the site. But to get their layout, I need their member ID, which is displayed as " example.profile.php?id= ", how do I get the ID # from the url, and use it in my page, for mysql?

PHP:
$id = $_GET['id'];
$query = mysql_query("select * from...'") or die(mysql_error());
			$check = mysql_num_rows($query);

The add this
PHP:
<a href ='example.profile.php?id=$id'>Text here</a>
 
@ above: As you can probebly see this guy is not really into PHP yet. So why do you suggest him to learn a FRAMEWORK of PHP before actualy learning how PHP works itself?

Also @ 2 posts above me, please alway's keep variables out of the quotes. It's better ^^
 
Last edited:
PHP:
$id = $_GET['id'];
$query = mysql_query("select * from...'") or die(mysql_error());
            $check = mysql_num_rows($query);
The add this
PHP:
<a href ='example.profile.php?id=$id'>Text here</a>

Don't expect this to work without some treatment :blink:

Some of the quotes are messed up, and no executables in the apostrophes, please.

And do you want all that info to be public? Because you can just change the id=# in the url to any user ID # to view the information.

Just a few little things that might be big issues :wink:
 
Back