oceanier
oceanier

Reputation: 87

Html hidden input data is not passed in url

I used a hidden input field but its data is not shown in the url when I submit the form.

Here is the field:

<input type="hidden" id="id" name="id" >

And when I submit the form, its value is not shown in the url:

http://localhost/service/service.php?action=update_details&name='.kishor .'&lname='.patil .'&email='[email protected] .'&username='.kishor123 .'&password='.1254.'&gender='.male.'&mobile='.9563201487 .'&address='.ads sd fds f.'id1='

I retrieve all form values through post using this code:

 $id = $_GET["edit_id"];
  if(isset($_POST["submit"]))
         {

            $id1 = $_POST["id"];
            $name1=($_POST['name']);
            $lname1=($_POST['lname']);
            $email1=($_POST['email']);
            $username1=($_POST['username']);
            $password1=($_POST['password']);
            $mobile1=($_POST['mobile']);
            $address1=($_POST['address']);
            $gender1=($_POST['gender']);
          }

Upvotes: 1

Views: 1662

Answers (1)

Rafael Shkembi
Rafael Shkembi

Reputation: 776

So what's the problem. You have create a input type which is hidden, no problem with that but you have not assign a value on it. Every input has to have a value. In your case you didn't assign a value on it.

<input type="hidden" id="id" name="id" value="'.$id.'">

Upvotes: 3

Related Questions