hrnn Posted December 31, 2008 Share Posted December 31, 2008 Hi, im using the audio only mod or PHPMOTION SCRIPT, this is my site www.underz.com.ar and im doing some cleanning on the code. And since only audios can be uploaded an of course only audios can be searched, i want to remove the audio option on the search form i know i have to edit search.php and templates/main_1.htm THis is the search form in templates/main_1.htm <form class="FormSearch" method="POST" action="search.php"> <input type="text" name="keyword" size="32" class="FormSpecialInput_1" /> <select size="1" name="type" class="FormSpecialInput_1"> <option value="audio">Audio</option> </select> <input type="submit" value="Submit" name="B2" /> </form> And the audio option is what i want to remove This is part of the search.php code, which i also think i have to edit. <?php include_once ('classes/config.php'); include_once ('classes/menu.php'); include_once ('classes/sessions.php'); include_once ('tag_cloud_audio.php'); $referer = mysql_real_escape_string($_SERVER['HTTP_REFERER']); $keyword = $_POST['keyword'];//get video id $type = mysql_real_escape_string($_POST['type']);//get video id //check if this page is being called from "next>>" or "<<previous" where the keyword are not POST but GET if ($type == '') { $keyword = mysql_real_escape_string($_GET['keyword']); $type = mysql_real_escape_string($_GET['type']); } $get_keywords = $keyword;//also send keyword to html $get_type = $type;//also send type to html // Start of AUDIO SEARCH if ($type == 'audio' || $type == '') { $limit = $config["search_page_limits"]; $keyword_escaped = mysql_real_escape_string($keyword); $pagination = pagination("SELECT * FROM audios WHERE MATCH(title, tags, description) AGAINST ('$keyword_escaped') AND approved='yes' AND public_private = 'public'", $limit); I removed this in the main_1.htm <option value="audio">Audio</option> but then the search didnt work, and listed every song uploaded. Any idea of how to remove that option of the image? Thanks Quote Link to comment https://forums.phpfreaks.com/topic/138994-solved-removing-an-option-from-the-search-from/ Share on other sites More sharing options...
Maq Posted December 31, 2008 Share Posted December 31, 2008 You will have to remove anything to do with "type". From main_1.html take out: Audio search.php take out: $type = mysql_real_escape_string($_POST['type']);//get video id if ($type == '') { $type = mysql_real_escape_string($_GET['type']); } $get_type = $type;//also send type to html if ($type == 'audio' || $type == '') { Take out everything that has to do with "type". You may want to post more of the code if that doesn't work. Quote Link to comment https://forums.phpfreaks.com/topic/138994-solved-removing-an-option-from-the-search-from/#findComment-726962 Share on other sites More sharing options...
hrnn Posted December 31, 2008 Author Share Posted December 31, 2008 Thanks for answering I deleted every "type" on the search.php. But, the search results to any word, not even a tag, are all songs uploaded. It doesnt matter what term do i search, the result is a list of all songs uploaded. How do i fix this? Quote Link to comment https://forums.phpfreaks.com/topic/138994-solved-removing-an-option-from-the-search-from/#findComment-727018 Share on other sites More sharing options...
hrnn Posted January 3, 2009 Author Share Posted January 3, 2009 ok maybe trying with an imput type hidden??? Quote Link to comment https://forums.phpfreaks.com/topic/138994-solved-removing-an-option-from-the-search-from/#findComment-728828 Share on other sites More sharing options...
hrnn Posted January 3, 2009 Author Share Posted January 3, 2009 BUT the way i solved it adding an <input type="hidden" name="type" value="audio" /> so i did quit the option from the form as its shown on the image <form class="FormSearch" method="POST" action="search.php"> <input type="text" name="keyword" size="32" class="FormSpecialInput_1" /> <input type="hidden" name="type" value="audio" /> <input type="submit" value="Search" name="B2" /> </form> Quote Link to comment https://forums.phpfreaks.com/topic/138994-solved-removing-an-option-from-the-search-from/#findComment-728845 Share on other sites More sharing options...
Maq Posted January 5, 2009 Share Posted January 5, 2009 BUT the way i solved it adding an so i did quit the option from the form as its shown on the image </pre> <form class="FormSearch" method="POST" action="search.php"> </form I can see how that works. But you said Audio is the only choice anyway so why even include it, even if it's hidden? Quote Link to comment https://forums.phpfreaks.com/topic/138994-solved-removing-an-option-from-the-search-from/#findComment-729895 Share on other sites More sharing options...
hrnn Posted January 6, 2009 Author Share Posted January 6, 2009 sure, thats why i posted firstly the original script had many options i.g. videos, music, members, groups, etc so the search.php whas prepared for that. When i did what you said, the search results where all songs uploaded. But now with this hidden, "No matter if the cat is white or black while hunt mice" Of course i would prefere what you say Quote Link to comment https://forums.phpfreaks.com/topic/138994-solved-removing-an-option-from-the-search-from/#findComment-730418 Share on other sites More sharing options...
Maq Posted January 6, 2009 Share Posted January 6, 2009 sure, thats why i posted firstly the original script had many options i.g. videos, music, members, groups, etc so the search.php whas prepared for that. When i did what you said, the search results where all songs uploaded. But now with this hidden, "No matter if the cat is white or black while hunt mice" Of course i would prefere what you say Hrmmm, I see. Quote Link to comment https://forums.phpfreaks.com/topic/138994-solved-removing-an-option-from-the-search-from/#findComment-730431 Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.