PHP programming forum. Ask questions or help people concerning PHP code. Don't understand a function? Need help implementing a class? Don't understand a class? Here is where to ask. Remember to do your homework!
Moderator: General Moderators
I3lade
Forum Commoner
Posts: 70 Joined: Wed Jun 04, 2003 4:20 pm
Post
by I3lade » Sat Jun 07, 2003 11:09 am
Ok i gotta make my link like
Code: Select all
<a href="page.php?varibale=value">here</a> but don't know what exactly to put in variable=value. Im a newbi so id appercaite your help.
I3lade
Forum Commoner
Posts: 70 Joined: Wed Jun 04, 2003 4:20 pm
Post
by I3lade » Sat Jun 07, 2003 11:17 am
Anyone please?
twigletmac
Her Royal Site Adminness
Posts: 5371 Joined: Tue Apr 23, 2002 2:21 am
Location: Essex, UK
Post
by twigletmac » Sat Jun 07, 2003 11:17 am
What information are you trying to pass in the link? The values for 'variable' and 'value' are going to be different depending on what you need to pass from one page and what needs to be received by the next page.
Mac
I3lade
Forum Commoner
Posts: 70 Joined: Wed Jun 04, 2003 4:20 pm
Post
by I3lade » Sat Jun 07, 2003 11:19 am
Its a profile code, like i want when they click it it shows that user profile. Example: They click user bob, it opens a page and shows bobs info.
redhair
Forum Contributor
Posts: 300 Joined: Fri May 30, 2003 4:36 pm
Location: 53.23N-6.57E
Contact:
Post
by redhair » Sat Jun 07, 2003 11:26 am
the profiles are in a mysql db?
I3lade
Forum Commoner
Posts: 70 Joined: Wed Jun 04, 2003 4:20 pm
Post
by I3lade » Sat Jun 07, 2003 11:27 am
Yea.... but what do i put in my link code?
twigletmac
Her Royal Site Adminness
Posts: 5371 Joined: Tue Apr 23, 2002 2:21 am
Location: Essex, UK
Post
by twigletmac » Sat Jun 07, 2003 11:31 am
Well what does the script look like that's supposed to handle the next part when a person clicks on a link? The link itself is nothing special, just a way of passing information to the script that does the actual work.
Mac
I3lade
Forum Commoner
Posts: 70 Joined: Wed Jun 04, 2003 4:20 pm
Post
by I3lade » Sat Jun 07, 2003 11:32 am
Its a Select code to select what they inserted into the datbase
twigletmac
Her Royal Site Adminness
Posts: 5371 Joined: Tue Apr 23, 2002 2:21 am
Location: Essex, UK
Post
by twigletmac » Sat Jun 07, 2003 11:33 am
Well you must have something in that code which needs to be set in order to uniquely identify that person - so pass that in the link.
Mac
I3lade
Forum Commoner
Posts: 70 Joined: Wed Jun 04, 2003 4:20 pm
Post
by I3lade » Sat Jun 07, 2003 11:34 am
yea a "id" thats the name of the feild, what would the lihnk look like?
I3lade
Forum Commoner
Posts: 70 Joined: Wed Jun 04, 2003 4:20 pm
Post
by I3lade » Sat Jun 07, 2003 11:37 am
like ummm
Code: Select all
<a href="page.php?username=id">here</a>
or something?
redhair
Forum Contributor
Posts: 300 Joined: Fri May 30, 2003 4:36 pm
Location: 53.23N-6.57E
Contact:
Post
by redhair » Sat Jun 07, 2003 11:39 am
The row_id of the user requested from the database?
Supposed you have these fields in your table
user_id, fname, lname
To get a certain user from the db, you could try:
user.php
Code: Select all
<?php
if (isset($_get['user_id']))
{$mysqlquery = "SELECT * FROM user_table WHERE user_id = "$user_id"";
$result = MYSQL_QUERY($query);
while ($row = mysql_fetch_array($result)) {
$fname = $row['fname'];
$lname = $row['lname'];
}
print "$user_id: fname $lname";
?>
Your link that calls user nr one should look like
http://you.com/user.php?user_id=1
I3lade
Forum Commoner
Posts: 70 Joined: Wed Jun 04, 2003 4:20 pm
Post
by I3lade » Sat Jun 07, 2003 11:42 am
Umm that confused me lol... i just want a code that will make it so when they click the username, it brings up thier info and to do that i need to use
Code: Select all
<a href=\"page.php?varibale=value\">here</a[*code] My row names are id, login(username)and pass what do i put in variable and value???!?
redhair
Forum Contributor
Posts: 300 Joined: Fri May 30, 2003 4:36 pm
Location: 53.23N-6.57E
Contact:
Post
by redhair » Sat Jun 07, 2003 11:45 am
I3lade wrote: what do i put in variable and value???!?
huh>?
I3lade
Forum Commoner
Posts: 70 Joined: Wed Jun 04, 2003 4:20 pm
Post
by I3lade » Sat Jun 07, 2003 11:47 am
Ugh look:
Code: Select all
<a href="page.php?varibale=value">here</a> See the variable=value in that code? what do i replace with them which row names ect?