/    Sign up×
Community /Pin to ProfileBookmark

Making A Register Thing

I am trying to make a thing for users to register… and it doesnt work ? . Here is my script:

[code=php]
<?
$username = $HTTP_POST_VARS[‘txtName’];
$password = $HTTP_POST_VARS[‘txtPassword’];

$rs = mysql_query(“SELECT * FROM myUsers WHERE Name = ‘$username’ AND Password = ‘$password’ “);

if (mysql_num_rows($rs)>0)
{
echo(“The user already exists, please try again”);
}
else
{
//the user does not exist set him into the user table
INSERT INTO myUsers VALUES (2, $username,$password);

echo(“You have registered”);
}
?>
[/code]

And the register is here: [url]http://www.freepgs.com/jonanin/register.php[/url]

The error is: The requested method POST is not allowed for the URL /jonanin/registerResults.php.

Thanks in advance,
~Jon

to post a comment
PHP

1 Comments(s)

Copy linkTweet thisAlerts:
@mpfeif101May 16.2004 —  INSERT INTO myUsers VALUES (2, $username,$password);[/QUOTE]

you don't have a mysql_query for your insert into and you don't explain values

Shouldn't that be:

mysql_query("INSERT INTO myUsers SET ???='2',Name='$username',Password='$password'");
×

Success!

Help @jontheman12 spread the word by sharing this article on Twitter...

Tweet This
Sign in
Forgot password?
Sign in with TwitchSign in with GithubCreate Account
about: ({
version: 0.1.9 BETA 6.17,
whats_new: community page,
up_next: more Davinci•003 tasks,
coming_soon: events calendar,
social: @webDeveloperHQ
});

legal: ({
terms: of use,
privacy: policy
});
changelog: (
version: 0.1.9,
notes: added community page

version: 0.1.8,
notes: added Davinci•003

version: 0.1.7,
notes: upvote answers to bounties

version: 0.1.6,
notes: article editor refresh
)...
recent_tips: (
tipper: @nearjob,
tipped: article
amount: 1000 SATS,

tipper: @meenaratha,
tipped: article
amount: 1000 SATS,

tipper: @meenaratha,
tipped: article
amount: 1000 SATS,
)...