Page 1 of 1

Help - PHP output as link not working.

Posted: Tue Aug 30, 2005 8:43 am
by mhouldridge
Hi,

I have the following code which I need to link the $asset output to another page;

Code: Select all

while($row = mysql_fetch_array($sql)){ 
    // Build your formatted results here. 
    $asset=$row['asset'];
	$title=$row['title']; 
	$type=$row["type"];
	$IP=$row["IP"];
	echo '<tr><td ><font color="#000000" size="2" face="Arial, Helvetica, sans-serif">'.$asset.'</font></td>

Here is code taken from another page which works, however this does not work with the above as it is slightly different;

Code: Select all

echo "<TABLE BORDER=\"0\" table width=\"100%\">\n";
echo "<TR bgcolor=\"#cccccc\"><TD font colour=\"red\"><b>Asset</b></TD><TD><b>Title</b></TD><TD><b>Customer</b></TD><TD><b>Type</b></TD><TD><b>IP address</b></TD><TD><b>Reconciled</b></TD><TD><b>Edit</b></TD></TR>\n";
for($i = 0; $i < $numofrows; $i++) {
    $row = mysql_fetch_array($result); //get a row from our result set
	if($i % 2) {
		echo "<TR bgcolor=\"#f5f7fb\">\n";    
		} 
	else {     
		echo "<TR bgcolor=\"#e6e6fb\">\n";    
		}
 	echo "<TD><font color=\"red\"><b><a href='viewall.php?varl=".$row['asset']."'>".$row['asset']."</a></b></font></TD><TD><font size=\"2\">".$row['title']."</TD>

Please help.

Posted: Tue Aug 30, 2005 1:25 pm
by kendall
mhouldridge,

what is the error that you get? how is it not working?

Kendall

Posted: Tue Aug 30, 2005 2:51 pm
by feyd
I'll make a blind stab: rawurlencode() the varible.