|
14.02.2006, 05:16
#33542320
Ссылка:
Ссылка на сообщение:
Ссылка с названием темы:
Ссылка на профиль пользователя:
|
|
|
Участник
Сообщения: 129
Рейтинг:
0
/ 0
|
|
|
|
Мне необходимо реализовать защиту на форме ввода данных... я в этом деле новичок, поэтому спрошу прямо: Как???
Форма ввода: 1. 2. 3. 4. 5. 6. 7. 8. 9. 10. 11. 12. 13. 14. 15. 16. 17. 18. 19. 20. 21. 22. 23. 24. 25. 26. 27. 28. 29. 30. 31. 32. 33. 34. 35. 36. 37. 38. 39. 40. 41. 42. 43. 44. 45. 46. 47. 48. 49. 50. 51. 52. 53. 54. 55. 56. 57. 58. 59. 60. 61. 62. 63. 64. 65. 66. 67. 68. 69. 70. 71. 72. 73. 74. 75. 76. 77. 78. 79. 80. 81. 82. 83. 84. 85. 86. 87. 88.
<html>
<head>
<title>Ðåãèñòðàöèÿ</title>
<meta http-equiv="Content-Type" content="text/html; charset=windows-1251">
<style type="text/css">
<!--
body,td,th {
font-family: Verdana, Arial, Helvetica, sans-serif;
font-size: 12px;
color: # 000000 ;
}
body {
background-color: #bfc4cb;
margin-left: 10px;
margin-top: 10px;
margin-right: 10px;
margin-bottom: 10px;
}
.style1 {
font-size: 14px;
font-weight: bold;
vertical-align: bottom;
}
-->
</style></head>
<body>
<form action="PHP\Reg.php" method="post">
<div align="center">
<label><span class="style1">Введите данные</span></label>
</div>
<div align="center">
<label><br></label>
<table width="401" border="0" align="center">
<tr>
<th align="center" valign="middle" scope="row"> <div align="center">ФИО</div></th>
<td width="179"><div align="left">
<input type="text" name=Edit1 size="40" maxlength="40">
</div></td>
</tr>
<tr>
<th align="center" valign="middle" scope="row"><div align="center">Пароль</div></th>
<td>
<div align="left">
<input type="password" name=Edit2 size="20" maxlength="20">
</div></td>
</tr>
<tr>
<th align="center" valign="middle" scope="row"><div align="center">e-mail</div></th>
<td>
<div align="left">
<input type="text" name=Edit3 size="40" maxlength="40">
</div></td>
</tr>
<tr>
<th align="center" valign="middle" scope="row"><div align="center">Вопрос</div></th>
<td><div align="left">
<input type="text" name=Edit4 size="40" maxlength="40" >
</div></td>
</tr>
<tr>
<th align="center" valign="middle" scope="row"><div align="center">Ответ</div></th>
<td><div align="left">
<input type="text" name=Edit5 size="40" maxlength="40">
</div></td>
</tr>
<tr>
<th align="center" valign="middle" scope="row"><div align="center">Телефон</div></th>
<td><div align="left">
<input type="text" name=Edit6 size="20" maxlength="15" value="">
</div></td>
</tr>
<tr>
<th align="center" valign="middle" scope="row"><p align="center">Рассылка</p> </th>
<td><div align="left">
<input type="checkbox" name=checkbox1>
</div></td>
</tr>
</table>
</div>
<p align="center">
<INPUT TYPE="Submit" VALUE="Зарегиться">
</p>
</form>
</body>
</html>
Скрипт: 1. 2. 3. 4. 5. 6. 7. 8. 9. 10. 11. 12. 13. 14. 15. 16. 17. 18. 19. 20. 21. 22.
<?php
error_reporting ( 0 );
$link = mysql_connect("localhost","root","") or die("Could not connect");
mysql_select_db("InvestekDB");
$FIO = $Edit1;
$pass = $Edit2;
$e = $Edit3;
$Qestion = $Edit4;
$Ansver = $Edit5;
$telephone = $Edit6;
if ($checkbox1=="on") {
$Rassylka= 1 ;
}
if ($checkbox1=="off")
{$Rassylka= 0 ;
}
$Date=date;
$query="insert into Customers values ('', '', '$FIO', '$pass', '$Qestion','$Ansver','$e','$telephone','$Rassylka','$Date')";
mysql_query($query) or die(mysql_error());
mysql_free_result($result);
mysql_close($link);
echo "Вы были зарегины";
?>
|
|
|