Hi, I have the codes as showed:
[code=php]
<!DOCTYPE html PUBLIC “-//W3C//DTD XHTML 1.0 Strict//EN”
“http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd”>
<html xmlns=”http://www.w3.org/1999/xhtml”>
<head>
<title>The Blog Warehouse</title>
<meta http-equiv=”content-type”
content=”text/html; charset=iso-8859-1″ />
</head>
<body background=”image/bg-cert-ss.jpg”>
<h3>Search Blog Entries by LSA</h3>
<?php
$dbcnx = @mysql_connect(‘localhost’, ‘root’, ‘password’);
if (!$dbcnx) {
exit(‘<p>Unable to connect to the database server at this time.</p>’);
}
// Select the blog database
if (!@mysql_select_db(‘ijob’)) {
exit(‘<p>Unable to locate the blog collection database at this time.</p>’);
}
?>
<SCRIPT language=JavaScript>
function reload(form)
{
var val=form.type.options[form.type.options.selectedIndex].value;
self.location=’search.php?type=’ + val ; //to this file name
}
</script>
<?php
///////// Getting the data from Mysql table for first list box//////////
$quer2=mysql_query(“SELECT DISTINCT name,id FROM blog_type order by name”);
///////////// End of query for first list box////////////
$type=$HTTP_GET_VARS[‘type’]; // This line is added to take care if your global variable is off
if(isset($type) and strlen($type) > 0){
//print_r ($type);
$quer=mysql_query(“SELECT DISTINCT name,id FROM blog_category where typeid=’$type’ order by name”);
}else{$quer=mysql_query(“SELECT DISTINCT name,id FROM blog_category order by name”); }
/////// for second drop down list we will check if category is selected else we will display all the subcategory/////
////////// end of query for second subcategory drop down list box ///////////////////////////
//<form action=”display_title.php” method=”post”>
//echo “<form method=’post’ name=f1 action=’display_title.php’ >”;
echo “<form action=’searchResult.php’ method=’post’ >”;
/// Add your form processing page address to action in above line. Example action=dd-check.php////
////////// Starting of first drop downlist /////////
echo “Blog type: “;
echo “<select name=’type’ onchange=”reload(this.form)”><option value=”>——</option>”;
while($noticia2 = mysql_fetch_array($quer2)) {
if($noticia2[‘id’]==@$type){
$tid = $noticia2[‘id’];
$tname = $noticia2[‘name’];
//print_r ($tid);
//print_r ($tname);
//echo “<option selected value=’$noticia2[id]’>$noticia2[name]</option>”.”<BR>”;}
echo “<option selected value=’$tid’>$tname</option>”.”<BR>”;}
else{//echo “<option value=’$noticia2[id]’>$noticia2[name]</option>/n”;}
$tid = $noticia2[‘id’];
$tname = $noticia2[‘name’];
//print_r ($tid);
//print_r ($tname);
echo “<option value=’$tid’>$tname</option>/n”;}
}
echo “</select>”;
////////////////// This will end the first drop down list ///////////
////////// Starting of second drop downlist /////////
echo ” Category: “;
echo “<select name=’cat’><option value=”>Any Category</option>”;
while($noticia = mysql_fetch_array($quer)) {
$cid = $noticia[‘id’];
$cname = $noticia[‘name’];
//print_r ($cid);
//print_r ($cname);
//echo “<option value=’$noticia[id]’>$noticia[name]</option>/n/n”;
echo “<option value=’$cid’>$cname</option>/n/n”;
}
echo “</select>”;
////////////////// This will end the second drop down list ///////////
//// Add your other form fields as needed here/////
echo “<p> </P>”;
?>
<form action=<?php echo $_SERVER[‘PHP_SELF’]; ?> method=’post’>
<label>Search Query:<br />
<textarea name= “query” rows=”1″ cols=”100″>
</textarea></label><br />
<p> </P>
<?php
echo “<input type=’submit’ value=’SUBMIT’>”;
echo “<input type=’reset’ name=’RESET’ value=’RESET’>”;
echo “</form>”;
?>
</body>
</html>
It is a page for searching. But when I type the search phrase and press “ENTER”, the phrase is gone. I want it to work in the way that when I press “ENTER”, it is actually click on “Submit”. So I changed <textarea > to <input type=”text”. However,I want to keep the text area of the same size as before, such as : rows=”1″ cols=”100″
How to edit the codes further to this purpose? ?
Thanks a lot ?