title: Changing ID Chosen Being dropdown PHP
body: <p>I have a script for the forum. By default, users can only post if it has opened the site to determine the parent first.
  For example <code>domain.com/new.php?parent=3</code></p>
  
  <p>Here I am trying to modify using the dropdown.
  For example:
  OPTION 1 (value1)
  OPTION 2 (value2)
  OPTION 3 (value3)</p>
  
  <p>I add <code>$parent=$_POST['parent'];</code> following the example of the <code>$title=$_POST['title'];</code> But always failed.</p>
  
  <p>Is there a solution?</p>
  
  <p><strong>CODE:</strong></p>
  
  <pre><code>&lt;?php
  //This page let users create new topics
  include('config.php');
  if(isset($_GET['parent']))
  {
      $id = intval($_GET['parent']);
  if(isset($_SESSION['username']))
  {
      $dn1 = mysql_fetch_array(mysql_query('select count(c.id) as nb1, c.name from categories as c where c.id="'.$id.'"'));
  if($dn1['nb1']&gt;0)
  {
  ?&gt;
  &lt;!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"&gt;
  &lt;html xmlns="http://www.w3.org/1999/xhtml"&gt;
      &lt;head&gt;
          &lt;meta http-equiv="Content-Type" content="text/html; charset=utf-8" /&gt;
          &lt;link href="&lt;?php echo $design; ?&gt;/style.css" rel="stylesheet" title="Style" /&gt;
          &lt;title&gt;New Topic - &lt;?php echo htmlentities($dn1['name'], ENT_QUOTES, 'UTF-8'); ?&gt; - Forum&lt;/title&gt;
          &lt;script type="text/javascript" src="functions.js"&gt;&lt;/script&gt;
      &lt;/head&gt;
      &lt;body&gt;
          &lt;div class="header"&gt;
              &lt;a href="&lt;?php echo $url_home; ?&gt;"&gt;&lt;img src="&lt;?php echo $design; ?&gt;/images/logo.png" alt="Forum" /&gt;&lt;/a&gt;
          &lt;/div&gt;
          &lt;div class="content"&gt;
  &lt;?php
  $nb_new_pm = mysql_fetch_array(mysql_query('select count(*) as nb_new_pm from pm where ((user1="'.$_SESSION['userid'].'" and user1read="no") or (user2="'.$_SESSION['userid'].'" and user2read="no")) and id2="1"'));
  $nb_new_pm = $nb_new_pm['nb_new_pm'];
  ?&gt;
  &lt;div class="box"&gt;
      &lt;div class="box_left"&gt;
          &lt;a href="&lt;?php echo $url_home; ?&gt;"&gt;Forum Index&lt;/a&gt; &amp;gt; &lt;a href="list_topics.php?parent=&lt;?php echo $id; ?&gt;"&gt;&lt;?php echo htmlentities($dn1['name'], ENT_QUOTES, 'UTF-8'); ?&gt;&lt;/a&gt; &amp;gt; New Topic
      &lt;/div&gt;
      &lt;div class="box_right"&gt;
          &lt;a href="list_pm.php"&gt;Your messages(&lt;?php echo $nb_new_pm; ?&gt;)&lt;/a&gt; - &lt;a href="profile.php?id=&lt;?php echo $_SESSION['userid']; ?&gt;"&gt;&lt;?php echo htmlentities($_SESSION['username'], ENT_QUOTES, 'UTF-8'); ?&gt;&lt;/a&gt; (&lt;a href="login.php"&gt;Logout&lt;/a&gt;)
      &lt;/div&gt;
      &lt;div class="clean"&gt;&lt;/div&gt;
  &lt;/div&gt;
  &lt;?php
  if(isset($_POST['message'], $_POST['title']) and $_POST['message']!='' and $_POST['title']!='')
  {
      include('bbcode_function.php');
      $title = $_POST['title'];
      $message = $_POST['message'];
      if(get_magic_quotes_gpc())
      {
          $title = stripslashes($title);
          $message = stripslashes($message);
      }
      $title = mysql_real_escape_string($title);
      $message = mysql_real_escape_string(bbcode_to_html($message));
      if(mysql_query('insert into topics (parent, id, id2, title, message, authorid, timestamp, timestamp2) select "'.$id.'", ifnull(max(id), 0)+1, "1", "'.$title.'", "'.$message.'", "'.$_SESSION['userid'].'", "'.time().'", "'.time().'" from topics'))
      {
      ?&gt;
      &lt;div class="message"&gt;The topic have successfully been created.&lt;br /&gt;
      &lt;a href="list_topics.php?parent=&lt;?php echo $id; ?&gt;"&gt;Go to the forum&lt;/a&gt;&lt;/div&gt;
      &lt;?php
      }
      else
      {
          echo 'An error occurred while creating the topic.';
      }
  }
  else
  {
  ?&gt;
  &lt;form action="new_topic.php?parent=&lt;?php echo $id; ?&gt;" method="post"&gt;
      &lt;label for="title"&gt;Title&lt;/label&gt;&lt;input type="text" name="title" id="title"  /&gt;&lt;br /&gt;
      &lt;label for="message"&gt;Message&lt;/label&gt;&lt;br /&gt;
      &lt;div class="message_buttons"&gt;
          &lt;input type="button" value="Bold" onclick="javascript:insert('[b]', '[/b]', 'message');" /&gt;&lt;!--
          --&gt;&lt;input type="button" value="Italic" onclick="javascript:insert('[i]', '[/i]', 'message');" /&gt;&lt;!--
          --&gt;&lt;input type="button" value="Underlined" onclick="javascript:insert('[u]', '[/u]', 'message');" /&gt;&lt;!--
          --&gt;&lt;input type="button" value="Image" onclick="javascript:insert('[img]', '[/img]', 'message');" /&gt;&lt;!--
          --&gt;&lt;input type="button" value="Link" onclick="javascript:insert('[url]', '[/url]', 'message');" /&gt;&lt;!--
          --&gt;&lt;input type="button" value="Left" onclick="javascript:insert('[left]', '[/left]', 'message');" /&gt;&lt;!--
          --&gt;&lt;input type="button" value="Center" onclick="javascript:insert('[center]', '[/center]', 'message');" /&gt;&lt;!--
          --&gt;&lt;input type="button" value="Right" onclick="javascript:insert('[right]', '[/right]', 'message');" /&gt;
      &lt;/div&gt;
      &lt;textarea name="message" id="message" cols="70" rows="6"&gt;&lt;/textarea&gt;&lt;br /&gt;
      &lt;input type="submit" value="Send" /&gt;
  &lt;/form&gt;
  &lt;?php
  }
  ?&gt;
          &lt;/div&gt;
          &lt;div class="foot"&gt;&lt;a href="http://www.webestools.com/scripts_tutorials-code-source-26-simple-php-forum-script-php-forum-easy-simple-script-code-download-free-php-forum-mysql.html"&gt;Simple PHP Forum Script&lt;/a&gt; - &lt;a href="http://www.webestools.com/"&gt;Webestools&lt;/a&gt;&lt;/div&gt;
      &lt;/body&gt;
  &lt;/html&gt;
  &lt;?php
  }
  else
  {
      echo '&lt;h2&gt;The category you want to add a topic doesn\'t exist.&lt;/h2&gt;';
  }
  }
  else
  {
  ?&gt;
  &lt;h2&gt;You must be logged to access this page.&lt;/h2&gt;
  &lt;div class="box_login"&gt;
      &lt;form action="login.php" method="post"&gt;
          &lt;label for="username"&gt;Username&lt;/label&gt;&lt;input type="text" name="username" id="username" /&gt;&lt;br /&gt;
          &lt;label for="password"&gt;Password&lt;/label&gt;&lt;input type="password" name="password" id="password" /&gt;&lt;br /&gt;
          &lt;label for="memorize"&gt;Remember&lt;/label&gt;&lt;input type="checkbox" name="memorize" id="memorize" value="yes" /&gt;
          &lt;div class="center"&gt;
              &lt;input type="submit" value="Login" /&gt; &lt;input type="button" onclick="javascript:document.location='signup.php';" value="Sign Up" /&gt;
          &lt;/div&gt;
      &lt;/form&gt;
  &lt;/div&gt;
  &lt;?php
  }
  }
  else
  {
      echo '&lt;h2&gt;The ID of the category you want to add a topic is not defined.&lt;/h2&gt;';
  }
  ?&gt;
  </code></pre>