Jump to content

Not display the form


Recommended Posts

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.....





require 'connect.php';


  $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);


    $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')");


    echo 'Plese fill all field';








<link rel="stylesheet" href="style.css" type="text/css" charset="utf-8" />



<div id="header">

<img src="images/logo.png" width="124"  height="98" />



<div id="nav">


<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>





<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">




Link to comment
Share on other sites

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

Link to comment
Share on other sites

Perhaps you just need to validate the code?



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.


Also, you should look into the following function:



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:



Link to comment
Share on other sites

This thread is more than a year old. Are you sure you have something important to add to it?

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.