hi guys, found out about this forum a few weeks ago and found it very useful in regards php issues, i started to experiment with the language lately so i'm still a beginner, i need some help the following code:

<body>
<?php
ob_start();

	include 'cms/core/config.php';
	include 'cms/core/opendb.php';



if(isset($_POST['save']))
{
	$description = $_POST['description'];
	$keywords = $_POST['keywords'];
	$author = $_POST['author'];
	$language = $_POST['language'];
	$rating = $_POST['rating'];
	$classification = $_POST['classification'];
	$distribution = $_POST['distribution'];
	$robots = $_POST['robots'];
	$revisit = $_POST['revisit'];
	$copyright = $_POST['copyright'];
	$email = $_POST['email'];
	$updated = date("D, jS F, Y");
	
	if(!get_magic_quotes_gpc())
	{
		$description = addslashes($description);
		$keywords = addslashes($keywords);
		$author = addslashes($author);
		$language = addslashes($language);
		$rating = addslashes($rating);
		$classification = addslashes($classification);
		$distribution = addslashes($distribution);
		$robots = addslashes($robots);
		$revisit = addslashes($revisit);
		$copyright = addslashes($copyright);
		$email = addslashes($email);
	}

	

	mysql_query("INSERT INTO meta 
	(description, keywords, author, language, rating, classification, distribution, robots, revisit, copyright, email, updated) VALUES('$description', '$keywords', '$author', '$language', '$rating', '$classification', '$distribution', '$robots', '$revisit', '$copyright', '$email', '$updated' ) ") 
	or die(mysql_error());
	include 'cms/core/closedb.php';

	header("location:addmeta.php");
	}
	
	// output buffering off
ob_flush();

?>
<form method="post">
  <table width="700" border="0" cellpadding="5" cellspacing="0" class="box">
	<tr> 
      <td width="100" valign="top">Description:</td>
      <td><input name="description" type="text" id="description" value="" size="100"></td>
    </tr>
    <tr> 
      <td width="100" valign="top">Keywords:</td>
      <td><input name="keywords" type="text" id="keywords" value="" size="100"></td>
    </tr>
    <tr> 
      <td width="100" valign="top">Author:</td>
      <td><input name="author" type="text" id="author" value="" size="100"></td>
    </tr>
    <tr> 
      <td width="100" valign="top">Language:</td>
      <td>
	<select name='language' id="language" >
	<option value="bg">Bulgarian</option>
	<option value="cs">Czech</option>
	<option value="da">Danish</option>
	<option value="de">German</option>
	<option value="el">Greek</option>
	<option value="en" selected>English</option>
	<option value="en-gb">English (UK)</option>
	<option value="en-us">English (US)</option>
	<option value="es">Spanish</option>
	<option value="fi">Finnish</option>
	<option value="hr">Croatian</option>
	<option value="it">Italian</option>
	<option value="fr">French</option>
	<option value="fr-ca">French (Quebec)</option>
	<option value="ja">Japanese</option>
	<option value="ko">Korean</option>
	<option value="nl">Dutch</option>
	<option value="no">Norwegian</option>
	<option value="pl">Polish</option>
	<option value="ru">Russian</option>
	<option value="sv">Swedish</option>
	<option value="zh">Chinese</option>
    </select>    
    </td>
    </tr>
    <tr> 
      <td width="100" valign="top">Rating:</td>
      <td>
	<select name="rating" id="rating">
	<option value="general">general</option>
	<option value="mature">mature</option>
	<option value="restricted">restricted</option>
	</select>
      </td>
    </tr>
    <tr> 
      <td width="100" valign="top">Classification:</td>
      <td><input name="classification" type="text" id="classification" value="" size="100"></td>
    </tr>
    <tr> 
      <td width="100" valign="top">Distribution:</td>
      <td>
    <select name="distribution" id="distribution">
    <option value="global">global</option>
    <option value="local">local</option>
    <option value="iu">internal use</option>
    </select>
      </td>
    </tr>
    <tr> 
      <td width="100" valign="top">Robots:</td>
      <td>
    <select name="robots" id="robots">
    <option value="index, follow">index, follow</option>
    <option value="noindex, nofollow">noindex, nofollow</option>
    </select>
      </td>
    </tr>
    <tr> 
      <td width="100" valign="top">Revisit After:</td>
      <td>
    <select name="revisit" id="revisit">
    <option value="7 days">7 days</option>
    <option value="14 days">14 days</option>
    <option value="30 days">30 days</option>
    <option value="60 days">60 days</option>
    </select>
      </td>
    </tr>
    <tr> 
      <td width="100" valign="top">Copyright:</td>
      <td><input name="copyright" type="text" id="copyright" value="" size="100"></td>
    </tr>
    <tr> 
      <td width="100" valign="top">Email:</td>
      <td><input name="email" type="text" id="email" value="" size="100"></td>
    </tr>
    <tr> 
      <td colspan="2" align="center"><input name="save" type="submit" id="save" value="Save Data"></td>
    </tr>
        <tr> 
      <td colspan="2"><p align="center"><a href="javascript:history.back();">cancel and go back</a></p></td>
    </tr>
  </table>
  
</form>
</body>
</html>

what im stuck with mainly is that when the dropdowns like $language post data to the mysql db when i reload it how can the data posted in the db be selected from the dropdown list? as currently what is happening is if i choose "de" for instance and i reload it "en" pops up again. any help how can i set the dropdown to remember or get the data inserted before in the db ?

btw the above code was for adding meta tags into the data base, the following code is for editing the values inserted before so what i 'm stuck on is this file as in this file i want that the dropdowns remember what values were given before

<body>
<?php
	include 'cms/core/config.php';
	include 'cms/core/opendb.php';

$query = "SELECT id, description, keywords, author, language, rating, classification, distribution, robots, revisit, copyright, email, updated ". "FROM meta ". "WHERE id = '5'";
$result = mysql_query($query) or die('Error : ' . mysql_error());
list($id, $description, $keywords, $author, $language, $rating, $classification, $distribution, $robots, $revisit, $copyright, $email, $updated) = mysql_fetch_array($result, MYSQL_NUM);


	include 'cms/core/closedb.php';
?>
<form method="post" action="default.php?s=editmeta">
<input type="hidden" name="id" value="5">
  <table width="700" border="0" cellpadding="5" cellspacing="0" class="box">
<tr> 
      <td width="100" valign="top">Description:</td>
      <td><input name="description" type="text" id="description" value="<?=$description;?>" size="100"></td>
    </tr>
    <tr> 
      <td width="100" valign="top">Keywords:</td>
      <td><input name="keywords" type="text" id="keywords" value="<?=$keywords;?>" size="100"></td>
    </tr>
    <tr> 
      <td width="100" valign="top">Author:</td>
      <td><input name="author" type="text" id="author" value="<?=$author;?>" size="100"></td>
    </tr>
    <tr> 
      <td width="100" valign="top">Language:</td>
      <td>
	<select name='language' id="language" >
	<option value="bg">Bulgarian</option>
	<option value="cs">Czech</option>
	<option value="da">Danish</option>
	<option value="de">German</option>
	<option value="el">Greek</option>
	<option value="en" selected>English</option>
	<option value="en-gb">English (UK)</option>
	<option value="en-us">English (US)</option>
	<option value="es">Spanish</option>
	<option value="fi">Finnish</option>
	<option value="hr">Croatian</option>
	<option value="it">Italian</option>
	<option value="fr">French</option>
	<option value="fr-ca">French (Quebec)</option>
	<option value="ja">Japanese</option>
	<option value="ko">Korean</option>
	<option value="nl">Dutch</option>
	<option value="no">Norwegian</option>
	<option value="pl">Polish</option>
	<option value="ru">Russian</option>
	<option value="sv">Swedish</option>
	<option value="zh">Chinese</option>
    </select>    
    </td>
    </tr>
    <tr> 
      <td width="100" valign="top">Rating:</td>
      <td>
	<select name="rating" id="rating">
	<option value="general">general</option>
	<option value="mature">mature</option>
	<option value="restricted">restricted</option>
	</select>
      </td>
    </tr>
    <tr> 
      <td width="100" valign="top">Classification:</td>
      <td><input name="classification" type="text" id="classification" value="<?=$classification;?>" size="100"></td>
    </tr>
    <tr> 
      <td width="100" valign="top">Distribution:</td>
      <td>
    <select name="distribution" id="distribution">
    <option value="global">global</option>
    <option value="local">local</option>
    <option value="iu">internal use</option>
    </select>
      </td>
    </tr>
    <tr> 
      <td width="100" valign="top">Robots:</td>
      <td>
    <select name="robots" id="robots">
    <option value="index, follow">index, follow</option>
    <option value="noindex, nofollow">noindex, nofollow</option>
    </select>
      </td>
    </tr>
    <tr> 
      <td width="100" valign="top">Revisit After:</td>
      <td>
    <select name="revisit" id="revisit">
    <option value="7 days">7 days</option>
    <option value="14 days">14 days</option>
    <option value="30 days">30 days</option>
    <option value="60 days">60 days</option>
    </select>
      </td>
    </tr>
    <tr> 
      <td width="100" valign="top">Copyright:</td>
      <td><input name="copyright" type="text" id="copyright" value="<?=$copyright;?>" size="100"></td>
    </tr>
    <tr> 
      <td width="100" valign="top">Email:</td>
      <td><input name="email" type="text" id="email" value="<?=$email;?>" size="100"></td>
    </tr>
    <tr>  
      <td colspan="2" align="center"><input name="update" type="submit" id="update" value="Update Content"></td>
    </tr>
    <tr> 
      <td colspan="2"><p align="center"><a href="javascript:history.back();">cancel and go back</a></p></td>
    </tr>
  </table>
</form>
</body>
</html>
Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.