kpetsche20 Posted July 2, 2008 Share Posted July 2, 2008 I'm trying to make a search function for my mysql DB, but it donesn't do anything when I click on submit to try and search <table width="550" border="0" align="left" cellpadding="0" cellspacing="0"> <tr> <td width="522"><p>Search </p> <? if(isset($_POST['Submit'])) { $searchsql = "SELECT * FROM tblpeople"; $searchquery = mysql_query($searchsql); while($search = mysql_fetch_array($searchquery)) { if($_POST['search'] == $search['indlastname']) { echo "Works"; } } else { echo "wroing"; } } ?> <form action="index.php?p=search" method="POST"> <select name="table"> <option value="tblpeople">Search Clients</option> <option value="sadf">ddd</option> </select> <input name="search" type="text" /> <input type="submit" name="Submit" value="Submit" /> </form> </td> </tr> </table> Link to comment https://forums.phpfreaks.com/topic/113005-problem-with-search-script-php/ Share on other sites More sharing options...
Lautarox Posted July 3, 2008 Share Posted July 3, 2008 Try using a hidden input <INPUT type="hidden" name="Submit" value="Submit"> Link to comment https://forums.phpfreaks.com/topic/113005-problem-with-search-script-php/#findComment-580514 Share on other sites More sharing options...
vbnullchar Posted July 3, 2008 Share Posted July 3, 2008 check if you are really submitting the form do this if(isset($_POST) && !empty($_POST) ) { print_r($_POST) } Link to comment https://forums.phpfreaks.com/topic/113005-problem-with-search-script-php/#findComment-580537 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.