Username:
Password:
Remember me:
Register

Back to forum: Web Programming (HTML, JS, CSS, PHP, MySQL)


Search forums via Google


0 Users appreciate this thread.

Access denied error
Started by PLMasterSSB
(2013-07-03 23:54:15)
PLMasterSSB (2013-07-03 23:54:15)
I got my registration script, but when I enter all the information in the script in order to connect to the database, I always says:

Warning: mysql_connect() [function.mysql-connect]: Access denied for user 'buddy'@'localhost' (using password: NO) in /home/buddy/public_html/confirm.php on line 65
Access denied for user 'buddy'@'localhost' (using password: NO)

do you guys know why this is happening?
SPCOxion (2013-07-04 01:44:46)
Please show the script you're using.
PLMasterSSB (2013-07-04 02:28:37)
Ok, but the script will already have my connection in it

This post has been edited one or more times, the last time was:
2013-07-04 09:28:53

PLMasterSSB (2013-07-04 02:31:33)
<html>

<head>

<title>Registration </title>

</head>

<body>

<form name="reg_form" id="reg_form" method="post" action="confirm.php">

<table>

<tr><td colspan="2"><?php echo isset($_GET["msg"])?$_GET["msg"]:"";?>
</td></tr>

<tr><td>Username</td><td><input type="text" name="username" id="username" />
</td></tr>

<tr><td>Password</td><td><input type="password" name="password" id="password" />
</td></tr>

<tr><td>confirm</td><td><input type="password" name="confirm" id="confirm" />
</td></tr>


<tr><td></td><td><input type="submit" name="btnsubmit" id="btnsubmit" /></td></tr>

</table>

</form>

</body>

</html>






<?php

$username=isset($_POST["username"])?$_POST["username"]:"";

$password=isset($_POST["password"])?$_POST["password"]:"";

$confirm=isset($_POST["confirm"])?$_POST["confirm"]:"";

if(!empty($username)&&!empty($password)){

if($password!=$confirm)

header("location:registration.php?msg=Password does not be match.";

$host="Localhost";

$user="buddy_GOKU";

$pass="GoToSleep";

///open connection

$link = mysql_connect($Localhost, $buddy_GOKU , $GoToSleep) or die(mysql_error());

mysql_select_db("buddy_BUDDY",$link);

define("DBHOST", "Localhost";
define("DBUSER", "buddy_GOKU";
define("DBPWD", "GoToSleep";
define("DBNAME", "buddy_BUDDY";

$query="SELECT * FROM users WHERE username='".mysql_escape_string($username)."'";

$result=mysql_query($query);

//count no of rows

$count=mysql_num_rows($result);

if($count==1){

header("location:registration.php?msg=username already exists";

}

else

{

$qry="INSERT INTO users(username,password)VALUES('".mysql_escape_string($username)."'
,'".mysql_escape_string($password)."'";

mysql_query($qry);

echo "You are successfully registered.";

}

mysql_close($link);




}

else

{



}


(Capt.)Orb (2013-07-04 03:08:21)
Make sure the mysql info is correct, and make sure you add the user to the database.
Aviation fact: The a380 is the largest commerical aircraft in service!

Go to Splashiverse! Splashiverse
PLMasterSSB (2013-07-04 03:28:17)
I did, the user is buddy_GOKU, and I use that and it still says the error, and yes, I set it to have all privileges
PLMasterSSB (2013-07-04 16:58:08)
Well the register page link is this

But the home page is this
PLMasterSSB (2013-07-04 17:41:46)
Well my database name is buddy_BUDDY and then my username is buddy, and then my password is (none of your business) and I know it can't be my password
PLMasterSSB (2013-07-06 13:06:50)
Don't you see that in there?

It's fixed. You guys can register to my site, but just register. I have to make a login system. register to 3DSUniverse
(There are more files to that site, right now I just want you to register)

This post has been edited one or more times, the last time was:
2013-07-13 21:56:48

 

Log in to submit a comment

This topic's ID: 49346

Back to forum: Web Programming (HTML, JS, CSS, PHP, MySQL)




Total registered users: 8322
New registered users today: 8
Newest registered user: Dolce21dsisBack

©  Copyright 2026 3DSPlaza. All Rights Reserved