- html - 出于某种原因,IE8 对我的 Sass 文件中继承的 html5 CSS 不友好?
- JMeter 在响应断言中使用 span 标签的问题
- html - 在 :hover and :active? 上具有不同效果的 CSS 动画
- html - 相对于居中的 html 内容固定的 CSS 重复背景?
我是 php 的新手,并尝试开发一个登录脚本,但是当我输入值时它不起作用。我什至找不到错误,因为当我点击提交时,它只会刷新页面
这是我的代码
<?php include "../utilities/config.php";
foreach($_GET as $key=>$value)
{
${$key} = trim($value);
}
$error = '';
if($checking_member_availability == 'yes'){
if(empty($user_name)){
$error .= "Please enter user name.<br />";
}
if(empty($password)){
$error .= "Please enter password.<br />";
}
if(empty($error)){
$sql = "select * from `".SITE_TABLE_PREFIX."user` where email='".$user_name."' and pwd='".$password."'";
$resultUser = mysql_query($sql) or die(mysql_error().$sql);
if(mysql_num_rows($resultUser)>0){
$rowUser = mysql_fetch_array($resultUser);
$error .= '';
$_SESSION['email']=$user_name;
}else{
$error .= "Please check Email and Password.";
}
}
if(empty($error)){
echo "myaccount.php";
}
else{
echo "<font color='#A01D49'>$error</font>";
}
}
?>
谁能帮帮我,我花了很多时间都没有成功
这是html代码
<script type="text/javascript" language="javascript">
function validation()
{
var password = trim(document.form1.password.value);
var user_name = trim(document.form1.user_name.value);
var type = trim(document.form1.type.value);
http.open("GET", "processor.php?checking_member_availability=yes&password="+
escape(password)+"&user_name="+ escape(user_name)+"&type=" + escape(type) , true);
http.onreadystatechange = handleHttpResponse;
http.send(null);
return false;
}
</script>
</head>
<table width="241" border="0" cellspacing="0" cellpadding="0">
<tr>
<td><table width="100%" border="0" cellspacing="0" cellpadding="0" <?php if($_SESSION['user_id']!=''){?> style="display:none;"<?php }?>>
<tr>
<td align="left" valign="top" class="loginBg">
<img src="img/logintxt.jpg" alt = '' width='100' height='29' border='0'>
</td>
</tr>
<tr>
<td align="left" valign="top" class="login"><form name="form1" id="form1" action="" method="post" onSubmit="return validation();">
<table width="100%" border="0" cellspacing="0" cellpadding="0">
<tr><td colspan="3"><span id="user"></span></td></tr>
<tr>
<td align="left" valign="middle" class="height"><label class="boldtxt">Email:</label></td>
<td align="left" valign="middle" class="heightMid"><input type="text" name="email" id="email" />
</td>
</tr>
<tr>
<td align="left" valign="middle"><label class="boldtxt">Password:</label></td>
<td align="left" valign="top"><table width="100%" border="0" cellspacing="0" cellpadding="0">
<tr>
<td align="left" valign="top"><input type="password" name="password" id='password' class="loginfld" />
</td>
<td align="left" valign="middle"><input type="image" src="img/submit.jpg" class="submit" onClick="return validation();" />
</td>
</tr>
</table></td>
</tr>
<tr>
<td align="left" valign="top"> </td>
<td align="left" valign="top"><a href="forget_password.php" class="normalTxt">Forgot your password?</a><br />
</td>
</tr>
</table>
</form></td>
</tr>
</table></td>
</tr>
<tr>
<td align="left" valign="top">
<table width="100%" border="0" cellspacing="0" cellpadding="0">
<tr>
<td align="left" valign="top"><a href="provider_registration.php"><img src="images/applybut.jpg" alt="" border="0" class="apply" /></a></td>
</tr>
<tr>
<td align="left" valign="top">
<?=$value?>
</td>
</tr>
<tr>
<td align="left" valign="top"> </td>
</tr>
<tr>
<td align="left" valign="top"> </td>
</tr>
</table>
</td>
</tr>
</table>
最佳答案
好的,你有一个带有文件名的 echo 语句:
echo "myaccount.php";
首先,你确定那是你想要做的吗?我相信这会回显字符串“myaccount.php”。我相信你会想要包括“myaccount.php”
其次,您在 javascript 中引用了表单字段“user_name”,但您尝试访问的字段名称名为“email”。这也可能是问题的一部分。
关于php - 登录脚本未按要求工作,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/13400971/
我有一个类和构造函数,如下所示: def init(log, edge): if edge: return Helper(log, edge) return Booka
关闭。这个问题需要更多focused .它目前不接受答案。 想改善这个问题吗?更新问题,使其仅关注一个问题 editing this post . 4年前关闭。 Improve this questi
有人知道在 mongo 上安装标准 ubuntu 需要多少磁盘空间和内存吗?试图找出我的 VPS 需求... 最佳答案 没有最低要求,但我不建议在与您的网络服务器相同的机器上运行 Mongo。 Mon
我的 Django 项目有一个虚拟环境,但是当我 pip 击 pip freeze 时,我得到了一个必须是全局站 pip 包列表的东西,包括太多包,比如ubuntu包和这么多不相关的东西。无论 vir
我曾尝试在 Heroku 上部署我的应用程序,但 smth 出错了。 错误:找不到满足要求的版本 get==2019.4.13(来自 -r/tmp/build_53ad6d03_/requiremen
我无法将 semantic-ui-calendar npm 模块加载到我的应用程序中。 我已经使用脚本标签成功地将它加载到我的 HTML 中, 但每次我尝试将它加载到我的应用程序中时,我都会出错。 在
如何修复 php.ini 中“require”函数内的地址?它进行故障排除并显示错误: 警告:require (..) 无法打开流:没有这样的文件或目录。 文件“db_connection.php”工
我有一个在 Node.js 应用程序中使用的外部库 ( Objection.js )。我创建了一个基本模型类,它为我的实体模型扩展了 Objection 的 Model 类: const { Mode
有谁知道在哪里可以找到RHEL5的GLIBC2.7,如果没有这个,Android模拟器将无法启动。它会给出一条消息,要求GLIBC 2.7或更高版本。 我尝试在网上搜索,但没有找到 最佳答案 我也遇到
Android 设备是否有任何要求/指南?例如按钮数量或所需的最少按钮数量。 还有没有菜单和后退按钮的安卓设备吗? (我知道就可用性而言,没有菜单/后退按钮会杀死大多数应用程序,我只是想了解更多有关该
我想要求/包含一个文件并将其内容检索到一个变量中。 test.php index.php ".$test; ?> 类似于 file_get_contents() 但它仍应执行 PHP 代码。这可能吗
我想要求/包含一个文件并将其内容检索到一个变量中。 test.php index.php ".$test; ?> 类似于 file_get_contents() 但它仍应执行 PHP 代码。这可能吗
我正在尝试在我的 Linux Mint 发行版上安装一个 python 模块“pyAudioProcessing”(https://github.com/jsingh811/pyAudioProces
我已经创建了我的第一个 composer 包,它具有 MySQL 和 MongoDB 的功能,但是,它不需要两者。我意识到有人可能只想将这个包与两个数据库之一一起使用,目前我有: "require":
我想调试以下函数,但假设在调试器中查看 moreajaj 的参数等于什么(假设不像在这个人为的示例中那么明显)是有用的。我可以在调试器框架中打印它,但是在每个参数的每个框架中都这样做很烦人。在宣布每一
我有一些生成的 GNUmakefiles,我需要从中提取变量的值。 有没有一种简单的方法可以在不修改 makefile 的情况下查看变量的值? 仅供引用,变量包含 emacs c-macro-expa
我正在使用 aspell 在 Linux 上拼写检查 LaTeX 文档。我的文档经常包含各种编程语言的代码示例,我希望 aspell 在拼写检查时简单地跳过这些行。 我可以在文档中写些什么来关闭一段文
我有一个包含多个列的数据集... 一列是具有重复值的主石斑鱼列,另一列是具有 bool 值 (1,0) 的 NUMBER,如下所示: grp bool --- ---- A 1 A 1 A
出于测试目的,我正在尝试删除一些 amd 模块并从服务器重新加载更新版本 - 目的是不刷新浏览器。 我目前正在执行以下操作,但浏览器仍然没有从网络重新加载项目。 var scripts = docum
当我键入irb> require 'rubygems'时,它返回false。我的Rails应用程序中有很多 gem ,这些 gem 显然可以正常工作-耙子,activerecord等。这里可能出什么问
我是一名优秀的程序员,十分优秀!