Antichat снова доступен.
Форум Antichat (Античат) возвращается и снова открыт для пользователей.
Здесь обсуждаются безопасность, программирование, технологии и многое другое.
Сообщество снова собирается вместе.
Новый адрес: forum.antichat.xyz
 |
|

25.07.2008, 01:59
|
|
Новичок
Регистрация: 05.01.2007
Сообщений: 9
Провел на форуме: 63718
Репутация:
2
|
|
привет -)
еше раз доброе время суток=) помогите а??-)
PHP код:
<?php
### change this
$send_to_email = "jkh@kdjfblalalal";
$send_from_email = "forma2istics.com";
$email_subject = "New website registration";
$success_page = "success.html";
$failure_page = "failure.html";
##########
function send_mail($from, $to, $subject, $message)
{
return mail($to, $subject, $message,
"From: {$from}rn" .
"Reply-To: {$from}rn" .
"X-Mailer: PHP/" . phpversion());
}
if ($_POST['action'] == "contact")
{
$Your_full_name = $_POST['Your_full_name'];
$Contact_phone = $_POST['Contact_phone'];
$Name_of_your_company = $_POST['Name_of_your_company'];
$Email = $_POST['Email'];
$Shipment_station = $_POST['Shipment_station'];
$Destination_station = $_POST['Destination_station'];
$Description_of_cargo_TNVED_code = $_POST['Description_of_cargo_TNVED_code'];
$Shipment_mode = $_POST['Shipment_mode'];
$Rail_car_type = $_POST['Rail_car_type'];
$Car_loading = $_POST['Car_loading'];
$Affiliation_of_car_or_container = $_POST['Affiliation_of_car_or_container'];
$Volume_of_shipment = $_POST['Volume_of_shipment'];
$Kind_of_packing = $_POST['Kind_of_packing'];
$Container_type_size_of_pallet_or_case = $_POST['Container_type_size_of_pallet_or_case'];
$Weight_of_1_piece = $_POST['Weight_of_1_piece'];
$Your_additional_information = $_POST['Your_additional_information'];
$message = "Contact details:\nYour_full_name: $Your_full_name\nContact_phone: $Contact_phone\nName_of_your_company: $Name_of_your_company\nEmail: $Email\nShipment_station: $Shipment_station\nDestination_station: $Destination_station\nDescription_of_cargo_TNVED_code: $Description_of_cargo_TNVED_code\nShipment_mode: $Shipment_mode\nRail_car_type: $Rail_car_type\nCar_loading: $Car_loading\nAffiliation_of_car_or_container: $Affiliation_of_car_or_container\nVolume_of_shipment: $Volume_of_shipment\nKind_of_packing : $Kind_of_packing \nContainer_type_size_of_pallet_or_case: $Container_type_size_of_pallet_or_case\nWeight_of_1_piece: $Weight_of_1_piece\nYour_additional_information: $Your_additional_information\nn";
$result = send_mail($send_from_email, $send_to_email, $mail_subject, $message);
if ($result)
{
header('Location: '.$success_page);
}
else
{
header('Location: '.$failure_page);
}
}
?>
наешл капчу , а то спам приходит тонами
PHP код:
<?
session_start();
session_register("secret_number");
if (intval($_SESSION["secret_number"])<1000) {
srand(doubleval(microtime()));
$_SESSION["secret_number"]=rand(1000,9999);
}
if ($_SERVER["REQUEST_METHOD"]=="POST") {
$error=0;
if ($_POST["secretcode"]!=$_SESSION["secret_number"] || intval($_POST["secretcode"])==0) $error=1;
if ($error==0) {
$_SESSION["secret_number"]=rand(1000,9999);
// Выполняем необходимые действия с данными
// ..
print "Hello ".htmlspecialchars(StripSlashes($_POST["email"]));
exit;
}
if ($error==1) print "<font color=red>Число с картинки введено неверно</font>";
}
// Выводим форму повторно
// ...
?>
<form action="index.php" method="post">
Ваш E-Mail:<br>
<input type="text" name="email" value=""><br>
<br>
Введите код, который вы видете на картинке:<br>
<input type="text" name="secretcode" value=""><br>
<img src='code.php?<?=doubleval(microtime());?>' width=101 height=26 vspace=5>
<br><br>
<input type="submit">
</form>
PHP код:
?
// Регистрируем переменную
session_start();
session_register("secret_number");
function mt() {
list($usec, $sec) = explode(' ', microtime());
return (float) $sec + ((float) $usec * 100000);
}
header("Content-type: image/png");
// создаем изображение
$im=imagecreate(101, 26);
// Выделяем цвет фона (белый)
$w=imagecolorallocate($im, 255, 255, 255);
// Выделяем цвет для фона (светло-серый)
$g1=imagecolorallocate($im, 192, 192, 192);
// Выделяем цвет для более темных помех (темно-серый)
$g2=imagecolorallocate($im, 64,64,64);
// Выделяем четыре случайных темных цвета для символов
$cl1=imagecolorallocate($im,rand(0,128),rand(0,128),rand(0,128));
$cl2=imagecolorallocate($im,rand(0,128),rand(0,128),rand(0,128));
$cl3=imagecolorallocate($im,rand(0,128),rand(0,128),rand(0,128));
$cl4=imagecolorallocate($im,rand(0,128),rand(0,128),rand(0,128));
// Рисуем сетку
for ($i=0;$i<=100;$i+=5) imageline($im,$i,0,$i,25,$g1);
for ($i=0;$i<=25;$i+=5) imageline($im,0,$i,100,$i,$g1);
// Выводим каждую цифру по отдельности, немного смещая случайным образом
imagestring($im, 5, 0+rand(0,10), 5+rand(-5,5), substr($_SESSION["secret_number"],0,1), $cl1);
imagestring($im, 5, 25+rand(-10,10), 5+rand(-5,5), substr($_SESSION["secret_number"],1,1), $cl2);
imagestring($im, 5, 50+rand(-10,10), 5+rand(-5,5), substr($_SESSION["secret_number"],2,1), $cl3);
imagestring($im, 5, 75+rand(-10,10), 5+rand(-5,5), substr($_SESSION["secret_number"],3,1), $cl4);
// Выводим пару случайных линий тесного цвета, прямо поверх символов.
// Для увеличения количества линий можно увеличить,
// изменив число выделенное красным цветом
for ($i=0;$i<8;$i++) imageline($im,rand(0,100),rand(0,25),rand(0,100),rand(0,25),$g2);
// Коэфициент увеличения/уменьшения картинки
$k=1.7;
// Создаем новое изображение, увеличенного размера
$im1=imagecreatetruecolor(101*$k,26*$k);
// Копируем изображение с изменением рамеров в большую сторону
imagecopyresized($im1, $im, 0, 0, 0, 0, 101*$k, 26*$k, 101, 26);
// Создаем новое изображение, нормального размера
$im2=imagecreatetruecolor(101,26);
а вот сама как бы страничка
Код HTML:
<html>
<head>
<title></title>
<link rel="SHORTCUT ICON" href="">
<meta name="description" content="">
<meta name="keywords" content="">
<meta name="ROBOTS" content="index, follow">
<meta name="REVISIT-AFTER" content="7 days">
<meta name="COPYRIGHT" content="">
<meta name="AUTHOR" content="">
<LINK rel="STYLESHEET" href="styles.css">
</head>
<BODY align="center" topmargin="0" leftmargin="0" marginwidth="0" marginheight="0" style="background-color: #ffffff;">
<center>
<table width=968 height=117 border="0" cellspacing="0" cellpadding="0">
<tr>
<td width=242 valign=top class="t1">
</td>
<td width=484 valign=top class="t2">
<table width=400 height=92 border="0" cellspacing="0" cellpadding="0">
<tr>
<td width=400 align=right valign=top >
<a href=""><img src="img/home.gif" border=0></a><img src="img/p1.gif" border=0><a href=""><img src="img/mail.gif" border=0></a>
</td>
</tr>
</table>
<a style="color: #06018f; font-size: 13px; font-family: Arial;"><b>FORWARDING, <b></a>
<a style="color: #336691; font-size: 13px; font-family: Arial;"><b>CHARTERING, <b></a>
<a style="color: #3b60c8; font-size: 13px; font-family: Arial;"><b>CUSTOMS SERVICES<b></a>
</td>
<td width=242 valign=top class="t4">
</td>
</tr>
</table>
<table width=968 height=117 border="0" cellspacing="0" cellpadding="0">
<tr>
<td width=242 valign=top class="t5">
</td>
<td width=484 valign=top align=left class="t6">
<a style="padding-left:80px; color: #000000; font-size: 25px; font-family: Arial;"><b>tel:+380 4841 48446 </a> </td>
<td width=242 valign=top class="t8" >
</td>
</tr>
</table>
<table width=970 height=9 border="0" cellspacing="0" cellpadding="0" >
<tr>
<td width=970 height=9 valign=top style="background-image: url('img/per.gif');">
</td>
</tr>
</table>
</head>
<body>
<h3> <strong>Форма заявки для расчета провозных платежей и стоимости экспедирования на ж/дорожном транспорте </strong> </h1>
<form method="post" action="send_details.php">
<input type="hidden" name="action" value="contact" />
<table width="98%">
<tr>
<td width="62%" height="37">Ваши полные ФИО:</td>
<td width="38%"><input type="text" size="100" name="Your_full_name" value="" /></td>
</tr>
<tr>
<td height="37">Контактный телефон, с кодом города:</td>
<td><input type="text" size="100" name="Contact_phone" value="" /></td></tr>
<tr>
<td height="46">Название Вашей организации:</td>
<td><input type="text" size="100" name="Name_of_your_company" value="" /></td></tr>
<tr>
<td height="48">E-mail:</td>
<td><input type="text"size="100" name="Email" value="" /></td></tr>
<tr>
<td height="60"> Станция отправления:</td>
<td><input type="text" size="100" name="Shipment_station" value="" /></td></tr>
<tr>
<td height="40"> Станция назначения:</td>
<td><input type="text"size="100" name="Destination_station" value="" /></td></tr>
<tr>
<td height="44">Наименование груза, коды ЕТСНГ и ГНГ:</td>
<td><input type="text" size="100" name="Description_of_cargo_TNVED_code" value="" /></td></tr>
<tr>
<tr>
<td height="34"> Род вагона:</td>
<td><input type="text"size="100" name="Rail_car_type" value="" /></td></tr>
<tr>
<td height="35"> Загрузка вагона:</td>
<td><input type="text"size="100" name="Car_loading" value="" /></td></tr>
<tr>
<td height="43"> Принадлежность вагона или контейнера (парк МПС, собственный, арендованный):</td>
<td><input type="text"size="100" name="Affiliation_of_car_or_container" value="" /></td></tr>
<tr>
<td height="47"> Объём отправляемой партии (тн или м3 или кол-во мест):</td>
<td><input type="text"size="100" name="Volume_of_shipment"value="" /></td></tr>
<tr>
<td height="50"> Вид упаковки (навалом, паллеты, тюки, биг-бэги, ящики, контейнеры):</td>
<td><input type="text"size="100" name="Kind_of_packing" value="" /></td></tr>
<tr>
<td height="57"> Вид контейнера, размеры паллета или ящика, объём тюка или биг-бэга:</td>
<td><input type="text"size="100" name="Container_type_size_of_pallet_or_case" value="" /></td></tr>
<tr>
<td height="44"> Вес одного места:</td>
<td><input type="text"size="100" name="Weight_of_1_piece" value="" /></td></tr>
<tr>
<td height="63"><p>Ваша дополнительная информация:
(для специальных и негаборитных грузов предоставить чертижы,эскизы с указанием габаритных размеров,либо указать степень негабаритности груза, предлогаемые сроки отправки груза, а также объём грузовой партии и т.д):</p>
<p> </p>
<p>: </p></td>
<td><textarea rows="6" name="Your_additional_information" cols="97"></textarea></td>
</tr>
<tr>
<center><td height="109" colspan="2"><input name="submit" type="submit" value="Send" /></td>
</tr>
</table>
</form>
<tr>
<table width=970 height=76 border="0" cellspacing="0" cellpadding="0" >
<tr>
<td width=970 height=76 valign=top style="background-image: url('img/bot.gif');">
<table width=970 height=76 border="0" cellspacing="0" cellpadding="0" >
<tr>
<td width=6 height=76 valign=top style="background-image: url('img/p2.gif');"> </td>
<td width=964 height=76 valign=top style="padding-left:5px; padding-top: 5px;"><div align="center">Danompany LTD <br>
P.O.Box # 124, Centre 35,Dzerzinskogo str.l,68600,Ukraine<br>
<a href="mailto:dlet.ua"> E-mai det.ua</a><br>
tel:+380 4841 446 <br>
mob.tel: +380528 <br>
</div></td>
</tr>
</table>
</td>
</tr>
</table>
</BODY>
</html>
я не могу понять как это все дела слепить в одно что б на странички была капча и при пральном воде капче отсылалсь на мыло -) не пинайте сильно сам знаю что туплю =)
|
|
|

