Ok, so do you just want it to add the extension of the file?
So if I searched for "Through the fire and the flames", it would add whatever button I checked to the end? Like "Through the fire and the flames.mp3"
Tried and tested, but using checkboxes would be a little bit more complicated:
PHP Code:
<?php
if(isset($_GET['extension']))
{
$extension = "." . $_GET['extension'];
}
else
{
die("You need to select a format");
}
if (isset($_GET['mp3search']) && $_GET['mp3search'] != "")
{
$search = $_GET['mp3search'];
echo "<meta http-equiv=\"Refresh\" content=\"0; url=http://www.google.com/search?q=" . $search . $extension . "\">";
}
else
{
die("You need to enter a search term");
}
?>
I made the HTML into radio buttons to make it simpler:
HTML Code:
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<link rel="stylesheet" type="text/css" href="search.css">
<title>G Search - by: Michael Fridman</title>
</head>
<body>
<div id="content">
<div class="searchMP3">
<FIELDSET><LEGEND>Search for MP3s</LEGEND><br />
<center><form name="form" target="_new" method="GET" action="Gsearch.php">
Song or Artist:
<input name="mp3search" type="text" />
<input type="submit" value="Search" />
<br />
<br />
<table width="296" border="0" cellpadding="0" cellspacing="0">
<tr>
<td width="70" height="20">
<input name="extension" value="mp3" type="radio" />
.MP3 <br /></td>
<td width="70"><input name="extension" value="wma" type="radio" />
.WMA</td>
<td width="70"><input name="extension" value="wav" type="radio" />
.WAV</td>
<td width="70"><input name="extension" value="ogg" type="radio" />
.OGG</td>
</tr>
<tr>
<td colspan="5"> </td>
</tr>
</table>
</form>
</center>
</FIELDSET></div></div>
</body>
</html>
Bookmarks