943,917 Members | Top Members by Rank

Ad:
You are currently viewing page 4 of this multi-page discussion thread; Jump to the first page
Dec 29th, 2008
0

Re: To create a registration page and login page

First, make sure that your site allows you to use php and gives you database access (usually mySQL).

When you finished making the files as instructed here, you have to upload those files to your site using FTP or whatever filemanager comes with your hosting package.
Reputation Points: 70
Solved Threads: 15
Posting Whiz
kanaku is offline Offline
378 posts
since Jan 2007
Dec 30th, 2008
0

Re: To create a registration page and login page

if i want to register on my website this comes :


PHP Error Message

HTML and CSS Syntax (Toggle Plain Text)
  1. Warning: mysql_pconnect() [function.mysql-pconnect]: Access denied for user 'UserName'@'localhost' (using password: YES) in /home/a4497797/public_html/dbConfig.php on line 12
  2.  
  3. Free Web Hosting
  4. Error connecting to database.
  5. PHP Error Message
  6.  
  7. Warning: mysql_select_db() [function.mysql-select-db]: Access denied for user 'nobody'@'localhost' (using password: NO) in /home/a4497797/public_html/dbConfig.php on line 20
  8.  
  9. Free Web Hosting
  10.  
  11. PHP Error Message
  12.  
  13. Warning: mysql_select_db() [function.mysql-select-db]: A link to the server could not be established in /home/a4497797/public_html/dbConfig.php on line 20
  14.  
  15. Free Web Hosting
  16.  
  17. PHP Error Message
  18.  
  19. Warning: mysql_query() [function.mysql-query]: Access denied for user 'nobody'@'localhost' (using password: NO) in /home/a4497797/public_html/register.php on line 39
  20.  
  21. Free Web Hosting
  22.  
  23. PHP Error Message
  24.  
  25. Warning: mysql_query() [function.mysql-query]: A link to the server could not be established in /home/a4497797/public_html/register.php on line 39
  26.  
  27. Free Web Hosting
  28.  
  29. PHP Error Message
  30.  
  31. Warning: mysql_insert_id() [function.mysql-insert-id]: A link to the server could not be established in /home/a4497797/public_html/register.php on line 42
  32.  
  33. Free Web Hosting
  34. Error: User not added to database.
Last edited by peter_budo; Jan 6th, 2009 at 9:38 am. Reason: Keep It Organized - For easy readability, always wrap programming code within posts in [code] (code blocks) and [icode] (inline code) tags.
Reputation Points: 10
Solved Threads: 0
Newbie Poster
Secret- is offline Offline
18 posts
since Dec 2008
Dec 30th, 2008
0

Re: To create a registration page and login page

Oh... there's something wrong with the details (or constants) you specified in your dbConfig.php file. This is the code provided in the 1st page of this thread (with comments):

<?
// Replace the variable values below
// with your specific database information.
$host = "localhost";
$user = "UserName";                                 
$pass = "Password";
$db   = "dbName";

// This part sets up the connection to the 
// database (so you don't need to reopen the connection
// again on the same page).
$ms = mysql_pconnect($host, $user, $pass);
if ( !$ms )
{
echo "Error connecting to database.\n";
}

// Then you need to make sure the database you want
// is selected.
mysql_select_db($db);
?>

The details in red are provided by your host. Most likely, you won't be changing $host = "localhost"; but you need the $user, $pass, and $db . Unfortunately, I can't get that for you since only you are supposed to know your password. The username ($user) and database name ($db) can be requested from your host.

You can't just guess values for that. Ask your host for those details. The script will work fine once you get those values.

Or if you use cpanel, I might be able to guide you into setting up a database.
Reputation Points: 70
Solved Threads: 15
Posting Whiz
kanaku is offline Offline
378 posts
since Jan 2007
Dec 30th, 2008
0

Re: To create a registration page and login page

Soo i need to change ;

$host = "localhost";
$user = "UserName"; << My UserName?
$pass = "Password"; << My Password?
$db = "dbName"; << My Database?
Reputation Points: 10
Solved Threads: 0
Newbie Poster
Secret- is offline Offline
18 posts
since Dec 2008
Dec 30th, 2008
0

Re: To create a registration page and login page

