我正在考虑在表单中插入catcha过程,所以我在考虑一些逻辑,所以我从google下载了一个登录,但是我不明白。为什么我的表单仍然使用action=' '
将数据存储到数据库中,而它是action="register.php"
附带的,但是正如我告诉您的,我正在做一些逻辑学方面的工作,所以您能告诉我这里有什么问题吗?
这是我的完整代码:
<?php
// show potential errors / feedback (from registration object)
if (isset($registration)) {
if ($registration->errors) {
foreach ($registration->errors as $error) {
echo '<div class="alert-box error"><span>Error: </span>'.$error.'</div>';
}
}
if ($registration->messages) {
foreach ($registration->messages as $message) {
echo '<div class="alert-box success"><span>Success: </span>'.$message.'</div>';
}
}
}
?>
<!DOCTYPE html>
<html>
<head>
<title>Registration with Linkvessel and collaborate with college's friends</title>
<link rel='stylesheet' type='text/css' href="./CSS_files/registration_style.css" />
<link rel="stylesheet" type="text/css" href="./bootstrap/css/bootstrap-responsive.css" />
<link rel="stylesheet" type="text/css" href="./bootstrap/css/bootstrap-responsive.min.css"/>
<link rel="stylesheet" type="text/css" href="./bootstrap/css/bootstrap.css" />
<link rel="stylesheet" type="text/css" href="./bootstrap/css/bootstrap.min.css" />
<link rel="stylesheet" type="text/css" href="./bootstrap/js/bootstrap.js" />
<link rel="stylesheet" type="text/css" href="./bootstrap/js/bootstrap.min.js" />
<link rel="stylesheet" href="//code.jquery.com/ui/1.10.4/themes/smoothness/jquery-ui.css">
<script src="//code.jquery.com/jquery-1.10.2.js"></script>
<script src="//code.jquery.com/ui/1.10.4/jquery-ui.js"></script>
<script>
$(function(){
$("#datepicker").datepicker();
});
</script>
<style>
.alert-box {
color:#555;
border-radius: 0px;
font-family:Tahoma,Geneva,Arial,sans-serif; font-size:11px; font-size: 18px;
padding: 30px 36px;
margin:10px;
}
.alert-box span {
font-weight:bold;
text-transform:uppercase;
}
.error {
border:2px solid #0c0b0b;
background-color: #ff7e48;
}
.success{
border:2px solid #0c0b0b;
background-color: #a3ea42;
}
</style>
</head>
<body>
<div id="header">
<img id="logo_size" src="./images/logo.png" onmousedown="return false">
</div><br><br><br>
<form id="form_box" method="post" action='' name="registerform">
<div id="title">
<h2>REGISTRATION FORM</h2>
</div>
<div class="controls pos_selectbox">
<select id="basic" name="user_college" class="input-medium">
<option>Select College</option>
<option>MAIIT kota</option>
</select>
<select id="basic" name="user_branch" class="input-medium">
<option>Select Branch</option>
<option>Computer science</option>
<option>Civil</option>
<option>Mechanical</option>
<option>Electrical</option>
<option>Bioinformatic</option>
</select>
<select id="basic" name="user_year" class="input-medium">
<option>Select year</option>
<option>1st year</option>
<option>2nd year</option>
<option>3rd year</option>
<option>4th year</option>
<option>Year completed</option>
</select>
</div><br>
<input id="input_pos" type="email" name="user_email" required="" placeholder="Email address" /><br><br>
<input id="input_pos" type="password" name="user_password_new" required="" placeholder="Password" /><br><br>
<input id="input_pos" type="password" name="user_password_repeat" required="" placeholder="Confirm password" /><br><br>
<input id="name_pos" type="text" name="user_firstname" required="" placeholder="First name" />
<input id="name_pos2" type="text" name="user_lastname" required="" placeholder="Last name" /><br><br>
<input id="datepicker" type="text" name="user_dob" required="" placeholder="Date of birth" /><br><br>
<input id="name_pos" type="text" name="user_state" required="" placeholder="State" />
<input id="name_pos2" type="text" name="user_city" required="" placeholder="city" /> <br><br>
<input type="submit" name="register" id="pos_submit" class="btn btn-primary btn-large" value="Create account.."/>
</form>
</html>
发布于 2014-06-09 05:54:02
窗体操作属性的空值默认为当前URL。因此,如果该页面的URL为register.php
,则action=''
与执行action='register.php'
相同。
W3C规范表示此行为未指定。但是浏览器已经普遍地实现了上述行为。
最后,使用方法属性指定的协议将编码的数据发送到由action属性指定的处理代理。 此规范没有指定所有可与表单一起使用的有效提交方法或内容类型。但是,在下列情况下,HTML 4用户代理必须支持已建立的约定:
对于操作或方法的任何其他值,未指定行为。
https://stackoverflow.com/questions/24121749
复制相似问题