CodingForums.com

CodingForums.com (http://www.codingforums.com/index.php)
-   Post a PHP snippet (http://www.codingforums.com/forumdisplay.php?f=41)
-   -   Passing Variables In a Hyperlink or Alt or Title ect. (http://www.codingforums.com/showthread.php?t=268745)

connormcwood 07-25-2012 12:32 PM

Passing Variables In a Hyperlink or Alt or Title ect.
 
I've seen a few threads pop up in the support area of the php Section about
parcsing Variables In a Hyperlink, Alt, or Title. I am going to give you all a working code snippet which is used within my game I am Currently Making.

PHP Code:

$table "SELECT * FROM users";
$test mysql_query($table); 

echo 
"<table><tr><th>Username</th>";
echo 
"<th> </th>";
echo 
"<th>Created</th>";
echo 
"<th>Infastructure</th>";
echo 
"<th>Statename</th>";
echo 
"<th>Money</th></tr>";
while (
$row mysql_fetch_array($test)) { 
 echo 
'<tr><td><a href="profile.php?user='
    
$row['username'] . '">'
    
$row['username'] . '</a></td><td>
    <a href="sendmessage.php?user='
    
$row['username'] . '"><img src="images/messageicon.png" alt='
    
$row['username'] . '</img></a></td><td>'
    
    
$row['dayregistered'] . '</a></td><td>'
    
$row['infrastructure'] .  '</td><td> '
    
$row['statename'] .  '</td><td> $'
    
$row['money'] . '</td></tr>';
    
 }
echo 
"</table>"



All times are GMT +1. The time now is 03:46 PM.

Powered by vBulletin®
Copyright ©2000 - 2013, Jelsoft Enterprises Ltd.