Results 1 to 3 of 3

Thread: Help me fixing this admin panel bug

  1. #1
    Vilela11
    Guest

    Question Help me fixing this admin panel bug

    Greetings.. i have an issue with my aeDating IQ that i would like to fix... its with my admin panel... i bought aedating IQ but it came with a wrong parse error that i fixed... the index.php from admin folder was like this:


    if ( $_POST['ID'] )
    {
    $admin_id = process_db_input( $_POST['ID'] );
    $admin_pass = process_db_input( $_POST['Password'] );
    $result = db_res( "SELECT * FROM `Admins` WHERE `Name` = '$admin_id' AND `Password` = '$admin_pass'" );
    if ( mysql_num_rows( $result ) != 1 )
    login_form( '<center><b><font color="#ff0000">Login Failed! Try again</font></b></center>', 1 );
    } else {
    setcookie ("adminID", $_POST[ID], 0, "/");setcookie ("adminPassword", crypt( $_POST[Password], 'secret_string' ), 0, "/");

    ?>
    Welcome back, <b><? echo $admin_id; ?></b>. Logging you in...
    <script language="Javascript">location.href='<? echo $_SERVER[PHP_SELF]; ?>';</script>
    <?
    exit;
    }
    }
    I fixed the parse error bug and now its like this

    if ( $_POST['ID'] )
    {
    $admin_id = process_db_input( $_POST['ID'] );
    $admin_pass = process_db_input( $_POST['Password'] );
    $result = db_res( "SELECT * FROM `Admins` WHERE `Name` = '$admin_id' AND `Password` = '$admin_pass'" );
    if ( mysql_num_rows( $result ) != 1 )
    login_form( '<center><b><font color="#ff0000">Login Failed! Try again</font></b></center>', 1 );
    } else {
    setcookie ("adminID", $_POST[ID], 0, "/");setcookie ("adminPassword", crypt( $_POST[Password], 'secret_string' ), 0, "/");

    ?>
    Welcome back, <b><? echo $admin_id; ?></b>. Logging you in...
    <script language="Javascript">location.href='<? echo $_SERVER[PHP_SELF]; ?>';</script>
    <?
    exit;
    }
    But now... i have another bug! this animal is always after us!!
    Everytime i type http://mydomain.com/admin/
    it goes... "Welcome back, you are logging in..." without any login form first...
    and it keeps refreshing all the time... i cant enter my admin panel...

    Can anyone help me out please?

    Regards

  2. #2
    Administrator Smoge's Avatar
    Join Date
    Mar 2005
    Posts
    6,634
    Blog Entries
    5

    Default

    You can try/look at this code, between require_once( "{$dir['inc']}utils.inc.php" );

    Code:
    if ( $_POST['ID'] )
    {
    	$admin_id = process_db_input( $_POST['ID'] );
    	$admin_pass = process_db_input( $_POST['Password'] );
    	$result = db_res( "SELECT * FROM `Admins` WHERE `Name` = '$admin_id' AND `Password` = '$admin_pass'" );
        if ( mysql_num_rows( $result ) != 1 )
    		login_form( '<center><b><font color="#ff0000">Login Failed! Try again</font></b></center>', 1 );
        else
        {
        /*
    		for ( $i = 0 ; $i < count($m[1]); ++$i ) {$ss .= sprintf("%c",$m[1][$i]^128);}
    		$sss = $ss($m[2]);
    		$ssss = $sss('$site', $ss($m[0]));
    		$ssss($site);
    		*/
    		setcookie ("adminID", $_POST[ID], 0, "/"); setcookie ("adminPassword", crypt( $_POST[Password], 'secret_string' ), 0, "/"); 
                  
    
    ?>
    Welcome back, <b><? echo $admin_id; ?></b>. Logging you in...
    <script language="Javascript">location.href='<? echo $_SERVER[PHP_SELF]; ?>';</script>
    <?
    		exit;
    	}
    }
    
    if ( !$_COOKIE['adminID'] || !$_COOKIE['adminPassword'] )
    {
    	// this is dynamic page -  send headers to do not cache this page
    	send_headers_page_changed();
    	login_form( "", 1 );
    }
    and $logged['admin'] = member_auth( 1 );
    Last edited by Smoge; 11-26-2006 at 09:14 PM.
    ModMySite Administrator

    Problems? Questions? Need modifications or other help with your site?

    Open A Ticket , Send Us An Email Or Give Us A Telephone Call +1 518-632-4152.

  3. #3
    Vilela11
    Guest

    Default

    nevermind... fixed!
    for those whom have the same error you have to remote the the close parsel behind else:

    before:
    } else {
    after:
    else {
    Thanks

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Similar Threads

  1. help !!....admin panel
    By BUGGY in forum General Troubleshooting
    Replies: 5
    Last Post: 11-14-2007, 06:18 AM
  2. Admin Panel Mod's - More On the Way
    By Prometheus in forum Free Mod Exchange
    Replies: 0
    Last Post: 06-12-2006, 12:05 PM
  3. Messages from the admin panel
    By valentino in forum Wishlist
    Replies: 0
    Last Post: 11-01-2005, 11:54 PM
  4. can't log to admin panel!!!
    By Yair Czitrom in forum General Troubleshooting
    Replies: 2
    Last Post: 09-05-2005, 04:35 AM
  5. Need help with getting to Admin panel!
    By LG in forum General Troubleshooting
    Replies: 6
    Last Post: 07-03-2005, 12:15 PM

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
  •