vtgowtham1993 Posted March 3, 2014 Share Posted March 3, 2014 hi there.. i have try to run this code but it shows only the header file but it wont show the register form... what is the way to show both header and the form ie register form..... <?php require 'connect.php'; if(isset($_POST['first_name'])&&isset($_POST['email_id'])&&isset($_POST['user_name'])&&isset($_POST['password'])){ $first_name = $_POST['first_name']; $sur_name = $_POST['sur_name']; $email_id = $_POST['email_id']; $user_name = $_POST['user_name']; $password = $_POST['password']; $password_mdd = md5($password); if(!empty($first_name)&&!empty($sur_name)&&!empty($email_id)&&!empty($user_name)&&!empty($password)){ $query_first_name = mysql_query("INSERT INTO user(first_name,sur_name,email_id,user_name,password,password_mdd) value('$first_name','$sur_name','$email_id','$user_name','$password','$password_mdd')"); }else{ echo 'Plese fill all field'; } } ?> <html> <head> <link rel="stylesheet" href="style.css" type="text/css" charset="utf-8" /> <body> <div id="header"> <img src="images/logo.png" width="124" height="98" /> </div> <div id="nav"> <ul> <li class="first"><a href="home.php"><em>H</em>OME</a></li> <li><a href="resume.php"><em>R</em>ESUME</a></li> <li><a href="photo.php"><em>P</em>HOTOS</a></li> <li><a href="contact.php"><em>C</em>ONTACTS</a></li> <span><li><a href="index.php"><em>S</em>IGN IN</a><em>/</em><a href="sign_up.php"><em>S</em>IGN UP</a></li></span> </ul> </div> </body> <div id='center'> <form action="sign_up.php" method="POST"> SIGN UP<br><br> First Name:<input type="text" name="first_name" ><br> Sur Name:<input type="text" name="sur_name"><br> Email id: <input type="text" name="email_id"><br> Username:<input type="text" name="user_name"><br> Password:<input type="password" name="password"><br> <input type="Register" value="Sign Up"> </form> </div> </html> Quote Link to comment https://forums.phpfreaks.com/topic/286677-not-display-the-form/ Share on other sites More sharing options...
gristoi Posted March 3, 2014 Share Posted March 3, 2014 turn on your error checking Quote Link to comment https://forums.phpfreaks.com/topic/286677-not-display-the-form/#findComment-1471337 Share on other sites More sharing options...
gristoi Posted March 3, 2014 Share Posted March 3, 2014 (edited) put user in backticks too Edited March 3, 2014 by gristoi Quote Link to comment https://forums.phpfreaks.com/topic/286677-not-display-the-form/#findComment-1471338 Share on other sites More sharing options...
WebStyles Posted March 4, 2014 Share Posted March 4, 2014 A few things to consider: - What's the point of hashing the password if you're going to store the plaintext one too?- You should not use md5 for password hashing. - You should sanitize the fields properly before inserting into database - empty() will also check if variable exists, so using isset() on all variables and then empty() is redundant - Your sql statement should say VALUES and not VALUE Quote Link to comment https://forums.phpfreaks.com/topic/286677-not-display-the-form/#findComment-1471378 Share on other sites More sharing options...
vtgowtham1993 Posted March 4, 2014 Author Share Posted March 4, 2014 (edited) That's above condition are ok and also i turn on the error checking set as E_ALL.. but i want to show both the title bar and the register form... Edited March 4, 2014 by vtgowtham1993 Quote Link to comment https://forums.phpfreaks.com/topic/286677-not-display-the-form/#findComment-1471387 Share on other sites More sharing options...
cyberRobot Posted March 4, 2014 Share Posted March 4, 2014 Perhaps you just need to validate the code? http://validator.w3.org/ One issue with the HTML code is that you closed the body tag before the form is displayed. The body tag should be right before the close html tag. </body> </html> Also, you should look into the following function: http://www.php.net/mysql_real_escape_string And in case you're not aware...the mysql_ function have been depreciated. At some point you'll need to look into an alternative database connection: http://www.php.net/manual/en/mysqlinfo.api.choosing.php Quote Link to comment https://forums.phpfreaks.com/topic/286677-not-display-the-form/#findComment-1471428 Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.