我對PHP比較陌生。我想讓用戶能夠撰寫位於我網站上的企業評論,但我不確定如何實施代碼。在下面的URL中,我希望我的用戶點擊業務名稱並能夠撰寫對此類業務的評論。我沒有要求任何人爲我編寫代碼,但我問的是,下一個過程是什麼?我如何攻擊/解決我遇到的這個程序。我該怎麼辦下一....顧客評論回顧?在PHP
謝謝大家。
http://whatsmyowncarworth.com/practiceTemplate/practice1/33/loans/table3.php
<?php
include('init.php');
/*$sql = "SELECT * FROM cars WHERE id='1' ORDER BY year ASC";*/
$sql = "SELECT * FROM dealers";
if ($result = mysql_query($sql)) {
echo "<table border='1'>";
echo "<tr> <th>Name</th> <th>Address</th> <th>State</th> <th>City</th> <th>Website</th> ";
// keeps getting the next row until there are no more to get
while ($row = mysql_fetch_array($result)){
$name = $row['name'];
$address = $row['address'];
$state = $row['state'];
$city = $row['city'];
$website = $row['website'];
$maps = $row['maps'];
$lat = $row['lat'];
$lng = $row['lng'];
echo("\t<tr>\n");
echo("\t\t<td>" . "<a href='http://$website' target = '_blank'>" . "$name" . "</a></td>\n");
echo("\t\t<td>" . "$address" . "</td>\n");
echo("\t\t<td>" . "$state" . "</td>\n");
echo("\t\t<td>" . "$city" . "</td>\n");
echo("\t\t<td>" . "<a href='http://$website' target = '_blank'>" . "$name" . "</a></td>\n");
/*echo("\t\t<td>" . "<a href='http://$website' target = '_blank'>" . "$name" . "</a></td>\n");
echo("\t\t<td>" . "<a href='http://$maps' target = '_blank'>" . "$address" . "</td>\n");
echo("\t\t<td>" . "<a href='http://$maps' target = '_blank'>" . "$address" . "</td>\n");
echo("\t\t<td>" . "$state" . "</td>\n");
echo("\t\t<td>" . "$city" . "</td>\n");
echo ("\t\t<td>" . "<a href='http://$website' target = '_blank'>" . "$website" . "</a></td>\n");
echo("\t\t<td>" . "$maps" . "</td>\n");
echo("\t\t<td>" . "$lat" . "</td>\n");
echo("\t\t<td>" . "$lng" . "</td>\n");*/
// Print out the contents of each row into a table
}
echo "</table>";
}
else {
trigger_error(mysql_error()); // for development only; remove when in production
}
?>
<html>
<head>
<title>Untitled Document</title>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
</head>
<body bgcolor="#FFFFFF" text="#000000">
</body>
</html>
歡迎來到Stack Overflow!看起來你只是開始你的項目,所以我會尋找一些教程,以獲得更詳細的分步指南,以瞭解如何繼續,然後在遇到更具體的問題時回到這裏。 –
首先你有你的PHP的echo表的HTML開放標籤之前的瀏覽器...建議開始閱讀關於HTML頁面結構(HTML /頭/ body標籤),以及如何將它與PHP結合 –