![]() |
Модераторы: skyboy, MoLeX, Aliance, ksnk |
![]() ![]() ![]() |
|
savage |
|
|||
![]() Шустрый ![]() Профиль Группа: Участник Сообщений: 135 Регистрация: 13.8.2003 Репутация: -1 Всего: нет |
Вот какая проблема: Я сделал страничку на PHP, с использованием шаблона. После написания нажал на просмотр, а тм: "Parse error: parse error, unexpected $end in c:\XXX\XXX\XXX\XXX.php on line 337" - никакой переменной $end у меня нет вообще. А сторока на которую ссылается ошибка выглядит так:
333 </table> 334 </div> 335 </body> 336 <!-- InstanceEnd --> 337 </html> Что делать? |
|||
|
||||
Cepera |
|
|||
![]() PHPexp ![]() ![]() ![]() ![]() Профиль Группа: Экс. модератор Сообщений: 2146 Регистрация: 25.3.2002 Где: Russia, Samara Репутация: 1 Всего: 7 |
хм... надо бы полный код увидеть - чтобы ответить
-------------------- I know it is heavy for reading, but I know you will read it anyway... |
|||
|
||||
savage |
|
|||
![]() Шустрый ![]() Профиль Группа: Участник Сообщений: 135 Регистрация: 13.8.2003 Репутация: -1 Всего: нет |
Я че его прямо сюда запихаю что ли? Может я тебе его на мыло?
|
|||
|
||||
savage |
|
|||
![]() Шустрый ![]() Профиль Группа: Участник Сообщений: 135 Регистрация: 13.8.2003 Репутация: -1 Всего: нет |
Вот текст странички:
<?php $page="make"; ?> <?php include ("../www/scripts/inc/page_name.php"); include ("../www/scripts/inc/zagolovki.php"); include ("../www/scripts/inc/connect_dbs.php"); ?> <?php $test="ziroo"; function make_book ($user_name, $nick, $progres,$pass, $repass, $email, $user_info, $pub2, $file_img) { global $error_mass; $query="insert into day_book (status, progres, pass, user, nickname, email, user_info, image) values ('$pub2', '$progres', '$pass', '$user_name','nick', '$email', '$user_info', '$file_img')"; mysql_query ($query, $linck)or die (error_log(date("d/m/Y H I")." Ошибка: ".mysql_error(), 3, "../../error/mysql_error_log.txt")); $error_mass="Дневник был успешно создан"; $name=$nick; session_register ("name"); } function test ($user_name, $nick, $pass, $repass, $email, $user_info_cantry, $user_info_city, $user_info_let, $user_info_o_sebe, $file_img) { global $error_mass; global $test; $query=mysql_query("select * from day_book", $linck); while ($array=mysql_fetch_array($query)) { if ($array[user]==$user_name) { $error_mass.="Ошибка: Такое имя уже существует.<br>"; $test="full"; break; } } if (preg_match("/[^(\w)|(\x7F-\xFF)|(\s)]/",$user_name)) {$error_mass.="Ошибка: Использование ненужных символов в имени.<br>"; $test="full";} if (strlen($user_name)>30) {$error_mass.="Ошибка: Слишком длинное Имя.<br>"; $test="full";} while ($array=mysql_fetch_array($query)) { if($array[nickname]==$nick) { $error_mass.="Ошибка: Такой nick уже существует.<br>"; break; $test="full"; } } if (preg_match("/[^(\w)|(\x7F-\xFF)|(\s)]/",$nick)) {$error_mass.="Ошибка: Использование ненужных символов в nick`e.<br>"; $test="full";} if (strlen($nick)>10) {$error_mass.="Ошибка: Слишком длинный nick.<br>"; $test="full";} if (strlen($pass)>10) {$error_mass.="Ошибка: Слишком длинный Password.<br>"; $test="full";} if (strlen($repass)>10) {$error_mass.="Ошибка: Слишком длинный RePassword.<br>"; $test="full";} if ($pass!=$repass) {$error_mass.="Ошибка: Рassword и RePassword не совпадают.<br>"; $test="full";} if (preg_match("/[^(\w)|(\x7F-\xFF)|(\s)]/",$pass)) {$error_mass.="Ошибка: Использование ненужных символов в имени.<br>"; $test="full";} if (strlen($email)>30) {$error_mass.="Ошибка: Слишком длинный E-mail.<br>"; $test="full";} if ((!ereg("^[a-z0-9_\.-]+@([a-z0-9][a-z0-9-]+\.)+[a-z]{2,4}$", $email)) && (trim($email) != '')) {$error_mass.="Ошибка: Неверный E-mail.<br>"; $test="full";} if (isset($user_info_cantry)) { if (preg_match("/[^(\w)|(\x7F-\xFF)|(\s)]/",$user_info_cantry)) {$error_mass.="Ошибка: Использование ненужных символов в Страна.<br>"; $test="full";} if (strlen($user_info_cantry)>15) {$error_mass.="Ошибка: Слишком длинный Cтрана.<br>"; $test="full";} } if (isset($user_info_city)) { if (preg_match("/[^(\w)|(\x7F-\xFF)|(\s)]/",$user_info_city)) {$error_mass.="Ошибка: Использование ненужных символов в Город.<br>"; $test="full";} if (strlen($user_info_city)>15) {$error_mass.="Ошибка: Слишком длинный Город.<br>"; $test="full";} } if (isset($user_info_let)) { if (preg_match("/[^(\w)|(\x7F-\xFF)|(\s)]/",$user_info_let)) {$error_mass.="Ошибка: Использование ненужных символов в Возраст.<br>"; $test="full";} if (strlen($user_info_let)>2) {$error_mass.="Ошибка: Слишком длинный Возраст.<br>"; $test="full";} } if (isset($user_info_o_sebe)) { if (preg_match("/[^(\w)|(\x7F-\xFF)|(\s)]/",$user_info_o_sebe)) {$error_mass.="Ошибка: Использование ненужных символов в О себе.<br>"; $test="full";} if (strlen($user_info_o_sebe)>70) {$error_mass.="Ошибка: Слишком длинный О себе.<br>"; $test="full";} } if (isset($file_img)) { while ($array=mysql_fetch_array($query)) { if ($array[image]==$file_img_name) {$error_mass.="Ошибка: Образ с таким именем уже существует.<br>";} break; $test="full"; } if ($file_img_type!="image/gif") {$error_mass.="Ошибка: Образ должен быть в формате GIF.<br>"; $test="full";} if ($file_img_size>90000) {$error_mass.="Ошибка образ должен быть не более 90kb.<br>"; $test="full";} if (substr($file_img_name, -4)!=".gif") {$error_mass.="Ошибка: Образ должен быть в формате GIF.<br>"; $test="full";} } } if (isset($user_name) && isset($nick) && isset($pass) && isset($repass) && isset($email)) { $pub2=1; $user_name= ereg_replace(" +"," ",$user_name); $user_name=htmlspecialchars($user_name); $nick= ereg_replace(" +"," ",$nick); $nick=htmlspecialchars($nick); $pass= ereg_replace(" +"," ",$pass); $pass=htmlspecialchars($pass); $email= ereg_replace(" +"," ",$email); $email=htmlspecialchars($email); if (isset($user_info_cantry) ) { $user_info_cantry= ereg_replace(" +"," ",$user_info_cantry); $user_info_cantry=htmlspecialchars($user_info_cantry); } if (isset($user_info_city)) { $user_info_city= ereg_replace(" +"," ",$user_info_city); $user_info_city=htmlspecialchars($user_info_city); } if (isset($user_info_o_sebe)) { $user_info_o_sebe= ereg_replace(" +"," ",$user_info_o_sebe); $user_info_o_sebe=htmlspecialchars($user_info_o_sebe); } foreach ($publick as $key) { if ($key==1) {$pub2=1;} else {$pub2=2;} } test ($user_name, $nick, $pass, $repass, $email, $user_info_cantry, $user_info_city, $user_info_let, $user_info_o_sebe, $file_img); if ($test=="ziroo") { $user_info=$user_info_cantry."+"; $user_info.=$user_info_city."+"; $user_info.=$user_info_let."+"; $user_info.=$user_info_o_sebe."+"; if (!isset($file_img)) {$file_img=="user.gif";} else { copy ($file_img, ".../www/img/user/$file_img_name"); $file_img=$file_img_name; } $progres=time(); make_book ($user_name, $nick, $progres,$pass, $repass, $email, $user_info, $pub2, $file_img); } else { $error_mass.="Заполни форму правильно."; } mysql_close ($linck); ?> <html><!-- InstanceBegin template="/Templates/page_template.dwt.php" codeOutsideHTMLIsLocked="false" --> <head> <!-- InstanceBeginEditable name="doctitle" --> <title><?php print $domain; ?></title> <!-- InstanceEndEditable --> <meta http-equiv="Content-Type" content="text/html; charset=windows-1251"> <!-- InstanceBeginEditable name="head" --> <!-- InstanceEndEditable --> <link href="scripts/a_linck_style.css" rel="stylesheet" type="text/css"> <link href="scripts/form_style.css" rel="stylesheet" type="text/css"> </head> <body bgcolor="#FFFFFF" text="#000000" link="#999999" vlink="#FFFFFF" alink="#6699FF"> <div align="center"> <table width="818" height="519" border="0" cellpadding="0" cellspacing="0"> <!--DWLayoutTable--> <tr> <td height="103" colspan="6" align="left" valign="top"><img src="img/shapka.jpg" width="785" height="150"></td> </tr> <tr> <td height="33" colspan="2" align="left" valign="top"><!-- InstanceBeginEditable name="linck1" --><a href="index.php"><img src="img/novigation/<?php print $index_page; ?>" width="145" height="33" border="0"></a><!-- InstanceEndEditable --></td> <td width="112" align="left" valign="top"><!-- InstanceBeginEditable name="linck2" --><a href="speak.php"><img src="img/novigation/<?php print $speak_page; ?>" width="112" height="33" border="0"></a><!-- InstanceEndEditable --></td> <td width="112" align="left" valign="top"><!-- InstanceBeginEditable name="linck3" --><a href="make.php"><img src="img/novigation/<?php print $make_page; ?>" width="131" height="33" border="0"></a><!-- InstanceEndEditable --></td> <td width="112" height="33" align="left" valign="top"><!-- InstanceBeginEditable name="linck4" --><a href="books.php"><img src="img/novigation/<?php print $day_books_page; ?>" width="112" height="33" border="0"></a><!-- InstanceEndEditable --></td> <td width="337" height="33" align="left" valign="top"><!-- InstanceBeginEditable name="linck5" --><a href="modify.php"><img src="img/novigation/<?php print $modify_page; ?>" width="112" height="33" border="0"></a><img src="img/novigation/<?php print $img_line; ?>" width="170" height="33"><!-- InstanceEndEditable --></td> </tr> <tr align="left"> <td height="6" colspan="6" valign="top"><!-- InstanceBeginEditable name="linck7" --><img src="img/novigation/<?php print $img_line3; ?>" width="782" height="6"><!-- InstanceEndEditable --></td> </tr> <tr align="left"> <td width="79" height="27"><img src="img/novigation/line2.gif" width="71" height="51"></td> <td colspan="4" valign="middle"><form name="enter" method="post" action=""> <input name="login" type="text" size="12" maxlength="12"> <input name="pass" type="password" size="12" maxlength="12"> <input type="submit" name="Submit" value="Вход"> <font color="#000000" size="2" face="Courier New, Courier, mono">Вы: <?php print $massage_for_user; ?></font> </form> </td> <td valign="top"><!-- InstanceBeginEditable name="linck6" --><img src="img/novigation/<?php print $img_line2; ?>" width="282" height="51"><!-- InstanceEndEditable --></td> </tr> <tr align="left"> <td height="8" colspan="6" valign="top"><img src="img/novigation/line3.gif" width="782" height="8"></td> </tr> <tr> <td height="286" colspan="6" align="center" valign="top"><!-- InstanceBeginEditable name="info" --> <table width="646" height="592" border="1" cellpadding="0" cellspacing="0" bordercolor="#FFFFFF" bgcolor="#FFFFFF"> <tr> <td height="12" align="left" valign="top"><img src="img/make_smoll_shapka.gif" width="525" height="25"></td> </tr> <tr> <td height="0" align="center" valign="top"><strong><font color="#FF0000" size="2" face="Courier New, Courier, mono"> <?php @print $error_mass;?> </font></strong></td> </tr> <tr bgcolor="#F0F0F0"> <td height="133" align="left" valign="top" bordercolor="#FFFFFF" bgcolor="#F7F7F7"> <p><font color="#000000" size="2" face="Courier New, Courier, mono"> Техе1 <br> Text2.</font></p> <p><font color="#000000" size="2" face="Courier New, Courier, mono"> Заполни форму:</font></p></td> </tr> <tr> <td height="69" align="left" valign="top" bordercolor="#000000"><font color="#FF0000" size="2" face="Courier New, Courier, mono"><img src="img/warning.gif" width="60" height="60" align="left"></font><font color="#FF0000" size="2" face="Courier New, Courier, mono">* <font color="#000000">- являются обязательными полями.<br> Text3.</font></font></td> </tr> <tr> <td height="338" align="left" valign="top" bordercolor="#FFFFFF"> <form action="<?php $PHP_SELF; ?>" method="post" enctype="multipart/form-data" name="make_book"> <table width="641" border="1" align="center" cellpadding="0" cellspacing="0" bordercolor="#FFFFFF"> <tr bgcolor="#F7F7F7"> <td width="257" align="left" valign="top"><font color="#000000" size="2" face="Courier New, Courier, mono">Твое Ф.И.О.:</font></td> <td width="378" align="left" valign="top"> <input name="user_name" type="text" maxlength="30"> <font color="#FF0000">* </font></td> </tr> <tr bgcolor="#F7F7F7"> <td align="left" valign="top"><font color="#000000" size="2" face="Courier New, Courier, mono">Твой nick (login)</font><font color="#000000" size="2" face="Courier New, Courier, mono">:</font></td> <td align="left" valign="top"><font color="#000000" size="2" face="Courier New, Courier, mono"> <input name="nick" type="text" maxlength="10"> </font><font color="#FF0000">*</font><font color="#000000" size="2" face="Courier New, Courier, mono"> </font></td> </tr> <tr bgcolor="#F7F7F7"> <td align="left" valign="top"><font color="#000000" size="2" face="Courier New, Courier, mono">Password:</font></td> <td align="left" valign="top"><font color="#FF0000"> <input name="pass" type="password" id="pass" maxlength="10"> *</font></td> </tr> <tr bgcolor="#F7F7F7"> <td align="left" valign="top"><font color="#000000" size="2" face="Courier New, Courier, mono">Повтори Password:</font></td> <td align="left" valign="top"><font color="#FF0000"> <input name="repass" type="text" id="repass2" maxlength="10"> *</font></td> </tr> <tr bgcolor="#F7F7F7"> <td align="left" valign="top"><font color="#000000" size="2" face="Courier New, Courier, mono">E-mail:</font></td> <td align="left" valign="top"><font color="#FF0000"> <input name="email" type="text" maxlength="30"> </font> <font color="#FF0000">*</font></td> </tr> <tr bgcolor="#F7F7F7"> <td align="left" valign="top"><font color="#000000" size="2" face="Courier New, Courier, mono">Страна:</font></td> <td align="left" valign="top"><font color="#000000" size="2" face="Courier New, Courier, mono"> <input name="user_info_cantry" type="text" id="user_info_cantry3" maxlength="15"> </font></td> </tr> <tr bgcolor="#F7F7F7"> <td align="left" valign="top"><font color="#000000" size="2" face="Courier New, Courier, mono">Город (деревня/село):</font></td> <td align="left" valign="top"><font color="#000000" size="2" face="Courier New, Courier, mono"> <input name="user_info_city" type="text" maxlength="15"> </font></td> </tr> <tr bgcolor="#F7F7F7"> <td align="left" valign="top"><font color="#000000" size="2" face="Courier New, Courier, mono">Возраст:</font></td> <td align="left" valign="top"> <input name="user_info_let" type="text" id="user_info_let2" size="3" maxlength="2"> </td> </tr> <tr bgcolor="#F7F7F7"> <td align="left" valign="top"><font color="#000000" size="2" face="Courier New, Courier, mono">Немного о себе:</font></td> <td align="left" valign="top"><font color="#000000" size="2" face="Courier New, Courier, mono"> <textarea name="user_info_o_sebe" cols="50" rows="5"maxlength="100" wrap="VIRTUAL"></textarea> </font></td> </tr> <tr bgcolor="#F7F7F7"> <td align="left" valign="top"><font color="#000000" size="2" face="Courier New, Courier, mono">Text4</font></td> <td align="left" valign="top"><font color="#000000" size="2" face="Courier New, Courier, mono"> <select name="publick[]" size="1"> <option value="1" selected>Да</option> <option value="2">Нет</option> </select> </font></td> </tr> <tr bgcolor="#F7F7F7"> <td align="left" valign="top"><font color="#000000" size="2" face="Courier New, Courier, mono">Образ </font></td> <td align="left" valign="top"><font color="#000000" size="2" face="Courier New, Courier, mono"> <input type="file" name="file_img"> <input name="max_file_size" type="hidden" value="90000"> <input name="make_page_out" type="hidden" id="make_page_out" value="make_page_out"> </font></td> </tr> <tr align="center" bgcolor="#F7F7F7"> <td colspan="2" valign="top"><input type="submit" value="Создать дневник"></td> </tr> </table> </form></td> </tr> </table> <!-- InstanceEndEditable --></td> </tr> </table> </div> </body> <!-- InstanceEnd --> </html> |
|||
|
||||
arial |
|
|||
![]() Опытный ![]() ![]() Профиль Группа: Участник Клуба Сообщений: 772 Регистрация: 11.3.2003 Где: Архангельская обл . Репутация: 6 Всего: 7 |
Есть желающие разобраться?
![]() -------------------- Есть люди, в которых живет Бог. Есть люди, в которых живет дьявол. А есть люди, в которых живут только глисты. (Ф. Раневская) |
|||
|
||||
savage |
|
|||
![]() Шустрый ![]() Профиль Группа: Участник Сообщений: 135 Регистрация: 13.8.2003 Репутация: -1 Всего: нет |
Я же говорил, Мне никто не поможет. Блин А Я уже совсем устал искать где же ошибка. Хелп!
|
|||
|
||||
izOne |
|
|||
![]() Бывалый ![]() Профиль Группа: Участник Сообщений: 232 Регистрация: 22.8.2003 Где: Украина, Киев Репутация: 3 Всего: 4 |
savage
Не надо отчаиваться!!! Смотри следующие строки(~~100-120): if (isset($user_name) && isset($nick) && isset($pass) && isset($repass) && isset($email)) { $pub2=1; $user_name= ereg_replace(" +"," ",$user_name); $user_name=htmlspecialchars($user_name); $nick= ereg_replace(" +"," ",$nick); $nick=htmlspecialchars($nick); $pass= ereg_replace(" +"," ",$pass); $pass=htmlspecialchars($pass); $email= ereg_replace(" +"," ",$email); $email=htmlspecialchars($email); } // Этой скобки у тебя нет!!! У меня тоже был $end, но после установки этой скобки покатились другие ошибки - из-за отсутствия остальных твоих файлов. Вобщем дело в пропущенной скобке(может где-то в др.месте) И, должен я тебе сказать, делай код более читаемым. Много ненужных операторов ![]() Надеюсь помог? ![]() --------------------
Успех ждет каждого, но иногда всю жизнь. |
|||
|
||||
savage |
|
|||
![]() Шустрый ![]() Профиль Группа: Участник Сообщений: 135 Регистрация: 13.8.2003 Репутация: -1 Всего: нет |
Большое спасибо! Сильно выручил!
|
|||
|
||||
![]() ![]() ![]() |
Правила форума "PHP" | |
|
Новичкам:
Важно:
Внимание:
Если Вам понравилась атмосфера форума, заходите к нам чаще! С уважением, IZ@TOP, skyboy, SamDark, MoLeX, awers. |
1 Пользователей читают эту тему (1 Гостей и 0 Скрытых Пользователей) | |
0 Пользователей: | |
« Предыдущая тема | PHP: Общие вопросы | Следующая тема » |
|
По вопросам размещения рекламы пишите на vladimir(sobaka)vingrad.ru
Отказ от ответственности Powered by Invision Power Board(R) 1.3 © 2003 IPS, Inc. |