PHP中的标记
我在php标签中使用了标签。当我运行代码时,它显示为一个链接。但它不是一个链接。这意味着链接是不可点击的PHP中的标记,php,html,Php,Html,我在php标签中使用了标签。当我运行代码时,它显示为一个链接。但它不是一个链接。这意味着链接是不可点击的 $data1 = mysql_query("SELECT * FROM image_upload INNER JOIN user_table ON image_upload.user_id=user_table.user_id WHERE flag=1 ORDER BY timestamp DESC;") or die(mysql_error()); //Puts it into a
$data1 = mysql_query("SELECT * FROM image_upload INNER JOIN user_table
ON image_upload.user_id=user_table.user_id WHERE flag=1 ORDER BY timestamp DESC;")
or die(mysql_error());
//Puts it into an array
while($info = mysql_fetch_array($data1)){
//Outputs the image and other data
echo
'<div class="test" id='.$info['ID'].'>';
echo'<div class="username"><a href="profile.php" class="but but_t" title="">'.$info['user_name'].'</a></div>';
echo'<div class="imagedisplay"><img src="uploads/'.$info['image'].'" width="230px" height=auto border="1px solid #"
-webkit-border-radius=" 20px"
-moz-border-radius= "20px"
border-radius="20px"
></div>';
echo'</div>';
}
?>
}
有人能帮我吗 您忘记关闭第11行的标记 代码 试着跟随 而$info=mysql\u fetch\u数组$data1{
echo " <div class=\"username\"><a href=\"profile.php\" class=\"button\" title=\"\">".$info['user_name']."</div>";
}这可能是由于你方报价的安排。试试这个干净的版本:
<?php
echo "<div class='username'>";
echo "<a href='profile.php' class='button' title=''>$info['user_name']</a>";
echo "</div>";
?>
回声 连接应正确关闭
'<div class="username">'.'<a href="profile.php" class="button" title="">'.$info['user_name'].'</a></div>'.
您不关闭标记关闭链接:'.$info['user_name'.'我在代码中关闭了该标记。不起作用第9行也有语法错误11@Lanka我已经更新了我的答案。第11行出现语法错误,您的答案有效。但我在另一个分区中添加了此链接。同样,它不起作用。我编辑了我的问题。请显示你的新代码,然后我将更新我的答案。是的,它可以工作。但仍然存在一个问题。它是与css。在我的css测试中,div有float:left属性。在我使用分号后,css的东西就不起作用了。
<?php
echo "<div class='username'>";
echo "<a href='profile.php' class='button' title=''>$info['user_name']</a>";
echo "</div>";
?>
'<div class="username">'.'<a href="profile.php" class="button" title="">'.$info['user_name'].'</a></div>'.