Скажу сразу - совсем новичек в этом деле. Ношел небольшой урок "Форма комментариев для сайта" для Adobe Dreamweaver (http://www.wellsait.ru/form.html). Все работает нормально, но я добавил в форму вывода "Флажок" и кнопку "удалить" как мне сднлать так, чтобы сообщения выделенные флажком были удалены при нажатии на кнопку удалить. Если можно, дайте фрагменты кода и куда вставить - а дальше буду сам разбираться, как это работает. Вот код странички сформированный Adobe Dreamweaver: Код (Text): <?php require_once('Connections/DrimWiver.php'); ?> <?php require_once('Connections/DrimWiver.php'); ?> <?php require_once('Connections/DrimWiver.php'); ?> <?php if (!function_exists("GetSQLValueString")) { function GetSQLValueString($theValue, $theType, $theDefinedValue = "", $theNotDefinedValue = "") { if (PHP_VERSION < 6) { $theValue = get_magic_quotes_gpc() ? stripslashes($theValue) : $theValue; } $theValue = function_exists("mysql_real_escape_string") ? mysql_real_escape_string($theValue) : mysql_escape_string($theValue); switch ($theType) { case "text": $theValue = ($theValue != "") ? "'" . $theValue . "'" : "NULL"; break; case "long": case "int": $theValue = ($theValue != "") ? intval($theValue) : "NULL"; break; case "double": $theValue = ($theValue != "") ? doubleval($theValue) : "NULL"; break; case "date": $theValue = ($theValue != "") ? "'" . $theValue . "'" : "NULL"; break; case "defined": $theValue = ($theValue != "") ? $theDefinedValue : $theNotDefinedValue; break; } return $theValue; } } if (!function_exists("GetSQLValueString")) { function GetSQLValueString($theValue, $theType, $theDefinedValue = "", $theNotDefinedValue = "") { if (PHP_VERSION < 6) { $theValue = get_magic_quotes_gpc() ? stripslashes($theValue) : $theValue; } $theValue = function_exists("mysql_real_escape_string") ? mysql_real_escape_string($theValue) : mysql_escape_string($theValue); switch ($theType) { case "text": $theValue = ($theValue != "") ? "'" . $theValue . "'" : "NULL"; break; case "long": case "int": $theValue = ($theValue != "") ? intval($theValue) : "NULL"; break; case "double": $theValue = ($theValue != "") ? doubleval($theValue) : "NULL"; break; case "date": $theValue = ($theValue != "") ? "'" . $theValue . "'" : "NULL"; break; case "defined": $theValue = ($theValue != "") ? $theDefinedValue : $theNotDefinedValue; break; } return $theValue; } } $editFormAction = $_SERVER['PHP_SELF']; if (isset($_SERVER['QUERY_STRING'])) { $editFormAction .= "?" . htmlentities($_SERVER['QUERY_STRING']); } if ((isset($_POST["MM_insert"])) && ($_POST["MM_insert"] == "form1")) { $insertSQL = sprintf("INSERT INTO tabl01 (name, mail, tel, message) VALUES (%s, %s, %s, %s)", GetSQLValueString($_POST['name'], "text"), GetSQLValueString($_POST['mail'], "text"), GetSQLValueString($_POST['tel'], "text"), GetSQLValueString($_POST['massage'], "text")); mysql_select_db($database_DrimWiver, $DrimWiver); $Result1 = mysql_query($insertSQL, $DrimWiver) or die(mysql_error()); $insertGoTo = "massage.php"; if (isset($_SERVER['QUERY_STRING'])) { $insertGoTo .= (strpos($insertGoTo, '?')) ? "&" : "?"; $insertGoTo .= $_SERVER['QUERY_STRING']; } header(sprintf("Location: %s", $insertGoTo)); } mysql_select_db($database_DrimWiver, $DrimWiver); $query_Recordset1 = "SELECT * FROM tabl01"; $Recordset1 = mysql_query($query_Recordset1, $DrimWiver) or die(mysql_error()); $row_Recordset1 = mysql_fetch_assoc($Recordset1); $totalRows_Recordset1 = mysql_num_rows($Recordset1); ?> <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> <html xmlns="http://www.w3.org/1999/xhtml"> <head> <meta http-equiv="Content-Type" content="text/html; charset=utf-8" /> <title>Документ без названия</title> <link href="CSS/forma otpravki.css" rel="stylesheet" type="text/css" /> </head> <body> <form id="form1" name="form1" method="POST" action="<?php echo $editFormAction; ?>"> <p> <input name="name" type="text" class="text_pole" id="name" value="Имя"/> </p> <p> <input name="tel" type="text" class="text_pole" id="tel" value="Телефон"/> </p> <p> <input name="mail" type="text" class="text_pole" id="mail" value="E-Mail"/> </p> <p> <textarea name="massage" class="text_pole" id="massage">Сообщение</textarea> </p> <p> <input name="send" type="submit" class="text_pole" id="send" value="Отправить" /> <input type="reset" name="Delit" id="Delit" value="Очистить" /> </p> <p> </p> <input type="hidden" name="MM_insert" value="form1" /> </form> <p> </p> <p> </p> <p> </p> <p> </p> <p> </p> <p> </p> <p> </p> <?php do { ?> <table width="901" border="1"> <tr> <td width="145" bgcolor="#EB92DB">№ <?php echo $row_Recordset1['id']; ?></td> <td width="251">Имя: <?php echo $row_Recordset1['name']; ?></td> <td width="193">Тел: <?php echo $row_Recordset1['tel']; ?></td> <td width="262">Почта: <?php echo $row_Recordset1['mail']; ?></td> <td width="20"><form id="form2" name="form2" method="post" action=""> <label> <input name="del" type="checkbox" id="del" /> </label> </form></td> </tr> <tr> <td>Дата: <?php echo $row_Recordset1['data']; ?></td> <td colspan="4">Сообщение: <?php echo $row_Recordset1['message']; ?></td> </tr> </table> <?php } while ($row_Recordset1 = mysql_fetch_assoc($Recordset1)); ?> <form id="form3" name="form3" method="post" action=""> <input type="submit" name="del2" id="del2" value="Удалить" /> </form> <p> </p> </body> </html> <?php mysql_free_result($Recordset1); mysql_free_result($Recordset1); ?>
А я то думал, что хуже Попова написать нельзя. Может они на его уроках учились Что это за хрень? Зачем дополнительно ф-ю вызывать... достаточно header("Location: $insertGoTo"); Зачем 2 раза mysql_free_result($Recordset1); в конце? Забей на эти уроки... Касательно твоего вопроса http://stackoverflow.com/questions/5530640/delete-multilple-marked-items
Ну пока начинаем с простого. Код создал ДримВайвер автоматически. За ссылку конечно спасибо, но для меня, как для чайника (Вчера только начал пробовать) - эта ссылка пока бесполезна. Тем более, что там все на Английском. Вот бы пару строк кода применительно к таму барахлу, что я выложил, да место, куда ентот код впихнуть - было бы чудно. Дальше бы попробовал сам разбираться, что к чему писваевается и выводится. Ну и может дадите ссылочку для Очень Чайников, на нормальные, доступно написанные уроки. Буду очень признателен. Добавлено спустя 3 минуты 22 секунды: ну ето видимо остаток кода от нескольких переделак. А что, совсем говено код формирует данная программулина?
О ужас удали его скорее и отформатируй жесткий диск, что бы и следа его не осталось Ставь нетбинс r3l0c прав. Притормаживает, но зато очень удобная среда. А что не понятного читай 3 пост.
Я хз, у меня не тормозит%), но оперативу жрать начинает безбожно если отлаживать проект с большой кучей сорцов, а так норм). В среднем метров 250 кушает просто во время кодинга.