Search Field choice re-directs to a certain page

The video web script, that I’m using, has a search-field where if you enter a letter, for example ‘c’, several choices on a list, drops-down to select from. If you choose one of those ‘titles’ you’re redirected to the ‘watch’ page, but if you don’t choose one, and just hit ‘return’, you are redirected to the ‘search results’ page, where you can select which ‘title’ (that has a ‘c’ in it) to choose. I’d like assistance with getting every search-field search to redirect to the ‘search results’ page, not the ‘watch’ page. I’m not sure if this is a php or javascript issue. Here are some lines of code that may be related to this issue:

<?php
$data = array('status' => 400);
if (!empty($_POST['search_value'])) {
    $search_value = PT_Secure($_POST['search_value']);
    $search_result = $db->rawQuery("SELECT * FROM " . T_VIDEOS . " WHERE title LIKE '%$search_value%' AND privacy = 0 LIMIT 10");
    if (!empty($search_result)) {
        $html = '';
        foreach ($search_result as $key => $search) {
            $search = PT_GetVideoByID($search, 0, 0, 0);
            $html .= "<div class='search-result'><a href='$search->url'>$search->title</a></div>";
        }
        $data = array('status' => 200, 'html' => $html);
    }
}
?>

any guidance will be appreciated

This topic was automatically closed 91 days after the last reply. New replies are no longer allowed.