Thursday 15 April 2010

php - Registration not working -



php - Registration not working -

the registration process ends redirection user doesn't added database. tried , can't see issue. if need inquire , i'll edit post content or explanation.

<?php $cookie="td2h6"; $jucatoru = $_post['numeleluii']; $passw = $_post['pass']; $email = $_post['mail']; $con=mysqli_connect("xx","xx","xxx","xx"); if (mysqli_connect_errno()) { echo "failed connect mysql: " . mysqli_connect_error(); } $jucatoru = $con->real_escape_string($jucatoru); $passw = $con->real_escape_string($passw); $email = $con->real_escape_string($email); if(strlen($jucatoru)>1) { $crypt = md5($passw); $result = mysqli_query($con,"insert `users` (username,password,mail) values ($jucatoru,$crypt,$email);"); $data = "name=" . $jucatoru . "&pass=" . md5($passw); setcookie ( $cookie, $data, time()+60*60*24 ); header("location: http://r4ge.ro"); die; } echo "<div class=\"box box-info\"> <i class=\"ion-locked\"></i> <h3 class=\"box-title\">register</h3> </div> <form action=\"/php/register.php\" method=\"post\"> <div class=\"form-group\"> <input class=\"form-control\" type=\"text\" name=\"numeleluii\" value=\"\" placeholder=\"username:\"/><br /> </div> <div class=\"form-group\"> <input class=\"form-control\" type=\"email\" name=\"mail\" value=\"\" placeholder=\"e-mail: example@domain.tdl\"/><br /> </div> <div class=\"form-group\"> <input class=\"form-control\" type=\"password\" name=\"pass\" value=\"\"placeholder=\"password:\" /><br /> </div> <div class=\"box-footer clearfix\"> <input class=\"pull-right btn btn-default\" type=\"submit\" name=\"send\" value=\"send\" /> </div> </form> </div>"; mysqli_close($con); ?>

syntax error.

$result = mysqli_query($con,"insert `users` (username,password,mail) values ($jucatoru,$crypt,$email)");

php mysql sql

No comments:

Post a Comment