Tycoon Talk
Become a Big fish!
The number 1 forum for online business!
Post topics, ask questions, share your knowledge.
Tycoon Talk is part of Freelancer.com - find skilled workers online at a fraction of the cost.

PHP Forum


You are currently viewing our PHP Forum as a guest. Please register to participate.
Login



Freelance Jobs

Reply
help with fighting other users.
Old 07-16-2010, 05:19 PM help with fighting other users.
Novice Talker

Posts: 12
Trades: 0
ok im using $row and while to display all the users on the page. and i want to make it so there is a link for each user that if you click it, it will have you go to a new page with only that users states and info is displays.

Here is the code i have for the users page.

PHP Code:
<?
$userlist 
mysql_query("SELECT * FROM users");
echo 
'<table border="1" width=100%>
<tr>
<th width="50">Picture</th>
<th width="50">ID#</th>
<th>Username</th>
<th>LVL</th>
<th>Rank</th>
<th width="100"><center>Click to Fight.</center></th>
</tr>'
;
while(
$row mysql_fetch_array($userlist))
  {
  echo 
"<tr>";
  echo 
'<td width="50"><center><img width="50" height="50" src="' $row['pictures'] .'"/></center> </td>';
  echo 
'<td width="50"><center>' $row['id'] . "</center></td>";
  echo 
"<td><center>" $row['username'] . "</center></td>";
  echo 
"<td><center>" $row['lvl'] . "</center></td>";
  echo 
"<td><center>" $row['rank'] . "</center></td>";
  echo 
'<td width="100"><center><a href="index.php?page=fightpage">Fight <br/>'.$row['username'].'</a></center></td>';
 
 
  echo 
"</tr>";
  }
echo 
"</table>";
 
?>
xwhitchx is offline
Reply With Quote
View Public Profile
 
 
Register now for full access!
Old 07-16-2010, 10:58 PM Re: help with fighting other users.
vangogh's Avatar
Post Impressionist

Latest Blog Post:
Why Responsive Design?
Posts: 10,815
Name: Steven Bradley
Location: Boulder, Colorado
Trades: 0
You'll probably want to wrap a link around the username

Code:
echo "<td><center><a href='" . database-value-here . "'>" . $row['username'] . "</a></center></td>";
You'll have to replace database-value-here with the url for each user that you'd grab from the database. I'm assuming that information is stored somewhere in the database.
__________________
l Search Engine Friendly Web Design |
Please login or register to view this content. Registration is FREE

l Tips On Marketing, SEO, Design, and Development |
Please login or register to view this content. Registration is FREE

l
Please login or register to view this content. Registration is FREE
|
Please login or register to view this content. Registration is FREE
vangogh is offline
Reply With Quote
View Public Profile Visit vangogh's homepage!
 
Old 07-21-2010, 10:58 AM Re: help with fighting other users.
Registered User

Posts: 86
Name: John Dacu
Trades: 0
the link that vangogh talked about shoud have an unique parameter (like id or username) that will be send like a get var. The simplest format is something like this:
http:// domain.com/user.php?username=doubleweb. In your user.php file you perform a select query and get only that user row. The link could be seo friendly as well as long as the variable is sent to user.php
johnny.dacu is offline
Reply With Quote
View Public Profile
 
Reply     « Reply to help with fighting other users.
 

Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are Off
Pingbacks are Off
Refbacks are Off





   
RSS Feed  Feeds: RSS   JS   XML
RSS Feed  Feeds for this forum: RSS   JS   XML



Page generated in 0.46554 seconds with 12 queries