title: form with in form in php
body: <p>i want to use form with in a form.
  i have the following code.</p>
  
  <pre><code>&lt;?php session_start(); 
  if(!isset($_SESSION['logged_in'])){
      echo "Sorry! You need to log in to add Information. &lt;a href='login.php'&gt;Login&lt;/a&gt;";
  } else {
  ?&gt;
  
  &lt;!DOCTYPE html&gt;
  &lt;html lang="en"&gt;
  &lt;head&gt;
    &lt;meta charset="utf-8"&gt;
    &lt;title&gt;iWant | in case you want anything&lt;/title&gt;
    &lt;meta name="viewport" content="width=device-width, initial-scale=1.0"&gt;
    &lt;meta name="description" content=""&gt;
    &lt;meta name="author" content=""&gt;
  
      &lt;!--link rel="stylesheet/less" href="less/bootstrap.less" type="text/css" /--&gt;
      &lt;!--link rel="stylesheet/less" href="less/responsive.less" type="text/css" /--&gt;
      &lt;!--script src="js/less-1.3.3.min.js"&gt;&lt;/script--&gt;
      &lt;!--append ‘#!watch’ to the browser URL, then refresh the page. --&gt;
  
      &lt;link href="css/bootstrap.min.css" rel="stylesheet"&gt;
      &lt;link href="css/bootstrap-responsive.min.css" rel="stylesheet"&gt;
      &lt;link href="css/bootstrap-fileupload.min.css" rel="stylesheet"&gt;
      &lt;link href="css/bootstrap-fileupload.css" rel="stylesheet"&gt;
      &lt;link href="css/style.css" rel="stylesheet"&gt;
      &lt;link rel="stylesheet" href="style.css" /&gt;
       &lt;script src="jquery.min.js"&gt;&lt;/script&gt;
  
    &lt;script src="upload.js"&gt;&lt;/script&gt;
  
    &lt;!-- HTML5 shim, for IE6-8 support of HTML5 elements --&gt;
    &lt;!--[if lt IE 9]&gt;
      &lt;script src="js/html5shiv.js"&gt;&lt;/script&gt;
    &lt;![endif]--&gt;
  
    &lt;!-- Fav and touch icons --&gt;
    &lt;link rel="apple-touch-icon-precomposed" sizes="144x144" href="img/apple-touch-icon-144-precomposed.png"&gt;
    &lt;link rel="apple-touch-icon-precomposed" sizes="114x114" href="img/apple-touch-icon-114-precomposed.png"&gt;
    &lt;link rel="apple-touch-icon-precomposed" sizes="72x72" href="img/apple-touch-icon-72-precomposed.png"&gt;
    &lt;link rel="apple-touch-icon-precomposed" href="img/apple-touch-icon-57-precomposed.png"&gt;
    &lt;link rel="shortcut icon" href="img/favicon.png"&gt;
  
      &lt;script type="text/javascript" src="js/jquery.min.js"&gt;&lt;/script&gt;
      &lt;script type="text/javascript" src="js/bootstrap.min.js"&gt;&lt;/script&gt;
      &lt;script type="text/javascript" src="js/scripts.js"&gt;&lt;/script&gt;
      &lt;script type="text/javascript" src="js/bootstrap-fileupload.js"&gt;&lt;/script&gt;
      &lt;script type="text/javascript" src="js/bootstrap-fileupload.min.js"&gt;&lt;/script&gt;
      &lt;script type="text/javascript" src="js/jquery.min.js"&gt;&lt;/script&gt;
  &lt;/head&gt;
  
  &lt;body&gt;
  &lt;div class="container-fluid"&gt;
      &lt;div class="row-fluid"&gt;
          &lt;div class="span4"&gt;
              &lt;h3&gt;
                  iWant | In Case U Want Anything
              &lt;/h3&gt;  
          &lt;/div&gt;
          &lt;div class="span4"&gt;
              &lt;form class="form-search"&gt;
                  &lt;input type="text" class="input-medium search-query"&gt; &lt;button type="submit" class="btn"&gt;Search&lt;/button&gt;
              &lt;/form&gt;
          &lt;/div&gt;
          &lt;div class="span4"&gt;
               &lt;a href="login.php" class="btn" type="button"&gt;Login&lt;/a&gt; &lt;a href="signup.php" class="btn" type="button"&gt;Sign Up&lt;/a&gt;
          &lt;/div&gt;
      &lt;/div&gt;
      &lt;div class="row-fluid"&gt;
          &lt;div class="span12"&gt;
              &lt;div class="navbar navbar-inverse"&gt;
                  &lt;div class="navbar-inner"&gt;
                      &lt;div class="container-fluid"&gt;
                           &lt;a data-target=".navbar-responsive-collapse" data-toggle="collapse" class="btn btn-navbar"&gt;&lt;span class="icon-bar"&gt;&lt;/span&gt;&lt;span class="icon-bar"&gt;&lt;/span&gt;&lt;span class="icon-bar"&gt;&lt;/span&gt;&lt;/a&gt; &lt;a href="index.php" class="brand"&gt;iWant&lt;/a&gt;
                          &lt;div class="nav-collapse collapse navbar-responsive-collapse"&gt;
                              &lt;ul class="nav"&gt;
                                  &lt;li&gt;
                                      &lt;a href="#"&gt;Home&lt;/a&gt;
                                  &lt;/li&gt;
                                  &lt;li&gt;
                                      &lt;a href="#"&gt;About iWant&lt;/a&gt;
                                  &lt;/li&gt;
                                  &lt;li&gt;
                                      &lt;a href="#"&gt;Contact iWant&lt;/a&gt;
                                  &lt;/li&gt;
                              &lt;/ul&gt;
                              &lt;ul class="nav pull-right"&gt;
                                  &lt;li&gt;
                                      &lt;a href="#"&gt;My iWant&lt;/a&gt;
                                  &lt;/li&gt;
                                  &lt;li class="divider-vertical"&gt;
                                  &lt;/li&gt;
                                  &lt;li class="dropdown"&gt;
                                       &lt;a data-toggle="dropdown" class="dropdown-toggle" href="#"&gt;Post Adds&lt;strong class="caret"&gt;&lt;/strong&gt;&lt;/a&gt;
                                      &lt;ul class="dropdown-menu"&gt;
                                          &lt;li&gt;
                                              &lt;a href="room.php"&gt;Room&lt;/a&gt;
                                          &lt;/li&gt;
                                          &lt;li&gt;
                                              &lt;a href="#"&gt;Hostel&lt;/a&gt;
                                          &lt;/li&gt;
                                          &lt;li&gt;
                                              &lt;a href="#"&gt;Apartment&lt;/a&gt;
                                          &lt;/li&gt;
                                          &lt;li&gt;
                                              &lt;a href="#"&gt;Land&lt;/a&gt;
                                          &lt;/li&gt;
                                          &lt;li&gt;
                                              &lt;a href="#"&gt;House&lt;/a&gt;
                                          &lt;/li&gt;
                                          &lt;li&gt;
                                              &lt;a href="#"&gt;Vehicles&lt;/a&gt;
                                          &lt;/li&gt;
                                          &lt;li&gt;
                                              &lt;a href="#"&gt;Hotels&lt;/a&gt;
                                          &lt;/li&gt;
                                          &lt;li&gt;
                                              &lt;a href="#"&gt;Mobile Phones&lt;/a&gt;
                                          &lt;/li&gt;
                                      &lt;/ul&gt;
                                  &lt;/li&gt;
                              &lt;/ul&gt;
                          &lt;/div&gt;
  
                      &lt;/div&gt;
                  &lt;/div&gt;
  
              &lt;/div&gt;
  
              &lt;div class="well"&gt;
  
              &lt;form id="Room Details" class="form-horizontal" method="get" action="roomKoDesc.php"&gt;
              &lt;?php echo "&lt;input type='hidden' name='clientId' value='".$_SESSION['clientId']."'&gt;"; ?&gt;
              &lt;legend&gt;Post Rooms&lt;/legend&gt;
              &lt;div class="control-group"&gt;
              &lt;label class="control-label"&gt;Contact Number&lt;/label&gt;
              &lt;div class="controls"&gt;
                  &lt;div class="input-prepend"&gt;
                      &lt;input type="text" class="input-xlarge" id="contact" name="contact" placeholder="Your Contact"&gt;
                  &lt;/div&gt;
              &lt;/div&gt;
          &lt;/div&gt;
          &lt;div class="control-group"&gt;
              &lt;label class="control-label"&gt;Location of Rooms&lt;/label&gt;
              &lt;div class="controls"&gt;
                  &lt;div class="input-prepend"&gt;
                      &lt;input type="text" class="input-xlarge" id="location" name="location" placeholder="rooms location"&gt;
                  &lt;/div&gt;
              &lt;/div&gt;
          &lt;/div&gt;
          &lt;div class="control-group "&gt;
              &lt;label class="control-label"&gt;Number of Rooms&lt;/label&gt;
              &lt;div class="controls"&gt;
                  &lt;div class="input-prepend"&gt;
                      &lt;input type="text" class="input-xlarge" id="number" name="number" placeholder="no. of rooms"&gt;
                  &lt;/div&gt;
              &lt;/div&gt;
          &lt;/div&gt;
          &lt;div class="control-group"&gt;
              &lt;label class="control-label"&gt;Price per Room&lt;/label&gt;
              &lt;div class="controls"&gt;
                  &lt;div class="input-prepend"&gt;
                      &lt;input type="text" class="input-xlarge" id="price" name="price" placeholder="price per room"&gt;
                  &lt;/div&gt;
              &lt;/div&gt;
          &lt;/div&gt;
          &lt;div class="control-group"&gt;
              &lt;label class="control-label"&gt;Sqare meter&lt;/label&gt;
              &lt;div class="controls"&gt;          
                    &lt;div class="input-prepend"&gt;
                      &lt;input type="text" class="input-xlarge" id="size" name="size" placeholder="Area of rooms"&gt;
                  &lt;/div&gt;
  
              &lt;/div&gt;
          &lt;/div&gt;
  
  
  
  
  
  
  
      &lt;div id ="main"&gt;
  
          &lt;form method="post" enctype="multipart/form-data"  action="upload.php"&gt;
              &lt;input type="file" name="images" id="images" multiple /&gt;
              &lt;button type="submit" id="btn"&gt;Upload Files!&lt;/button&gt;
          &lt;/form&gt;
  
      &lt;div id="response"&gt;&lt;/div&gt;
          &lt;ul id="image-list"&gt;
  
          &lt;/ul&gt;
      &lt;/div&gt;
  
  
  
          &lt;div class="control-group"&gt;
              &lt;label class="control-label"&gt;Description&lt;/label&gt;
              &lt;div class="controls"&gt;
                  &lt;div class="input-prepend"&gt;
                      &lt;textarea rows="4" cols="50" input type="text" class="input-xlarge" id="description" name="description" placeholder="Description"&gt;&lt;/textarea&gt;
  
                  &lt;/div&gt;
              &lt;/div&gt;
          &lt;/div&gt;
            &lt;input type="submit" class="btn btn-success" value="Submit" /&gt;
        &lt;/form&gt;
  
              &lt;/div&gt;
  
      &lt;/div&gt;
  &lt;/div&gt;
  &lt;/body&gt;
  &lt;/html&gt;
  &lt;?php } ?&gt;
  </code></pre>
  
  <p>my output looks like this <a href="http://i.stack.imgur.com/yepMi.png" rel="nofollow">Example</a></p>
  
  <p>But the submit button doesnot direct to another page.
  and the upload works<br>
  How can i make both the submit button work?
  Is there any easy procress to use nested form.</p>