/    Sign up×
Community /Pin to ProfileBookmark

Password Protection Script

Everytime i try registering it says, “Would you want Password Manager to change the password for Webmaster”. Then if I click yes or cancel it takes my to a page saying that post is not allowed. My database name is bobbob95_1. What is wrong with my code:

[code=php]<?

$conn = mysql_connect(“localhost”,”bobbob95_1″,”010292″);

$db = mysql_select_db(“bobbob95_db”);

$username = $_POST[“username”];

$password = $_POST[“password”];

$email = $_POST[“email”];

$result= MYSQL_QUERY(“INSERT INTO users (id, username, password, email)”.

“VALUES (‘NULL’, ‘$username’, ‘$password’, ‘$email’)”);

echo “Your Username and Password have been submitted :)”;

?> [/code]

to post a comment
PHP

5 Comments(s)

Copy linkTweet thisAlerts:
@NogDogNov 24.2005 — I'm guessing that particular error has nothing to do with your PHP code. My suspicion is it's either something in the way your HTML form calls the script, or your web server configuration.
Copy linkTweet thisAlerts:
@redfoxNov 24.2005 — try going to you php.ini file, open it, find register_global and turn it on, your codes looks good, no problem whatsoever, or try instead $_POST["username"]; use $HTTP_POST_VARS["username"];
Copy linkTweet thisAlerts:
@redfoxNov 24.2005 — or try to debug your codes to see the problem simply place code like this

example:

$conn = mysql_connect("localhost","bobbob95_1","010292") or die("error in line $conn");

add 'or die' to the lines you want to see;
Copy linkTweet thisAlerts:
@BOB101authorNov 24.2005 — I have tried a new scripts and they all say the same thing. Please give me your suggestions:
[code=php]<? php
@mysql_connect("localhost", "zipzapgamingt", "010292") or die("Cannot connect to DB!");
@mysql_select_db("tbl_login") or die("Cannot select DB!");
$sql="INSERT INTO login_tbl (loginid, password and email) VALUES (".$loginid.”,”.$password.”,”.$email.”)”;
$r = mysql_query($sql);
if(!$r) {
$err=mysql_error();
print $err;
exit();
}
?>[/code]
Copy linkTweet thisAlerts:
@redfoxNov 24.2005 — i don't see anything wrong with your codes, my suspicion ist that the value that you pass, if you could paste your codes , the one that passes the value to your insert, maybe i could trace the problem,

question:

are you running it in your local server(runs on your pc)

or do you have it hosted by other web server, because if it does, it might be the web servers configuration, i encountered one before which i use the password syntax in mysql, and their configuration did not work for it, or they may be running an older version of php, mysql or web server , whichever, which some codes does not work
×

Success!

Help @BOB101 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 5.5,
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: @Yussuf4331,
tipped: article
amount: 1000 SATS,

tipper: @darkwebsites540,
tipped: article
amount: 10 SATS,

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