SitePoint Sponsor

User Tag List

Results 1 to 4 of 4
  1. #1
    SitePoint Addict trigger's Avatar
    Join Date
    Jun 2003
    Location
    Eagan
    Posts
    342
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Very simple PHP authentication script

    Just can't figure out what's going wrong...
    PHP Code:
    require_once('Connections/Connection.php');
    mysql_select_db($database_Connection$Connection);
                    
    $query_result "SELECT * FROM access WHERE userName='$userName' AND password='$passWord'";
                    
    $result mysql_query($query_result$NASI_Connection) or die(mysql_error());
                    
    $num mysql_numrows($result);
                    if (
    $num != "0"){
                        
    setcookie("gsi_logged""YES"time()+86400*120);
                        
    header ("Location: xxxxxxxxxxxxxxxxxx.php");
                    }
                    else {
                        
    header ("Location: xxxxxxxxxxxxxx1.php");
                    } 
    All I want for Christmas is a php error-reporting machine. My testing server, my local IIS machine with Win XP Pro, is broken, and my ISPs hosting machine won't turn on the php error reporting. Can someone PLEASE help me out? I don't see what I'm doing wrong here. No I will not use sessions either, and globals are turned on.

  2. #2
    SitePoint Wizard silver trophy someonewhois's Avatar
    Join Date
    Jan 2002
    Location
    Canada
    Posts
    6,364
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    PHP Code:
    error_reporting(E_ALL); 
    At the top of your script.

    Also, in your main xxxxxxxxxxxxxxx.php (wrong number of x's, I know), do you ch eck for gsi_logged to be set? If not, that's uselses if somebody finds out where xxxxxxxxxxxxxx.php is. Just a pointer.

    Hope this helped, please rate me if it did, if not, tell me, I'm glad to help.

    Regards,
    Someonewhois

  3. #3
    SitePoint Wizard silver trophy someonewhois's Avatar
    Join Date
    Jan 2002
    Location
    Canada
    Posts
    6,364
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Oh, and your mysql_query uses $NASI_connection, but your mysql_select_db uses $Connection.. just another pointer, which could be the problem

  4. #4
    SitePoint Addict trigger's Avatar
    Join Date
    Jun 2003
    Location
    Eagan
    Posts
    342
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    just trying to protect my connection info. Sorry, but I don't trust anyone. That stuff is fine, I changed a little for the post. Putting error_reporting(E_ALL); didn't give me any errors when I tried to process my login form again. As far as your first post, I'm going to redirect if the cookie isn't there.


Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •