由于某种原因,我的PHP正在将页面URL添加到我的链接中.
应该具有值的链接#出来mysite.com/url_the_page/page.php#并想出会导致这种情况的原因是什么?
echo'<a href="#" id="bb">click me</a></span>';
echo '<a href="#" id="song_'. $row[id].'">';
echo $artist_title;
echo '</a></span>';`
Run Code Online (Sandbox Code Playgroud)
完整代码:
while ($row = mysql_fetch_array($query))
{
if ($row[sourcefile] !== NULL )
{
echo '';
if ( $row[artist] !== NULL && $row[title] !== NULL)
{
$artist_title = $row[artist] . ' - ' . $row[title];
}
else
{
$artist_title = $row[originalfilename];
}
echo "<a href=http://".$row[link].' target="_blank">LINK</a> - ';
if ( $row[listened] == 0)
{
$link_class = "unlistened";
}
else
{
$link_class = "listened";
}
$size = $row[size];
$size = round(($size / 1000000),2);
if ( $size > 30 )
{
echo '<font color="red">MIX </font>';
}
echo '<span id="'.$row[id].'" class="'.$link_class.'">';
echo '<a href="#" id="song_'. $row[id].'">';
echo $artist_title;
echo '</a></span>';
echo ' - ';
//turn size into MB
$size = $row[size];
$size = round(($size / 1000000),2);
//if the song is smaller than a certain size display the size as red.
if ( $row[size] < 1500000)
{
echo '<font color="red">';
echo $size;
echo '</font>';
}
else
{
//echo $row[size];
echo $size;
}
echo 'MB<br>';
}
}
Run Code Online (Sandbox Code Playgroud)