Created
July 26, 2012 00:37
-
-
Save ss23/3179576 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<form action='search.php' method='post'> | |
<fieldset class='login'> | |
<legend>Search Options</legend> | |
<table> | |
<tr> | |
<td><label>Artist:</label> | |
</td> | |
<td><input type='text' name='artist' class='textInputBox' value='' /> | |
</td> | |
</tr> | |
<tr> | |
<td><label>Album:</label> | |
</td> | |
<td><input type='text' name='album' class='textInputBox' value='' /> | |
</td> | |
</tr> | |
<tr> | |
<td><label>Genre:</label> | |
</td> | |
<td><input type='text' name='genre' class='textInputBox' value='' /> | |
</td> | |
</tr> | |
<tr> | |
<td class="searchTD"><label>Song name:</label> | |
</td> | |
<td><input type='text' name='songName' class='textInputBox' value='' /> | |
</td> | |
</tr> | |
<br /> | |
</table> | |
<br /> | |
<input type='submit' name='submit' class='searchSbmit' value='Search' /> | |
</fieldset> | |
</form> | |
</div> | |
</div> | |
<?php | |
if (!empty($_POST['submit'])) { | |
$artist = $_POST['artist']; | |
$album = $_POST['album']; | |
$genre = $_POST['genre']; | |
$songName = $_POST['songName']; | |
$searchSubmit = $_POST['searchSubmit']; | |
include_once (ROOT . DS . 'Config' . DS . 'db.inc.php'); | |
if($artist||$album||$genre||$songName) | |
{ | |
if($searchSubmit) | |
{ | |
$sql_query = mysql_query("SELECT * FROM songstab WHERE artist = ".$artist." or album = ".$album." or genre = ".$genre." or songName = ".$songName.""); | |
if($sql_query) | |
{ | |
echo "HELLO WORLD <br />"; | |
} | |
else | |
{ | |
echo mysql_error($connect)." <br />"; | |
} | |
} | |
} | |
//END OF DATABASE CONNECTION | |
mysql_close($connect); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment