LiveInternet
LiveInternet
x
(+ )
saitstroy-lineseo
saitstroy-lineseo
saitstroy-lineseo
-
(0)
(0)
(0)
(0)
(0)
(0)
(0)
-
-
e-mail
-
(7)
:
-
(4)
cleverscript
_
-
: 19.01.2010
:
:
: 8
:
, 14 2010 . 17:17
+
, ! . , , ( ), , ( , ). , . . , , .
, , . . , . . , .
- , .
- PHP+MySQL .
, "" . . . , , - .
, . , , , - , . - .
, , . - , . .
: , . , , , , . , . , , , - .
.
1. .
9045:
, .
2. .
(index.php) :
:
Email:
:
: html
: html
, , :
:
Email:
:
:
: html
: html
3. .
, ( 2 ) spam-img, style.css. :
.spam-img {
border: 1px solid #999; /**/
margin-top:6px; /* */
: css
}: css
4. .
advanced. spam. SQL-:
ALTER TABLE `advanced` ADD `spam` INT( 5 ) NOT NULL;
: sql
UPDATE `advanced` SET `spam` = '24' WHERE `id` =1 LIMIT 1: sql
24 - , . , .
5. -.
submit.php. , , , , . :
$res=mysql_query("SELECT spam FROM ".$tbl2."",$db);
: php
$row=mysql_fetch_array($res);: php
:
$spam = trim ($_POST["spam"]);
: php
$spam = htmlspecialchars ($spam);: php
, :
: php
if (!isset($spam) or empty ($spam)) {echo "";exit ("
!
");}: php
, :
: php
if ($row["spam"] !== $spam) {echo "";exit ("
!
");}: php
$row["spam"] - , .
$spam - , .
!== - , , .
if() { } - ( - "").
empty - , 0.
!isset - ( - isset).
:
(24) , , " !".
. , , .
,
index.php - , , .
submit.php - , .
style.css - .
images/ - .
. !
:
:
14
0
14
0
0
0
0
14
0
<a href="https://www.liveinternet.ru/users/saitstroy-lineseo/post120830761/">Защита комментариев от спама</a><br/>Добрый вечер, друзья! Хотя какой он добрый. Мало того что материал, который я должен добавить в среду, публикую сейчас (проблемы с Интернетом), так ещё удалил файл, в котором хранил эту статью (она была написана заранее, и на её написание было потрачено полдня). Ну что же, не без греха. Давайте лучше переходить к хорошему. Хоть дословно я не смог восстановить то, что было написано мною ранее, но во всяком случае попытался. Итак, ранее я представил скрипт, который позволяет добавлять комментария на сайт. По нему уже было написано несколько постов. Но вот я опустил один момент, который ... <a href="https://www.liveinternet.ru/users/saitstroy-lineseo/post120830761/">Читать далее...</a>
« .
—
—
. »
:
[1] [
]
:
:
: ( )
:
URL
, ,
LiveInternet
PDA