parser

Написать ответ на текущее сообщение

 

 
   команды управления поиском

Подскажите ишибку

pinger 07.02.2004 16:06

1. При нажатии "Добавить анкету" ничего не происходит
2. Правильно ли использовал функцию last_insert_id()
3. Почему не удаляется предоставленная информация
Листинг (извините за громоздкость):
#@greeting[]
Администрирование
<table width="100%" border="0" bgcolor="#000000" cellspacing="1">
<tr bgcolor="#FFFF99">
# <td width="10%" align="left" bgcolor="#A2D0F2">
# @body_main[]
# <b><h1>All list of girl! </h1></b>
# </td>
# ЛЕВАЯ СТОРОНА
<td width="45%" align="left" bgcolor="#A2D0F2">
<b><h1>Предоставленная информация</h1></b>
^connect[$connect_string]{
$news[^table::sql{select*
from
unchecked_girls
order by rand() limit 1
}]
^if($news){
^news.menu{
^if($news.photo_url ne none){
Foto:<img src="/unchecked_photo/${news.photo_url}" VSPACE=10 HSPACE=10ALIGN=left border=0 height=300>}
ID:$news.id
First Name: $news.first_name<br>
Last Name: $news.last_name<br>
Date of bith:$news.date<br>
Zodiac:$news.zodiac<br>
Passport:$news.passport<br>
Height (cm):$news.height<br>
Weight (cm): $news.weight<br>
Hair color:$news.hair<br>
Eyes color:$news.eyes<br>
Languages:$news.languages<br>
Marital status:$news.marital_status<br>
Children:$news.children<br>
Education:$news.education<br>
Major:$news.major<br>
Smoker:$news.smoker<br>
Drinker:$news.drinker<br>
Religion:$news.religion<br>
About me:$news.about_me<br>
Looking for:$news.looking_for<br>
Address:$news.address<br>
Zip/Postal Code:$news.zip<br>
Street, house, apartment:$news.street_house_apartment<br>
Region (oblast):$news.region<br>
City:$news.city<br>
Country:$news.country<br>
Home Phone:$news.home_phone<br>
Cell Phone:$news.cell_phone<br>
E-mail:$news.e_mail<br>
<br>
}[<br>]
}{
Нет анкет...
}
}
</td>
################
#ПРАВАЯ СТОРОНА#
################
<td width="45%" align="left" bgcolor="#A2D0F2">
<form method="POST" enctype="multipart/form-data">
<br>
First Name:<input type="text" name="first_name" size="10" maxlength="15" value="$news.first_name"><br>
Last Name:<input type="text" name="last_name" size="15" maxlength="20" value="$news.last_name"><br>
Date of Birth: <input type="text" name="date" size="15" maxlength="20" value="$news.date"><br>
Zodiac:<input type="text" name="zodiac" size="12" maxlength="12" value="$news.zodiac"><br>
Passport:<input type="text" name="passport" size="8" maxlength="8" value="$news.passport"><br>
Height (cm): <input type="text" name="height" size="3" maxlength="3" value="$news.height">
Weight (kg): <input type="text" name="weight" size="3" maxlength="3" value="$news.weight">
Hair color:<input type="text" name="hair" size="20" maxlength="25"><br>
Eyes color:<input type="text" name="eyes" size="20" maxlength="25"><br>
Languages:<input type="text" name="languages" size="30" maxlength="100"><br>
Marital status: <SELECT NAME="marital_status" SIZE="1">
<option value="single"> не была замужем
<option value="divorced"> разведена
<option value="widow"> вдова
</SELECT><br>
Children: <SELECT NAME="children" SIZE="1">
<option value="none"> нет
<option value="yes"> да
</SELECT><br>
Education:<input type="text" name="education" size="30" maxlength="100"><br>
Major:<input type="text" name="major" size="30" maxlength="50"><br>
Smoker:<SELECT NAME="smoker" SIZE="1">
<option value="yes"> да
<option value="no"> нет
<option value="occasional"> иногда
<option value="very little"> очень мало
</SELECT><br>
Drinker: <SELECT NAME="drinker" SIZE="1">
<option value="yes"> да
<option value="no"> нет
<option value="social"> по праздникам
</SELECT><br>
Religion: <input type="text" name="religion" size="15" maxlength="15" value="$news.religion">
About me: <textarea name="about_me" rows=3 cols=60></textarea>
Looking for: <textarea name="looking_for" rows=3 cols=60></textarea>
Address: <input type="text" name="address" size="50" maxlength="150"><br>
Zip/Postal Code:<input type="text" name="zip" size="5" maxlength="10"><br>
Street, house, apartment:<input type="text" name="street_house_apartment" size="40" maxlength="100"><br>
Region (oblast):<input type="text" name="region" size="10" maxlength="15"><br>
City: <input type="text" name="city" size="15" maxlength="15"><br>
Country: <input type="text" name="country" size="15" maxlength="20"><br>
Home Phone: <input type="text" name="home_phone" size="20" maxlength="20" value="$news.home_phone"><br>
Cell Phone: <input type="text" name="cell_phone" size="20" maxlength="20" value="$news.cell_phone"><br>
E-mail: <input type="text" name="e_mail" size="30" maxlength="40"><br>
<input type="file" name="photo" value="/unchecked_photo/${news.photo_url}">
<p>
<input type="submit" value="Добавить анкету" name="posted">&nbsp;&nbsp;&nbsp;&nbsp;
<input type="reset" value="Отмена">
</p>
#начало обработки
^if(def $form:year && def $form:month && def $form:date && def $form:first_name && def $form:last_name && def $form:zodiac && def $form:passport && def $form:height && def $form:weight && def $form:hair && def $form:eyes && def $form:languages && def $form:marital_status && def $form:children && def $form:education && def $form:major && def $form:zip && def $form:address && def $form:looking_for && def $form:about_me && def $form:street_house_apartment && def $form:region && def $form:city && def $form:country && def $form:home_phone && def $form:cell_phone && def $form:e_mail){
^if(def $form:photo){$photo_url[${form:first_name}_${form:last_name}.^file:justext[$form:photo.name]]}{$photo_url[none]}
^connect[$connect_string]{
^void:sql{insert into checked_girls
(first_name, last_name, date, zodiac, passport, height, weight, hair, eyes, languages, marital_status, children,
education, major, smoker, drinker, religion, about_me, looking_for, address, zip, street_house_apartment,
region, city, country, home_phone, cell_phone, e_mail)
values
('$form:first_name', '$form:last_name', '${form:year}-${form:month}-${form:date}', '$form:zodiac', '$form:passport', '$form:height', '$form:weight', '$form:hair', '$form:eyes', '$form:languages', '$form:marital_status', '$form:children',
'$form:education', '$form:major', '$form:smoker', '$form:drinker', '$form:religion',
'$form:about_me', '$form:looking_for', '$form:address', '$form:zip', '$form:street_house_apartment',
'$form:region', '$form:city', '$form:country', '$form:home_phone', '$form:cell_phone', '$form:e_mail')
$result(^int:sql{SELECT DISTINCT last_insert_id() FROM checked_girls}[$.default{0}])
^void:sql{insert into checked_girls
(photo_url)
values
('/checked_photo/${result}')
^void:sql{delete from checked_girls
where id = "$news.id"}
^form:photo.save[binary;/checked_photo/${result}]
} }
…анкета добавлена
}
}{
…пожалуйста, заполните все поля формы
}
</center>
}
</tr>
</table>
Заранее огромное спасибо, думал всю ночь....