Jump to content

Archived

This topic is now archived and is closed to further replies.

AdamPGT

HTTP 405 when trying to login...

Recommended Posts

I'm building a small PHP/MySQL driven system on a Windows IIS 5.x (Windows Server 2000). In any case I have a simple login page that works fine from the IP address, but when I use the host name (http://checklist/) I get an HTTP - 405 Resource Not Allowed error page. Any ideas?

Thanks,

Adam

Here's the login script, just in case:

[code]
<?php

if(isset($_POST['Submit'])){
        $email = $_POST['Email'];
        $pass = $_POST['Pass'];

        $query = "SELECT UserID, UserLevel, Email, Password FROM users WHERE Email = '$email'";
        $select = mysql_query($query) or die(mysql_error());

            if (mysql_num_rows($select) < 1){
                header("Location: index.php?err=email");
                
            }
            else {
                $row = mysql_fetch_array($select);
                $ePass = md5($pass);
                    if ($ePass == $row['Password']){
                        session_start();
                        header("Cache-control: private"); // IE Fix
                        //Store session information
                        $login = date('Y-m-d') . " " . time();
                        $insert = "INSERT INTO sessions (Session, UserID, LoginTime) VALUES ('" . session_id() . "', '" . $row['UserID'] . "', '" . $login . "')";
                        mysql_query($insert);
                        $sid = mysql_insert_id();

                        $sess_sql = "SELECT SessID, Session FROM sessions WHERE SessID = '$sid'";
                        $sess_result = mysql_query($sess_sql);
                        $sess_row = mysql_fetch_array($sess_result);
                                        
                        header("Location: main.php?sid=" . $sess_row['SessID'] . "&&session=" . $sess_row['Session']);
                    }
                    else {
                        header("Location: index.php?err=pass");
                        //echo $ePass . "<br>" . $row['Password'];
                    }
            }
}

?>
[/code]

--Adam

Share this post


Link to post
Share on other sites

×

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.