Help with registration form? - Webmaster Forums - Webmaster forum for HTML, PHP, ASP, CSS and more
Webmaster Forums - Webmaster forum for HTML, PHP, ASP, CSS and more
Go Back   Webmaster Forums - Webmaster forum for HTML, PHP, ASP, CSS and more > Webmaster Tech > Programming > PHP Development

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
Old 02-02-2011, 10:44 AM   #1 (permalink)
Junior Member
 
Join Date: Feb 2011
Posts: 1
Default Help with registration form?

Hi, I really need help making a registration form.
This is the coding I'm using in my php file:
<?php

mysql_connect("localhost", "a7427972", "*********") or die (mysql_error());
mysql_select_db("a7427972_tulip") or die (mysql_error());

?>
<?php
$insert_query = 'insert into users (
email,
username,
password
)
values
(

"' . $_POST['email'] . '",
"' . $_POST['username'] . '",
"' . md5($_POST['password']) . '"
)';

mysql_query($insert_query);

?>

And I have a database with this info:

id_user int(11) NOT NULL No auto_increment
username varchar(16) NOT NULL latin1_general_ci
email varchar(64) NOT NULL latin1_general_ci
password varchar(32) NOT NULL latin1_general_ci

And my html is this:
<b><p>Register:</p></b>
<form name="registration_form" method="post" action="register.php"
onsubmit="return Validate();">
<p>Username:</p><input type="text" name="user">
<p>Email:</p><input type="text" name="email">
<p>Password:</p><input type="password" name="pwd">
<p>Confirm Password:</p><input type="password" name="conpwd">
<input type="submit" value="Register">
</form>

<script language = "Javascript">

function Validate()
{
if (document.registration_form.user.value == '')
{
alert('Please fill in your desired username!');
return false;
}
if (document.registration_form.email.value == '')
{
alert('Please fill in your email address!');
return false;
}
if (document.registration_form.pwd.value == '')
{
{
alert('Please fill in your desired password!');
return false;
}
if (document.registration_form.conpwd.value == '')
{
alert('Please fill in your password again for confirmation!');
return false;
}
if (document.registration_form.pwd.value !=
document.registration_form.conpwd.value)
{
alert("The two passwords are not identical! "+
"Please enter the same password again for confirmation");
return false;
}
return true;
}
</script>

But whenever I try to make a test account, this is what comes up:

Warning: mysql_connect() [function.mysql-connect]: Access denied for user 'a7427972'@'localhost' (using password: YES) in /home/a7427972/public_html/register.php on line 3


Access denied for user 'a7427972'@'localhost' (using password: YES)

Please help, I don't know why it's doing this, it's so frustrating.
TulipRox is offline   Reply With Quote
Sponsored Links
Old 02-12-2011, 06:18 PM   #2 (permalink)
Junior Member
 
Join Date: Feb 2011
Posts: 39
Default Re: Help with registration form?

As the error message explicity says (lol) check your database connection details.
Webby Dev Rob is offline   Reply With Quote
Old 02-12-2011, 10:59 PM   #3 (permalink)
Junior Member
 
JohnB's Avatar
 
Join Date: Feb 2011
Posts: 16
Default Re: Help with registration form?

Please read the php warning, Access denied for user 'a7427972'@'localhost' you got wrong user details for mysql.
JohnB is offline   Reply With Quote
Old 02-18-2011, 05:51 AM   #4 (permalink)
Regular User
 
hilhilginger's Avatar
 
Join Date: Dec 2010
Posts: 272
Default Re: Help with registration form?

If your password and dbuser is correct change the code to below. and define DB_SERVER,DB_USER,DB_PASS and DB_NAME.
$connection = mysql_connect(DB_SERVER, DB_USER, DB_PASS) or die(mysql_error());
mysql_select_db(DB_NAME, $connection) or die(mysql_error());
__________________
Unique Articles for SEO www.softnwords.com
hilhilginger is offline   Reply With Quote
Old 02-24-2011, 01:38 PM   #5 (permalink)
Junior Member
 
Join Date: Feb 2011
Posts: 16
Default Re: Help with registration form?

check your localhost...what are u using? xampp or wamp?
aokiji1 is offline   Reply With Quote
Reply

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On



» Sponsors

» Links

» Affiliates
Web Hosting
Online Backup Reviews
Marketing Find
Merchant Select
SiteMap Builder
Host Compare

» Links

» Sports Network
Paintball Forum
Football Forum
Hockey Forum
Golf Forum
Boxing Forum
Lacrosse Forum
Baseball Forum
SnowBoarding Forum
Soccer Forum
MMA Forum


All times are GMT -4. The time now is 04:32 PM.


Powered by vBulletin® Copyright ©2000 - 2012, Jelsoft Enterprises Ltd.
Search Engine Friendly URLs by vBSEO 3.3.2
Webmaster Forums
Web Hosting | Chicago Web Hosting | Web Hosting