Jump to content

search not working right


flemingmike

Recommended Posts

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
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.