Hi,
please first you visit this site http://www.webdo.x10.mx/ this is my practice site.I just starting my php carrer.here i create a search option with button but its not working as my expectation.i think its code is OK".here the code..
<?php
$connect=mysql_connect('localhost','root','');
$mysql_db=mysql_select_db('my_database',$connect) or die(mysql_error()); //db name:my_database
if (isset($_POST['search_name']))
{
$search_name= $_POST['search_name'];
if(!empty($search_name)){
if(strlen($search_name)>=4){
$query = "SELECT name FROM name_search WHERE name LIKE '%".mysql_real_escape_string($search_name)."%'";
$query_run= mysql_query($query); //table name:name_search colm name:name///
$query_num_rows=mysql_num_rows($query_run);
if($query_num_rows>=1)
{
echo $query_num_rows.' Result Found:<br/>';
while ($query_row=mysql_fetch_assoc($query_run)){
echo $query_row['name'].'<br/>';
}
}
else
{
echo 'Not found';
}
}
else {
echo 'Please Character must be more then 5 keywords';
}
}
}
?>
////--------FORM creation area----------------//////////
<div class="search"><p>I am looking for...</p>
<div class="search_input">
<form>
<input type="text" name="search_name" class="search_input" title="Trainer Name" value="<?php echo $_SESSION['search_name'];?>">
</form>
</div>
</div>
<div class="search_button">
<form action= "second_page.php" method="POST">
<input type="submit" name="search_name" class="search_button" title="Search" value="Find">
</form>
</div>
when i run it my local server its woking/search perfectly but unfortunatelly its not working here(live server/site).I am also cofused about FIND button.its OK? //I think its <from></form> area problem.
If you want i also provide you this site access panel login id/password.For solving.
please help me with details..
regards....