flemingmike Posted August 9, 2010 Share Posted August 9, 2010 hello all, im running a search and it will work if i search one letter, but not anything more. any ideas? <?php include("style.php"); //If we submitted the form if(isset($_POST['submitMe'])) { echo '<div id="musicinfo" align="center"> <table border="0" width="100%" cellspacing="0" cellpadding="0"> <tr> <td align="center"> <form action="" method="POST"> <center> <input type="text" name="name" size="24"> <input type="submit" value="Search" name="submitMe"> </form> </td> </tr> </table> </div>'; $hmm = simplexml_load_file('http://www.durhamit.ca:8181/1.0/?method=database.search&searcharg='.$_POST['name'] .''); foreach($hmm->tracks->track as $tracks) { $artist = $tracks->artist; $title = $tracks->title; $album = $tracks->album; $id = $tracks->id; echo '<table border="0" width="60%" align="center">'; echo '<tr>'; echo '<td width="25%">'.$artist.'</td>'; echo '<td width="25%">'.$title.'</td>'; echo '<td width="25%">'.$album.'</td>'; echo '<td width="25%"><a href="http://www.durhamit.ca:8181/1.0/?method=player.playDatabaseItem&id='.$id.'">Play</a></td>'; echo '</tr>'; echo '<tr>'; echo '<td colspan="4"><hr></td>'; echo '</tr>'; echo '</table>'; } } //If we haven't submitted the form else { ?> <form action="" method="POST"> <center> <input type="text" name="name" size="24"> <input type="submit" value="Search" name="submitMe"> </form> <? } ?> Link to comment https://forums.phpfreaks.com/topic/210232-search-not-working-right/ Share on other sites More sharing options...
flemingmike Posted August 9, 2010 Author Share Posted August 9, 2010 wierd, i just tried it from my blackberry, it works. doesnt work from ie. Link to comment https://forums.phpfreaks.com/topic/210232-search-not-working-right/#findComment-1097092 Share on other sites More sharing options...
xangelo Posted August 9, 2010 Share Posted August 9, 2010 Set the action. Some browsers will fill it in as the current page, others will not know what to do. Link to comment https://forums.phpfreaks.com/topic/210232-search-not-working-right/#findComment-1097094 Share on other sites More sharing options...
flemingmike Posted August 9, 2010 Author Share Posted August 9, 2010 what should i put for the action? Link to comment https://forums.phpfreaks.com/topic/210232-search-not-working-right/#findComment-1097101 Share on other sites More sharing options...
xangelo Posted August 9, 2010 Share Posted August 9, 2010 Action is the url of the page that will process the form. So if your page is called form.php action would be form.php Link to comment https://forums.phpfreaks.com/topic/210232-search-not-working-right/#findComment-1097106 Share on other sites More sharing options...
flemingmike Posted August 9, 2010 Author Share Posted August 9, 2010 still the same problem Link to comment https://forums.phpfreaks.com/topic/210232-search-not-working-right/#findComment-1097109 Share on other sites More sharing options...
flemingmike Posted August 9, 2010 Author Share Posted August 9, 2010 such a piss off, because i had this working perfectly last month, then i must have deleted it and it doesnt exist on any of my backups. Link to comment https://forums.phpfreaks.com/topic/210232-search-not-working-right/#findComment-1097136 Share on other sites More sharing options...
flemingmike Posted August 9, 2010 Author Share Posted August 9, 2010 ok, so it actually works just fine. if u press enter, no results, if you click on submit, then it works. any ideas? Link to comment https://forums.phpfreaks.com/topic/210232-search-not-working-right/#findComment-1097141 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.