Hello and welcome to our community! Is this your first visit?
Register
Enjoy an ad free experience by logging in. Not a member yet? Register.
Results 1 to 6 of 6
  1. #1
    New to the CF scene
    Join Date
    Sep 2012
    Location
    Wisconsin
    Posts
    4
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Unhappy Problem with mysql_connect()

    I'm getting the all-too-familiar error:

    Code:
    Warning: mysql_connect() [function.mysql-connect]: Access denied for user 'a8581140_evan'@'10.1.1.19' (using password: YES) in /home/a8581140/public_html/comicUPD.php on line 15
    This is not happening to me, but to my friend. It occurs when trying to upload an image to our site, but only to him. I can upload just fine, and so can my other friend.

    Here is the comicUPD.php:

    PHP Code:
    <?php

    //Get values from form 
    $Title $_REQUEST['Title'];
    $Title mysql_escape_string($Title);
    $Info $_REQUEST["Info"];
    $mysql_password $_REQUEST['Password'];
    $insertData '';
    $tbl_name $_REQUEST['which'];

    //print($tbl_name);


    // Connect to server and select database.
    $link mysql_connect('mysql3.***************''a8581140_evan''$mysql_password');
    $db = @mysql_select_db('a8581140_stuff'$mysql_password);

    if(!
    $link)
    {
        print(
    'wtf man');
    }
    else
    {

    if(
    $_FILES['comic']['size'] === 0){

    //header(put an error page here -upload failed or there was no picutre-)

    }
    else{

        
    $newName '';
        
    $imagedir '';
        if(
    $tbl_name === 'Archive'){
        
            
    $insertData '(`EpTitle`, `Epsilon`, `EpInfo`, `Date`)';
            
    $unique "" rand(0,1000);
            
    $newName '_Epsilon_' $unique;
            
    $imagedir "/home/a8581140/public_html/images/epsilon/";
        
        }
        else if(
    $tbl_name === 'Archive2'){
        
            
    $insertData '(`ReTitle`, `Realms`, `ReInfo`, `Date`)';
            
    $unique "" rand(0,1000);
            
    $newName '_REALMS_' $unique;
            
    $imagedir '/home/a8581140/public_html/images/REALMS/';
            
        }
        
        
    $_FILES['comic']['name'] = $Title $newName;
        
    $newfiledir $imagedir basename($_FILES['comic']['name']);
        if(
    move_uploaded_file($_FILES['comic']['tmp_name'], $newfiledir)){    
        
            
    //print('IT WORKED');    
        //    header(PUT THANKS FOR UPLOAD PAGE HERE)
        
        
    }
        else{
        
            print(
    'wtf man');
        }

    }
     
    $Comic " " $imagedir $_FILES['comic']['name'] . "."basename($_FILES['comic']['type'], 'image/');

    //print($Comic);

    //Insert data into mysql
    $sql "INSERT INTO a8581140_stuff.`$tbl_name` $insertData VALUES ('$Title', '$Comic', '$Info', NOW());";
    $result mysql_query($sql);

    header("Location: http://www.aimlessadventures.com/upload.html");
    }

    ?>
    Can someone tell me what went wrong here? If you need to see anything else, let me know.

  • #2
    God Emperor Fou-Lu's Avatar
    Join Date
    Sep 2002
    Location
    Saskatoon, Saskatchewan
    Posts
    16,987
    Thanks
    4
    Thanked 2,660 Times in 2,629 Posts
    Error is pretty clear. You failed to authenticate with the MySQL server. So one of the host, username, or password are incorrect, or the MySQL server isn't configured to allow connections from remote access.

  • #3
    New to the CF scene
    Join Date
    Sep 2012
    Location
    Wisconsin
    Posts
    4
    Thanks
    0
    Thanked 0 Times in 0 Posts
    Quote Originally Posted by Fou-Lu View Post
    Error is pretty clear. You failed to authenticate with the MySQL server. So one of the host, username, or password are incorrect, or the MySQL server isn't configured to allow connections from remote access.
    We have had 3 other people including myself use this upload form and script just fine, it's just this one person (who happens to be the person we made this site for) that can't connect. What do you think of that?

  • #4
    Super Moderator guelphdad's Avatar
    Join Date
    Mar 2006
    Location
    St. Catharines, Ontario Canada
    Posts
    2,634
    Thanks
    4
    Thanked 148 Times in 139 Posts
    Do you use the upload and form script with the same username and password as the user with the problem? If not then the username or password are likely the problem.

    you also don't use mysql_error in PHP to see what the mysql error message is exactly.

  • #5
    New to the CF scene
    Join Date
    Sep 2012
    Location
    Wisconsin
    Posts
    4
    Thanks
    0
    Thanked 0 Times in 0 Posts
    Quote Originally Posted by guelphdad View Post
    Do you use the upload and form script with the same username and password as the user with the problem? If not then the username or password are likely the problem.

    you also don't use mysql_error in PHP to see what the mysql error message is exactly.
    It should be the same username and password.

    You have to input the password when uploading for it to work, however, but he is putting the password in right and still getting the error.

  • #6
    Super Moderator guelphdad's Avatar
    Join Date
    Mar 2006
    Location
    St. Catharines, Ontario Canada
    Posts
    2,634
    Thanks
    4
    Thanked 148 Times in 139 Posts
    the error message you get means that an incorrect password is being used. so it couldn't be typed correctly.


  •  

    Posting Permissions

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