| Новости | FAQ | Авторы | Документация | В действии | Библиотека |
| Инструменты | Полезные ссылки | Хостинги | Скачать | Примеры | Форум |
osatuk 07.03.2006 14:59 / 07.03.2006 15:00
Ну вот мой пример.CREATE TABLE `spam1` ( `id` int(11) NOT NULL auto_increment, `period` varchar(255) NOT NULL default '', `num` int(11) NOT NULL default '0', PRIMARY KEY (`id`) ) ENGINE=MyISAM DEFAULT CHARSET=cp1251 ; INSERT INTO `spam1` (`id`, `period`, `num`) VALUES (1, 'Восемьсот', 8), (2, 'Пятьсот', 5), (3, 'Сто', 1), (4, 'Триста', 3), (5, 'Двести', 2), (6, 'Девятьсот', 9), (7, 'Четыреста', 4), (8, 'Семьсот', 7), (9, 'Шестьсот', 6);Форма:
^while($id1 == 0){$id1[^math:random(8)]}
^while($id2 == 0){$id2[^math:random(8)]}
^while($id3 == 0){$id3[^math:random(8)]}
^while($id4 == 0){$id4[^math:random(8)]}
^while($id5 == 0){$id5[^math:random(8)]}
^while($id6 == 0){$id6[^math:random(8)]}
^while($id7 == 0){$id7[^math:random(8)]}
$id[${id1}${id2}${id3}${id4}${id5}${id6}${id7}]
<form action="get.html?sent_id=$id" method="post">
<img src="/num.html?id=$id" />
<input type="text" name="period">Файлик который генерит картинку:$id[^form:id.int(0)]
^if(^id.length[] == 7){
$txt1[^connect[$SQL.connect-string]{^string:sql{select period from spam1 where id = ^id.mid(1;1)}}]
$txt2[^connect[$SQL.connect-string]{^string:sql{select period from spam2 where id = ^id.mid(3;1)}}]
$txt3[^connect[$SQL.connect-string]{^string:sql{select period from spam3 where id = ^id.mid(5;1)}}]
$sq[^image::create(200;20;0xffffff)]
^sq.font[АБВГДЕЁЖЗИЙКЛМНОПРСТУФХЦЧШЩЪЫЬЭЮЯабвгдеёжзийклмнопрстуфхцчшщъыьэюя;rusfnt.gif](4)
^sq.text(10;5)[$txt1 $txt2 $txt3]
$response:body[^sq.gif[]]
}Это файл отправляющий данные:$sent_id[^form:sent_id.int(0)]
^if(def $form:sent_id && def $form:period){
$txt1[^connect[$SQL.connect-string]{^string:sql{select num from spam1 where id = ^sent_id.mid(1;1)}}]
$txt2[^connect[$SQL.connect-string]{^string:sql{select num from spam2 where id = ^sent_id.mid(3;1)}}]
$txt3[^connect[$SQL.connect-string]{^string:sql{select num from spam3 where id = ^sent_id.mid(5;1)}}]
^if('${txt1}${txt2}${txt3}' eq $form:period){
Отправка.
}{
Спам.
}
}{
Не указан код проверки.
}