Jump to content

HTTP 405 when trying to login...


AdamPGT

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
Link to comment
Share on other sites

  • 9 months later...
This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

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.