私はPHPに比較的慣れていません。ユーザーが自分の Web サイトにあるビジネスのレビューを書けるようにしたいのですが、コードの実装方法がわかりません。以下の URL で、ユーザーがビジネスの名前をクリックして、そのビジネスのレビューを書くことができるようにしたいと考えています。私は誰かにコードを書くように頼んでいるわけではありませんが、私が求めているのはこれです。次のプロセスは何ですか? 私が持っているこのプログラムを攻撃/解決するにはどうすればよいですか。次はどうしよう……。
みんな、ありがとう。
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>