求助,提交PHP界面,这里哪错了?
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>无标题文档</title>
<script type="text/javascript">
function ajaxFunction()
{namex()
var xmlHttp;
try
{
// Firefox, Opera 8.0+, Safari
xmlHttp=new XMLHttpRequest();
}
catch (e)
{
// Internet Explorer
try
{
xmlHttp=new ActiveXObject("Msxml2.XMLHTTP");
}
catch (e)
{
try
{
xmlHttp=new ActiveXObject("Microsoft.XMLHTTP");
}
catch (e)
{
alert("您的浏览器不支持AJAX!");
return false;
}
}
}
xmlHttp.onreadystatechange=function()
{
var xx = document.getElementsByName("username")[0].value;
if (xx == ""){
document.getElementById("user_msg").innerHTML='<font color=red>不能为空!</font>';}
else if(document.getElementById('username').value.length < 6){
document.getElementById("user_msg").innerHTML='<font color=red>不能少于六!</font>';
}else if(xmlHttp.readyState==4)
{
var x = xmlHttp.responseText;//获取传过来的值
if(x == 1){
bb = "1";
document.getElementById("user_msg").innerHTML='<font color=green>√</font>';
}else{document.getElementById("user_msg").innerHTML='<font color=red>用户已经被注册</font>';}
}
}
var name=document.myForm.username.value;
xmlHttp.open("get","<?php echo site_url();?>/user/user_userx/?name="+name,true);//错误跟域名有关系192.168.1.102报错显示没权限 127.0.0.1没报错
xmlHttp.send(null);
}
</script>
</head>
<body>
<form name="myForm" action="/index.php/log/registration" method="post" onsubmit="return check();">
登陆账号:<input name="username" id="username" onblur="ajaxFunction(name);" onkeyup="value=value.replace(/[^\w\.\/]/ig,'')"
</form>
</body>
</html>
哪里错了?
xmlHttp.open("get","<?php echo site_url();?>/user/user_userx/?name="+name,true);//错误跟域名有关系192.168.1.102
/user/user_userx/?name="+name,true)这行代码是什么意思?
...全文
相关推荐
php实现表单多按钮提交action的处理方法
例如:```html<form action="<?php print("$PHP_SELF"); ?
作业提交系统 php 作业提交系统 LAMP php 作业提交系统 LAMP
【标题】中的“作业提交系统 php 作业提交系统 LAMP php 作业提交系统 LAMP”表明这是一个基于PHP和LAMP架构的作业提交系统。
php源码——用户登陆界面的设计
**PHP处理表单数据**:当用户提交表单时,PHP脚本接收这些数据。
PHP 表单提交给自己
></form><?php}?>```在这个例子中,当用户提交表单时,`$_POST['action']`变量会被设置为'submitted'。
提交表单后 PHP获取提交内容的实现方法
在PHP中,获取表单提交内容是Web开发中常见的任务,尤其对于初学者而言,理解这一过程至关重要。本文将详细讲解如何在提交表单后,使用PHP获取表单内容,并探讨不同方法的优缺点。


