現在我有一個網格和每個網格部分/位包含圖像,項目的名稱和不同的按鈕,可以從mysql數據庫中刪除項目並更新價格。我想要知道的是,當用戶說點擊圖像時,會彈出一個窗口來顯示額外的信息。然而,它通常不會彈出,它會創建另一個窗口,而是在當前窗口/選項卡中彈出。例如。當您按下Facebook上的照片時,它會創建一個類似彈出窗口的圖片,您可以在該圖片上發表評論或更改爲下一張照片。有沒有人有任何想法如何做到這一點,或至少什麼是整個事情/過程稱爲?彈出窗口內
很抱歉,如果我不能給一個合適的名字,但我不知道它自己:/
這裏是代碼我現在有。我更喜歡實際的代碼解決方案,但如果你能把我帶到我應該尋找的地方,我也會很開心。我嘗試在網上尋找,但是我得到的一切都是窗口彈出窗口。
<div class="boxes">
<?php
$ID = $_SESSION['SESS_MEMBER_ID'];
$con = mysql_connect("", "", "");
if (!$con){
die("Cannot connect: " . mysql_error());
}
mysql_select_db("test", $con);
$sql = "SELECT * FROM items WHERE member_id = $ID";
$myData = mysql_query($sql, $con);
$dir = 'Images';
$symbol = '\\';
$end = 'r.jpg';
$currency = '£';
while($record = mysql_fetch_array($myData)) {
$real_name = str_replace('_', ' ', $record['Name']);
$result = $dir . $symbol . $record['Name'] . $end;
$value = $currency . $record['price_now'];
$link = $record['url'];
echo "<div class = frame>";
echo "<div class = bit-3>";
echo "<div class = box>" . "<img src=" . $result . " alt=some_text>";
echo "<br />";
echo "<br />";
echo $real_name;
echo "<br />";
echo "<br />";
echo "Price now: " . $value;
echo "<form action = member-profile-page.php method = post>";
echo "Desired price: ";
echo "<td>" . "<input type = text name = desired_price value = " . $record['desired_price'] . " </td>";
echo "<td>" . "<input type = hidden name = hidden value = " . $record['Id'] . " </td>";
echo " ";
echo "<td>" . "<input type = submit name = update value = Update" . " </td>";
echo "<br />";
echo "<br />";
echo "<td>" . "<input type = submit name = delete value = Delete" . " </td>";
echo "<br />";
echo "<br />";
echo "<td>" . "<input type = submit name = buy value = Buy" . " </td>";
echo "</form>";
echo "</div>";
echo "</div>";
echo "</div>";
}
if (isset($_POST['buy'])){
$query = "select url from items where Id = '$_POST[hidden]'";
if ($result = mysql_query($query)) {
$row = mysql_fetch_assoc($result);
$code = $row['url'];
echo "$code";
header("Location: $code");
}
};
if (isset($_POST['update'])){
$UpdateQuery = "UPDATE items SET desired_price = '$_POST[desired_price]' WHERE Id = '$_POST[hidden]'";
mysql_query($UpdateQuery, $con);
};
if (isset($_POST['delete'])){
$DeleteQuery = "DELETE FROM items WHERE Id = '$_POST[hidden]'";
mysql_query($DeleteQuery, $con);
};
mysql_close($con);
?>
</div>
這是唯一可能與js。沒有辦法的PHP! – artur99
並且請更改您的個人資料圖片,否則您將被禁止! – artur99
供參考:我們已經有一些關於您的個人資料圖片的投訴。雖然您可以自由表達自己的理由,但請記住,這是專業人士的網站,請保留適合這種情況的圖像。 – Shog9