My head is spinning again coz im thinking why i cant insert in mySQL the input value in text box. Can anyone help me with this. If I change
to
the input will save in sql but it will not return any search result.
Heres the code:
Code:
<form method="get" action="index.php">
Code:
<form method="post" action="index.php">
Heres the code:
Code:
<form method="get" action="index.php">
<div>
<input type="text" name="search"/>
<input type="submit" value="<?=$lang[Search]?>"/>
<input type="hidden" name="source" value="some_value"/>
</div>
</form>
<div>
<b>Some Project</b><br/>
<?php
$search=$_POST["search"];
$spaces = str_replace(" ","",$search);
if($spaces != "" && $search != "") {
$spacez = str_replace(" ","",$search);
$kill = str_replace("'","",$search);
if(strlen($search) < 26) {
if($spacez != "" && $search != "")
{
$check = mysql_num_rows(mysql_query("SELECT * FROM search WHERE query = '$kill'"));
if($check < 1)
{
mysql_query("INSERT INTO search VALUES('','$search','0')");
} else {
mysql_query("UPDATE search SET searches = searches+1 WHERE query = '$search'");
}
}
}
}
Comment