1

我正在尝试将我的应用程序从mysql_*Functions 迁移到PDO API正在工作的登录框;已停止将详细信息转发到user_check.php文件中..

我的代码如下:

<?php
session_start();


if (isset($_SESSION['real_name'])){

include "member_area.php";
die("-");

}
include "Database.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>
<link rel="stylesheet" href="css/style_002.css">
<link rel="stylesheet" href="css/style.css">
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<title>Billing Area</title>
<link rel="stylesheet" href="css/tooltip.css" type="text/css">

<div id="indexcpcenter">
 <div class="indexcpcenterbox">

   <form method="post" action="user_check.php">
Member Login <Br>
Email Address:<br>
<input type="text" name="username" type="text">
<br>
Password:<br><input type="password" name="password" type="text"></td>
<br><input type="submit" name="Submit" value="Login">
<br><i>Produced By <a href="http://www.slayer-productions.com">Slayer-Productions</a> Copyright 2012-2015 Slayer-Productions.com
</form>

</div>
</div> 

<script type="text/javascript" src="js/jquery.js"></script>
<script type="text/javascript" src="js/main.js"></script>
<script type="text/javascript" src="js/slideshow.js"></script>
<script type="text/javascript" src="js/tooltip.js"></script>
 <div style="position: absolute; margin: 0px; top: 384px; left: 351.5px;" id="popup"><div id="popup_title"></div><div id="popup_body">Seems like this was empty</div> <div id="popup_bottom"></div></div>

 <div id="dp_swf_engine"><object style="position: absolute; top: -1000000px; left: -1000000px;" id="_dp_swf_engine" data="swf/dealply_swf_engine.swf" type="application/x-shockwave-flash" height="1" width="1"><param value="always" name="allowscriptaccess"></object></div>

 </body></html>

此处提供了更易于阅读的版本:http: //pastebin.com/5GQ8Nnud

我不知道为什么它没有将详细信息转发到user_check.php文件中,有人有想法吗?

根据要求:Database.php

$hostname = "mysql:dbname=alltables;host=127.0.0.1";
$username = "root";
$password = "xxx";

try
{
    $Con = new PDO ($hostname, $username, $password);
}catch (PDOException $e){
    echo 'Connection failed: ' . $e->getMessage();
}
4

2 回答 2

0

user_check.php 是否收到 POST 数据?

<pre>
print_r($_POST)
</pre>

如果是这样,身份验证类/文件是什么样的?

你已经尝试了什么?

于 2012-12-17T01:34:44.890 回答
0

问题出在我的member_area.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>
<link rel="stylesheet" href="css/style_002.css">
<link rel="stylesheet" href="css/style.css">
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<title>Billing Area</title>
<link rel="stylesheet" href="css/tooltip.css" type="text/css">

Success!

<script type="text/javascript" src="js/jquery.js"></script>
<script type="text/javascript" src="js/main.js"></script>
<script type="text/javascript" src="js/slideshow.js"></script>
<script type="text/javascript" src="js/tooltip.js"></script>
 <div style="position: absolute; margin: 0px; top: 384px; left: 351.5px;" id="popup"><div id="popup_title"></div><div id="popup_body">Seems like this was empty</div> <div id="popup_bottom"></div></div>

 <div id="dp_swf_engine"><object style="position: absolute; top: -1000000px; left: -1000000px;" id="_dp_swf_engine" data="swf/dealply_swf_engine.swf" type="application/x-shockwave-flash" height="1" width="1"><param value="always" name="allowscriptaccess"></object></div>

 </body></html>

我将所述文件更改为只是success 并且从页面重新定向index.php有效。奇怪的!

于 2012-12-17T01:41:43.650 回答