Can you display variable within a href="$variable"
Posted: Tue Feb 17, 2004 5:59 pm
Im getting 'Parse error: parse error, expecting `','' or `';'' in /www/n/naild/htdocs/localmm/modules/Bands_Showcase/index.php on line 36' And its because i put a variable inside a link. How could i do this? Heres my code: (I would also like to know how to list code in these forums with the highlited colors like i see here and there)
Code: Select all
<?
$query="SELECT * FROM nuke_bands";
$result=mysql_query($query);
$num=mysql_numrows($result);
mysql_close();
$i=0;
while ($i < $num) {
$bandname=mysql_result($result,$i,"band_name");
$description=mysql_result($result,$i,"description");
$history=mysql_result($result,$i,"history");
$influences=mysql_result($result,$i,"influences");
$genra=mysql_result($result,$i,"genra");
$email=mysql_result($result,$i,"email");
$website=mysql_result($result,$i,"website");
?>
<br>Click  <a href="modules.php?name=Bands_Showcase&file=form">HERE</a>  to submit a band, upload your mp3 and image.<br>
<br>
<?
echo "<b>$bandname</b><br><br><b>Description:</b> $description<br><br><b>History:</b> $history<br><br><b>Influences:</b> $influences<br><br><b>E-mail:</b> $email<br><br><b>Website:</b> <a href="$website">$website</a><br><br><hr><br>";
++$i;
}
?>