The following code is for a sign up form and comes auto generated from the WYSIWYG Web Builder. It keeps saying I need help with this: Only id 'password1', but it is not used in post data password and
confirmpassword is not the same. I do not know anything about PHP, so I can not find the error.
& lt; Php $ mysql_server = 'db4free pure'; $ Mysql_username = '----'; $ Mysql_password = '----'; $ Mysql_database = '----'; $ Mysql_table = 'userdb'; $ Success_page = './userpage.php'; $ Error_message = ""; If ($ _SERVER [ 'REQUEST_METHOD'] == 'POST' and amp; $ amp; $ amp; $ amp; $ [_POST [ 'form_name'] == 'Sainapform') {$ newusername = $ _POST [ 'username1' ]; $ Newemail = $ _POST ['email']; $ Newpassword = $ _POST ['password1']; $ Confirmpassword = $ _POST ['Confirm Password']; $ Newfullname = $ _POST ['Full name']; $ Code = 'NA'; If ($ newpassword! = $ Confirmpassword) {$ error_message = 'Confirm password and password are not the same!'; } And if (Preg_match ("/ ^ [A-Za-z0- 9 _! $ $ {{1,50} $ /", $ newusername)) {$ error_message = 'Username is not valid, please check And try again! '; } Else if (! Preg_match ( "/ ^ [A-Za-z0- 9 _! $ $ {$ 1,50} $ /", $ newpassword)) {$ error_message = 'password is not valid, please Czech and Try again! '; } Else if (! Preg_match ( "/ ^ [A-Za-z0- 9 _! $ $. '& Amp;] {1,50} $ /", $ newfullname)) {$ error_message =' Puarnnam is not valid , Please check and try again! '; } And if (Preg_match ("/^.+@ ++++++", $ newemail)) {$ error_message = 'Email is not a valid email address, please check and try again.'; } If (empty ($ error_message)) {$ db = mysql_connect ($ mysql_server, $ mysql_username, $ mysql_password); If (! $ Db) {die ('Failed to connect to database server! & Lt; br & gt;' Mysql_error ()); } Failed to select mysql_select_db ($ mysql_database, $ db) or die ('databases & lt; br & gt;' mysql_error ()); $ Sql = "Select by username". $ Mysql_table "WHERE user name = '". $ Newusername "; $ Result = mysql_query ($ sql, $ db); if ($ data = mysql_fetch_array ($ result)) {$ error_message = 'username already used Please choose another username.';}} If ( empty ($ Error_ message)) {$ crypt_pass = md5 ($ newpassword); $ Newusername = mysql_real_escape_string ($ newusername); $ Newemail = mysql_real_escape_string ($ newemail); $ Newfullname = mysql_real_escape_string ($ newfullname); $ Sql = " INSERT "" $ mysql_table "" ( `username ',` Pasward`, `Puarnnam`,` Imel`, `Skriy`,` Kod`) values (' $ newusername ',' $ crypt_pass '' $ Newfullname ',' $ Newemail ', 1,' $ code ') "; $ result = mysql_query ($ sql, $ db); mysql_close ($ database); $ theme = 'Your new account'; $ Message = 'A new account has been created.'; $ Message. = "\ R \ nUsername:" $ message = $ Newusername; $ message. = "\ R \ n Password: "$ message. = $ Newpassword; $ message. =" \ R \ n "; $ Header =" From: webmaster@yourwebsite.com "." \ R \ n "; $ header. =" Reply-To : Webmaster @ your website. " \ R \ n "; $ header. =" MIME-Version: 1.0 "." \ R \ n "; $ header. =" Content-type: text / plain; Charset = UTF-8 "." \ R \ n "; $ header. =" Content-Transfer-Encoding: 8 bit "." \ R \ n "; $ header. =" X-Mailer: PHP V ".phpversion Header ('location:'. $ Success_page); go outside;}}? & Gt; Field 'password1' is actually the name of 'password' ('$', '$', '$'
No comments:
Post a Comment