请求的URL未找到此服务器?不会重定向到下一个php页面

时间:2013-12-14 16:34:28

标签: php html

晚上好,我正在使用php进行股票市场模拟...而且我很少有错误,我无法重新审视.. 1-在我提交登录凭据后,我得到了这条消息 找不到

在此服务器上找不到请求的URL /viewdetails.php。

我正在使用wamp服务器..如果我想继续“viewdetails.php”,我必须手动将项目所在的文件夹名称添加到URL,例如URL Test / viewdetails.php

所以这里是两个php页面的代码!首先是“index.php”

 <?php
require("functions_start.php");

if (isset($_REQUEST["username"]) && isset($_REQUEST["password"]))
{
    $error = $theUser->LoginCheck($_REQUEST["username"], $_REQUEST["password"]);
}

if (isset($_REQUEST["logout"]))
    $theUser->Logout();

if (isset($_SESSION["authenticated"]) && $_SESSION["authenticated"]== true)
{
    header("Location: /viewdetails.php");
    exit;
}

HTMLHeader("Login to the stocks!",false);

if (isset($error))
{
    if ($error==false)
        echo "<div>Not able to login, please try again</div>";
}
if (isset($_REQUEST["logout"])) 
    echo "Thanks for using the site, you are logged out!";
?>

-

<div id="login">
  <b class="rtop">
    <b class="r1"></b> <b class="r2"></b> <b class="r3"></b> <b class="r4"></b>
  </b>
  <form method="post" action="<?php echo $_SERVER["PHP_SELF"]; ?>" onsubmit="">
  Login
  <p>
    Username : <input type="text" name="username" id="username" value=
  "<?php echo           $_REQUEST["username"]; ?>"/>
  </p>
  <p>
    Password : <input type="password" name="password" id="password"/>
  </p>
  <p>
    <input type="submit"/>
  </p>
  <p id="right">
    <a href="register.php">Register</a> here.
  </p>
  </form>
  <b class="rbottom">
    <b class="r4"></b> <b class="r3"></b> <b class="r2"></b> <b class="r1"></b>
  </b>
</div>
<?php
HTMLFooter();
?>

这是“viewdetails.php”的一部分

<?php
require("functions_start.php");

global $theStock;

if (!isset($_SESSION["authenticated"]) || $_SESSION["authenticated"]== false)
{
    header("Location: /index.php");
    exit;
}
foreach ($_REQUEST as $key => $value)
{
    if (strpos($key, "remove_") === 0)
        $theStock->SellStock($_SESSION["username"], $value);
    if ($key=="stock")
        $getStock = $value;
}
HTMLHeader("The details of your account");
   ?>

0 个答案:

没有答案