To create a registration page and login page

Reply

Join Date: Jan 2007
Posts: 276
Reputation: kanaku is on a distinguished road 
Solved Threads: 15
kanaku's Avatar
kanaku kanaku is offline Offline
Posting Whiz in Training

Re: To create a registration page and login page

 
0
  #31
Dec 29th, 2008
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.
Reply With Quote Quick reply to this message  
Join Date: Dec 2008
Posts: 18
Reputation: Secret- is an unknown quantity at this point 
Solved Threads: 0
Secret-'s Avatar
Secret- Secret- is offline Offline
Newbie Poster

Re: To create a registration page and login page

 
0
  #32
Dec 30th, 2008
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.
Reply With Quote Quick reply to this message  
Join Date: Jan 2007
Posts: 276
Reputation: kanaku is on a distinguished road 
Solved Threads: 15
kanaku's Avatar
kanaku kanaku is offline Offline
Posting Whiz in Training

Re: To create a registration page and login page

 
0
  #33
Dec 30th, 2008
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.
If you know ASP, you can save other daniweb members from idiots like me by helping out in this forum.

Visit this thread
if your username starts with one of the following letters: B D F H J L N P R T X Y Z.
Reply With Quote Quick reply to this message  
Join Date: Dec 2008
Posts: 18
Reputation: Secret- is an unknown quantity at this point 
Solved Threads: 0
Secret-'s Avatar
Secret- Secret- is offline Offline
Newbie Poster

Re: To create a registration page and login page

 
0
  #34
Dec 30th, 2008
Soo i need to change ;

$host = "localhost";
$user = "UserName"; << My UserName?
$pass = "Password"; << My Password?
$db = "dbName"; << My Database?
Reply With Quote Quick reply to this message  
Join Date: Jan 2007
Posts: 276
Reputation: kanaku is on a distinguished road 
Solved Threads: 15
kanaku's Avatar
kanaku kanaku is offline Offline
Posting Whiz in Training

Re: To create a registration page and login page

 
0
  #35
Dec 30th, 2008
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!)
If you know ASP, you can save other daniweb members from idiots like me by helping out in this forum.

Visit this thread
if your username starts with one of the following letters: B D F H J L N P R T X Y Z.
Reply With Quote Quick reply to this message  
Join Date: Dec 2008
Posts: 18
Reputation: Secret- is an unknown quantity at this point 
Solved Threads: 0
Secret-'s Avatar
Secret- Secret- is offline Offline
Newbie Poster

Re: To create a registration page and login page

 
0
  #36
Dec 31st, 2008
Okay thanks i will add you reputation
Reply With Quote Quick reply to this message  
Join Date: Dec 2008
Posts: 18
Reputation: Secret- is an unknown quantity at this point 
Solved Threads: 0
Secret-'s Avatar
Secret- Secret- is offline Offline
Newbie Poster

Re: To create a registration page and login page

 
0
  #37
Dec 31st, 2008
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.
Reply With Quote Quick reply to this message  
Join Date: Dec 2008
Posts: 18
Reputation: Secret- is an unknown quantity at this point 
Solved Threads: 0
Secret-'s Avatar
Secret- Secret- is offline Offline
Newbie Poster

Re: To create a registration page and login page

 
0
  #38
Dec 31st, 2008
soo it will like this ( it's a example) :

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

it's correct?
Reply With Quote Quick reply to this message  
Join Date: Jan 2007
Posts: 276
Reputation: kanaku is on a distinguished road 
Solved Threads: 15
kanaku's Avatar
kanaku kanaku is offline Offline
Posting Whiz in Training

Re: To create a registration page and login page

 
0
  #39
Dec 31st, 2008
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).
If you know ASP, you can save other daniweb members from idiots like me by helping out in this forum.

Visit this thread
if your username starts with one of the following letters: B D F H J L N P R T X Y Z.
Reply With Quote Quick reply to this message  
Join Date: Dec 2008
Posts: 18
Reputation: Secret- is an unknown quantity at this point 
Solved Threads: 0
Secret-'s Avatar
Secret- Secret- is offline Offline
Newbie Poster

Re: To create a registration page and login page

 
0
  #40
Dec 31st, 2008
K i post my dbConfig.php here it is :

  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.
Reply With Quote Quick reply to this message  
Reply

Message:




Views: 43536 | Replies: 63
Thread Tools Search this Thread



Tag cloud for HTML and CSS
About Us | Contact Us | Advertise | DaniWeb | Acceptable Use Policy | RSS Feed

©2003 - 2009 DaniWeb® LLC