說我有代碼級的標籤做工精細:如何將CSS類應用於上傳的圖像?
<img src="img/group2.jpg" class="findface" />
現在,當我通過給定的代碼上傳文件並顯示它:
<?php
$target_path = "./";
$target_path = $target_path . basename($_FILES['uploadedfile']['name']);
if(move_uploaded_file($_FILES['uploadedfile']['tmp_name'], $target_path)){
echo'<img src="'.$target_path.'" />';
}
?>
<body>
<form enctype="multipart/form-data" action="<?php $_PHP_SELF ?>" method="POST">
<input type="hidden" name="file" value="upload file" />
Choose a file to upload: <input name="uploadedfile" type="file" /><br />
<input type="submit" value="Upload File" />
</form>
</body>
這是正常顯示,但不應用類,當我嘗試下面的代碼顯示errors.Any解決方案?請help.So我可以應用上傳的每個圖像的類代碼以及在瀏覽器中顯示文件。
echo'<img src="'.$target_path.'" /> class="findface";
爲什麼收盤外面的課嗎? /> class =「findface」你的意思是class =「findface」/> – 2014-09-21 15:15:10