Jump to content

PHP Config


jayerpelo

Recommended Posts

Well that screenshot has nothing to do with MySQL.

 

The errors in the screenshot is from PHP.

 

The undefined index errors are caused because the script is trying to access an associative array with an index that doesn't exist. This is due to the scripts poor coding.

 

There is probably code like

if($some_var['some_index']) {
    // do something
}

Which should be

if(isset($some_var['some_index'])) {
    // do something
}
Link to comment
Share on other sites

this is the code example for Notice: Undefined index: submit in C:\wamp\www\payroll\index.php on line 39, can you help me sir via teamviewer?

if($_POST['submit']=='Login')
{
    // Checking whether the Login form has been submitted
    
    $err = array();
    // Will hold our errors
    
    
    if(!$_POST['username'] || !$_POST['password'])
        $err[] = 'All the fields must be filled in!';
    
    if(!count($err))
    {
        $_POST['username'] = mysql_real_escape_string($_POST['username']);
        $_POST['password'] = mysql_real_escape_string($_POST['password']);
        $_POST['rememberMe'] = (int)$_POST['rememberMe'];
        
        // Escaping all input data

        $row = mysql_fetch_assoc(mysql_query("SELECT * FROM user WHERE username='{$_POST['username']}' AND password='".md5($_POST['password']."NizarRahmat")."'"));

        if($row['username'])
        {
            // If everything is OK login
            
            $_SESSION['blocked'] = $row['blocked'];
            
            // Store some data in the session
            if($_SESSION['blocked'] == 0) {
                $_SESSION['userid']= $row['userid'];
                $_SESSION['username'] = $row['username'];
                $_SESSION['accessid'] = $row['accessid'];
                $_SESSION['rememberMe'] = $_POST['rememberMe'];
                setcookie('tzRemember',$_POST['rememberMe']);
            }
            else $err[]='User is blocked! please contact Administrator!!';
            
        }
        else $err[]='Wrong username and/or password!';
    }
    
    if($err)
    $_SESSION['msg']['login-err'] = implode('<br />',$err);
    // Save the error messages in the session

    header("Location: index.php");
    exit;
}

 

awt.jpg

Link to comment
Share on other sites

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.