25.07.2008, 12:30
|
|
Познающий
Регистрация: 20.01.2007
Сообщений: 55
Провел на форуме: 212579
Репутация:
20
|
|
Я в этом деле новичок, мягко сказано
Не могу понять кое что.
После этого небольшого вложения в php файлик
На страничке в ряд должно вывестись из БД
Три новости в виде:
- титульного с сылкой на полный просмотр
- датой
- небольшое описание
- автором
PHP код:
<?php
$result = mysql_query ("SELECT id,title,date,description,author FROM lessons",$db);
$myrow = mysql_fetch_array ($result);
do {
printf ("<table align='center' class='lesson'>
<tr>
<td class='lesson_title'><p><a href='view_lesson.php=%s'>%s</a></p><p>%s</p><p>Дата добавления: %s</p>
</td></tr>
<p>Автор: %s</p>
<tr><td>%s</td>
</table></tr><br>", $myrow["id"],$myrow["title"],$myrow["date"],$myrow["author"],$myrow["description"]);
}
while ($myrow = mysql_fetch_array ($result));
?>
Вместо этого на страничке вылетает:
Warning: printf(): Too few arguments in w:\home\localhost\www\phpsite\lessons.php on line 46
Warning: printf(): Too few arguments in w:\home\localhost\www\phpsite\lessons.php on line 46
Warning: printf(): Too few arguments in w:\home\localhost\www\phpsite\lessons.php on line 46
46-ая строчка - это:
Код:
</table></tr><br>", $myrow["id"],$myrow["title"],$myrow["date"],$myrow["author"],$myrow["description"]);
Не могу понять, в чем проблема ...
Помогите пожалуйста советом ...
Сенк, за внимание... (
|
|
|

25.07.2008, 13:02
|
|
Участник форума
Регистрация: 05.04.2007
Сообщений: 150
Провел на форуме: 771228
Репутация:
77
|
|
6 мест вывода в строке и 5 переменных = 1 нехватает , либо убери в строке либо добавь в этот список еще 1 $myrow["id"],$myrow["title"],$myrow["date"],$myrow["author"],$myrow["description"]
|
|
|

25.07.2008, 13:10
|
|
Познающий
Регистрация: 20.01.2007
Сообщений: 55
Провел на форуме: 212579
Репутация:
20
|
|
5triker сенк!
|
|
|

25.07.2008, 15:07
|
|
Участник форума
Регистрация: 11.05.2008
Сообщений: 202
Провел на форуме: 420713
Репутация:
104
|
|
Помогите понять что делаю не так
мне надо разбить на карманы .
$html = ' <table width="100%" border="0">
<tr>
<th rowspan="5" scope="row"><img src=components/com_userstat/3_m.gif width="100" height="100" /></th>
<th scope="row"><div align="right"><strong>Name:</strong></div></th>
<td>Lotto</td>
</tr>
<tr>
<th scope="row"><div align="right"><strong>Profession:</strong></div></th>
<td>Archer</td>
</tr>
<tr>
<th scope="row"><div align="right"><strong>Base lvl: </strong></div></th>
<td>40</td>
</tr>
<tr>
<th scope="row"><div align="right"><strong>Job lvl:</strong> </div></th>
<td>27</td>
</tr>
<tr>
<th scope="row"><div align="right"><strong>Guild:</strong></div></th>
<td></td>
</tr>
</table>' ;
PHP код:
$pat = '#<table .*><tr>|<th .*><img .*><\/th>|<th .*><div .*><strong>(.*)<\/strong><\/div><\/th>|<td>(.*)<\/td><\/tr><\/table>#si';
preg_match($pat,$html,$poc);
|
|
|

25.07.2008, 15:09
|
|
Познавший АНТИЧАТ
Регистрация: 07.01.2007
Сообщений: 1,263
Провел на форуме: 3326855
Репутация:
702
|
|
А что тебя не устраивает? Или ошибки какие?
|
|
|

25.07.2008, 15:16
|
|
Участник форума
Регистрация: 11.05.2008
Сообщений: 202
Провел на форуме: 420713
Репутация:
104
|
|
А что тебя не устраивает? Или ошибки какие?
мне надо поместить текст карманы , карман выходит пустой
это
мешает положить прав в карман
<th rowspan="5" scope="row"><img src=components/com_userstat/3_m.gif width="100" height="100" /></th>
Последний раз редактировалось DTW; 25.07.2008 в 15:22..
|
|
|

25.07.2008, 15:18
|
|
Познающий
Регистрация: 20.01.2007
Сообщений: 55
Провел на форуме: 212579
Репутация:
20
|
|
Опять косяк, и не пойму в чем
PHP код:
<?php
include ("blogs/bd.php"); /*Соединяемся с базой данных*/
if (isset($_GET['id'])) {$id = $_GET['id'];}
$result = mysql_query("SELECT * FROM lessons WHERE id='$id'",$db);
$myrow = mysql_fetch_array($result);
?>
Тут такая ситуация, почему то в:
PHP код:
$result = mysql_query("SELECT * FROM lessons WHERE id='$id'",$db);
Не работает id='id'
То есть если самому подставить id='1'
То выводится нужный текст из бд
А вот если $id, для чего и приравнивал
То не получается
Что я не правильно делаю?
Сенк за внимание
Последний раз редактировалось suffering; 25.07.2008 в 15:27..
Причина: убрал кавычки
|
|
|

25.07.2008, 15:23
|
|
Познавший АНТИЧАТ
Регистрация: 07.01.2007
Сообщений: 1,263
Провел на форуме: 3326855
Репутация:
702
|
|
А что это у тебя за ковычки косые? Одинарные. Сам ручками ковычки переставь. Бывает из-за копипаста ломается что-то в коде.
|
|
|

25.07.2008, 15:28
|
|
Познающий
Регистрация: 20.01.2007
Сообщений: 55
Провел на форуме: 212579
Репутация:
20
|
|
inlanger, посоветовали:
ник (17:32:02 25/07/2008)
и кста... еще одна заметка тебе на будущее
$result = mysql_query ("select `id`, `title`, `date`, `description`, `author` from `lessons`",$db); // это правильная запись
Убрал их, проверил ещё раз, результат тот же... (
|
|
|
|
 |
|
|
Здесь присутствуют: 1 (пользователей: 0 , гостей: 1)
|
|
|
|