Sami Posted August 16, 2011 Share Posted August 16, 2011 This code returns "Noen av feltene var ikke fyllt inn riktig."(Some of the fields were not filled in correctly.).it's supposed to redirect to login.php?s=1 <?phpif (CRYPT_BLOWFISH == 1){$username = mysql_real_escape_string($_POST["username"], $con);$password = mysql_real_escape_string(crypt($_POST["password"],$_POST["password"]), $con);$email = mysql_real_escape_string($_POST["email"], $con);$born = mysql_real_escape_string($_POST["born"], $con);}else{die("Kryptering er ikke støttet av serveren");}if (filter_var($_POST["email"], FILTER_VALIDATE_EMAIL)) {$emailisvalid="ok";}if($_POST["password"]==$_POST["password2"]){$passconfirmed="ok";}if($_POST["name"]){$nameset="ok";}if($_POST["password"]){$passet="ok";}if($passet=="ok" && $nameset=="ok" && $passconfirmed=="ok" && $emailisvalid=="ok") { mysql_query("INSERT INTO users (username,password,email,regdate,rank)VALUES ('$username', '$password', '$email',CURDATE(),'2')"); header("location: ./login.php?s=1"); }else { $error="Noen av feltene var ikke fyllt inn riktig."; } ?> Link to comment Share on other sites More sharing options...
Sami Posted August 16, 2011 Author Share Posted August 16, 2011 Nvm, I figured it out myself, but it's still not inserting the data in the database... Link to comment Share on other sites More sharing options...
justsomeguy Posted August 16, 2011 Share Posted August 16, 2011 Check for errors if the query fails, error messages from MySQL do not automatically get shown by PHP. Link to comment Share on other sites More sharing options...
Sami Posted August 16, 2011 Author Share Posted August 16, 2011 Check for errors if the query fails, error messages from MySQL do not automatically get shown by PHP.It wan't any "rank" field there. Link to comment Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.