Quote ...
Soo i need to change:
$host = "localhost";
$user = "UserName"; << My UserName?
$pass = "Password"; << My Password?
$db = "dbName"; << My Database? 
Yup. (Don't post the username and password values here though!)
Reputation Points: 70
Solved Threads: 15
Posting Whiz
kanaku is offline Offline
378 posts
since Jan 2007
Dec 31st, 2008
0

Re: To create a registration page and login page

Okay thanks i will add you reputation
Reputation Points: 10
Solved Threads: 0
Newbie Poster
Secret- is offline Offline
18 posts
since Dec 2008
Dec 31st, 2008
0

Re: To create a registration page and login page

Dude i did ,, but now i get this :


PHP Error Message

HTML and CSS Syntax (Toggle Plain Text)
  1. Warning: mysql_pconnect() [function.mysql-pconnect]: Access denied for user 'a4497797'@'localhost' (using password: YES) in /home/a4497797/public_html/dbConfig.php on line 10
  2.  
  3. Free Web Hosting
  4. Error connecting to database.
  5. PHP Error Message
  6.  
  7. Warning: mysql_select_db() [function.mysql-select-db]: Access denied for user 'nobody'@'localhost' (using password: NO) in /home/a4497797/public_html/dbConfig.php on line 18
  8.  
  9. Free Web Hosting
  10.  
  11. PHP Error Message
  12.  
  13. Warning: mysql_select_db() [function.mysql-select-db]: A link to the server could not be established in /home/a4497797/public_html/dbConfig.php on line 18
  14.  
  15. Free Web Hosting
  16. Username:
  17. Password:
  18. Email Address:
Last edited by peter_budo; Jan 6th, 2009 at 9:39 am. Reason: Keep It Organized - For easy readability, always wrap programming code within posts in [code] (code blocks) and [icode] (inline code) tags.
Reputation Points: 10
Solved Threads: 0
Newbie Poster
Secret- is offline Offline
18 posts
since Dec 2008
Dec 31st, 2008
0

Re: To create a registration page and login page

soo it will like this ( it's a example) :

$host = "localhost";
$user = "Kevin";
$pass = "123456";
$db = "mysqladmin";

it's correct?
Reputation Points: 10
Solved Threads: 0
Newbie Poster
Secret- is offline Offline
18 posts
since Dec 2008
Dec 31st, 2008
0

Re: To create a registration page and login page

Wait... why are you connecting twice? (In line 10 and in line 18 of your dbConfig.php file)... Did you comment out the sample code properly?

And as I said, as long as the details/values are correct, you should be able to connect!

By the way, mysqladmin is most likely NOT your database name. It's something you can use to create databases and tables...

Can you post your dbConfig.php file? Be sure to comment out the values like this:
<?
// Replace the variable values below
// with your specific database information.
$host = "XXXXXXXX";
$user = "XXXXXXX";
$pass = "XXXXXXXX";
$db   = "XXXXXX";

// This part sets up the connection to the 
// database (so you don't need to reopen the connection
// again on the same page).
$ms = mysql_pconnect($host, $user, $pass);
if ( !$ms )
{
echo "Error connecting to database.\n";
}

// Then you need to make sure the database you want
// is selected.
mysql_select_db($db);
?>

Because I think you've accidentally made two sets of connection variables in your config file (thus the double-connection error).
Reputation Points: 70
Solved Threads: 15
Posting Whiz
kanaku is offline Offline
378 posts
since Jan 2007
Dec 31st, 2008
0

Re: To create a registration page and login page

K i post my dbConfig.php here it is :

php Syntax (Toggle Plain Text)
  1. <?
  2. [COLOR="Red"]$host = "XXXXX";
  3. $user = "XXXXXX";
  4. $pass = "XXXXX!";
  5. $db = "XXXXXX";[/COLOR]
  6.  
  7. // This part sets up the connection to the
  8. // database (so you don't need to reopen the connection
  9. // again on the same page).
  10. $ms = mysql_pconnect($host, $user, $pass);
  11. if ( !$ms )
  12. {
  13. echo "Error connecting to database.\n";
  14. }
  15.  
  16. // Then you need to make sure the database you want
  17. // is selected.
  18. mysql_select_db($db);
  19. ?>


Btw the "XXX'S" are NOT MY REAL DETAILS
Last edited by peter_budo; Jan 6th, 2009 at 9:40 am. Reason: Keep It Organized - For easy readability, always wrap programming code within posts in [code] (code blocks) and [icode] (inline code) tags.
Reputation Points: 10
Solved Threads: 0
Newbie Poster
Secret- is offline Offline
18 posts
since Dec 2008

This thread is more than three months old

No one has posted to this discussion for at least three months. Please let old threads die and do not reply to them unless you feel you have something new and valuable to contribute that absolutely must be added to make the discussion complete. Otherwise, please start a new thread in this forum instead.
This thread is currently closed and is not accepting any new replies.
Previous Thread in HTML and CSS Forum Timeline: text moving in rectangular shape
Next Thread in HTML and CSS Forum Timeline: CSS float image and text inline with image





About Us | Contact Us | Advertise | Acceptable Use Policy
Forum Index | Build Custom RSS Feed


Follow us on Twitter


© 2011 DaniWeb® LLC