Credit mod help to accept all checked boxes before proceeding

In this PHP web site script that I’m using, when something is searched on the site, a page list of search results is generated, where you can place a “check” in a box next to the thumbnail in the search results and then select “Use Credits Now” to proceed to see more.

The problem is if the search results are more than one page, and I want to ‘check’ a search result on page 1 and page 2, for example, it will only accept the checked item from a single page. Is there anything on this page code below that I could change to fix that - so that any and all checked boxes will be accepted, before proceeding? If not, maybe something on search_results.htm page referenced in the code below, might need to be tweaked. I can post that code if requested. Any guidance with this issue will be appreciated.

<?php
error_reporting(0);
///////////////////////////////////////////////////////////////////////////////////////
                                                      
include_once ('classes/config.php');
include_once ('classes/sessions.php');

$default_album_pic = $config['default_album_pic'];

///////////////////////////////////////////////////////////////////////////////////////
// changed search server method to get to get rid of cache expired error

if( ( $_SERVER['REQUEST_METHOD'] != 'GET') ) dieNice();



///////////////////////////////////////////////////
// CREDITS MOD   /////////////////////
///////////////////////////////////////////////////
$_SESSION['searched'] = $_GET['keyword'];
$prch = $_GET['p'];

if ($user_id == "") {

	$new_temp = "themes/$user_theme/templates/search_results_guest.htm";


}elseif ($prch == "1") {

	$new_temp = "themes/$user_theme/templates/search_results_paid.htm";

}else{

	$new_temp = "themes/$user_theme/templates/search_results.htm";

}

$queryString = strtolower($_SERVER['QUERY_STRING']);
if (strstr($queryString,'%20union%20') OR strstr($queryString,'/*')) dieNice();

$referer	= mysql_real_escape_string( $_SERVER['HTTP_REFERER'] );
if ( $referer == '' ) dieNice();
if ( !ereg ($_SERVER['SERVER_NAME'], $referer) ) $flag_stop++;
if ( !ereg ($base_url, $referer) ) $flag_stop++;
if ( $flag_stop == 2 ) dieNice();

$keywords	= $_GET['keyword'];
$keywords	= str_replace('&#039;s', "", $keywords);
$keywords	= str_replace('+', " ", $keywords);

$debug_log_file = 'logs/search_log.txt';

if (@file_exists($debug_log_file)) {
	$fo = @fopen($debug_log_file, 'a');
     	@fwrite($fo, $keywords);
     	@fclose($fo);

} else {
     	$fo = @fopen($debug_log_file, 'w');
     	@fwrite($fo, $keywords);
     	@fclose($fo);
}

$keyword 	= mysql_real_escape_string($keywords);
$channel	= mysql_real_escape_string( $_GET['type'] );

if ($type == '') {
    $keyword    = mysql_real_escape_string($keywords);
        $type        = mysql_real_escape_string($_GET['type']);
}

if ($keyword == '' | $type == '' ) {
    $type        = 'videos';
    $keyword     = 'none';
}



$type_videos	= 1;
$row_id		= 'video_id';
$media_comments	= 'videocomments';
$type_query_rows 	= 'indexer, video_id, channel_id, thumb_string, title, title_seo, date_uploaded, user_id, video_length, approved, public_private, description, tags, number_of_views';

$tag_cloud 		= make_tag_cloud( $get_type );
$tag_cloud_block 	= $tag_cloud[1];

if (is_numeric($channel)) {
	$page_guery	= "SELECT indexer FROM videos WHERE approved = 'yes' AND public_private = 'public' AND channel_id = $channel AND (title like '%$keyword%' or tags like '%$keyword%' or description like '%$keyword%')";
	$search_query	= "SELECT $type_query_rows FROM videos WHERE approved = 'yes' AND public_private = 'public' AND channel_id = $channel AND (title like '%$keyword%' or tags like '%$keyword%' or description like '%$keyword%') LIMIT "; // $set_limit, $limit";
} else {
	$page_guery	= "SELECT indexer FROM videos WHERE approved = 'yes' AND public_private = 'public' AND (title like '%$keyword%' or tags like '%$keyword%' or description like '%$keyword%')";
	$search_query	= "SELECT $type_query_rows FROM videos WHERE approved = 'yes' AND public_private = 'public' AND (title like '%$keyword%' or tags like '%$keyword%' or description like '%$keyword%') LIMIT "; // $set_limit, $limit";
}
$query_get_type	= 'videos';

	$limit	= (int) mysql_real_escape_string( $config['search_page_limits'] );
    	$pagination 	= pagination($page_guery, $limit);
    	$set_limit		= $pagination[0]['set_limit'];
    	$total_pages	= $pagination[0]['total_pages'];
    	$current_page 	= $pagination[0]['current_page'];
    	$total_records 	= $pagination[0]['total_records'];
    	$next_page 		= $pagination[0]['next_page'];
    	$prev_page 		= $pagination[0]['prev_page'];
    	$nl 			= $pagination[0]['nl'];
    	$pl 			= $pagination[0]['pl'];

    	$result_search 	= array();
    	$sql			= $search_query . $set_limit .','. $limit;
    	$query 		= @mysql_query($sql);

    	$results_of 	= $current_page * $limit;
    	$results_show 	= $set_limit + 1;

    	if ( $results_of > $total_records )	$results_of = $total_records;
    	if ( $set_limit == 0 ) 			$results_show = 1;
    	if ( $total_records == 0 ) 		$results_show = 0;

 		define($get_type, true);

    	while ($result1 = @mysql_fetch_array($query)) {
    		$media_id		= mysql_real_escape_string($result1['indexer']);
    		$sql2 		= "SELECT indexer FROM $media_comments WHERE $row_id = $media_id";
       		$query2 		= @mysql_query($sql2);
        	$comments_number	= @mysql_num_rows($query2);
        	$comments_array 	= array('comments' => $comments_number);

        	$id	= $media_id;
			$stars_array = stars_array($media_id);

        	// we need dynamic media image query
        	$result_image	= 'videos';
       		$result2	= @array_merge($result1, $comments_array, $stars_array);
        	$result_search[] 	= $result2;
    	}

//--BEGIN--

$video_price = videoPrice();
$total_price = $video_price * $total_records;

$member_credits = get_member_credits($user_id);

// --END--

//PAGINATION PLUS
$url = 'search.php';
$additional_url_variable = "?keyword=$keyword&type=$type&page=";
include_once('includes/pagination.inc.php');
//PAGINATION PLUS >> end

// checking for any error codes
$codes = $_GET['code'];
$error_code = errorcodes($codes);

if (!empty($error_code)) {
	$blk_notification = $error_code['error_display'];
     	$message_type = $error_code['error_type'];
     	$error_message =$error_code['error_message'];
}

// create dynamic template words
$url_link	= 'videos';

$get_type 		= ucwords($get_type);
$get_type_word	= substr($get_type, 0, -1);
$page_title		= $config['site_name'] . ' ' . $get_type_word . ' ' . $lang_search . ' ' . $lang_results . ' ' . $lang_for . ' ' . $keyword;
$template		= "themes/$user_theme/templates/main_1.htm";
//$inner_template1 	= "themes/$user_theme/templates/search_results.htm";
$inner_template1 	= $new_temp;
$TBS			= new clsTinyButStrong;
$TBS->NoErr 	= true;

$TBS->LoadTemplate("$template");

$TBS->MergeBlock('blkfeatured', $result_search);

$TBS->Render = TBS_OUTPUT;
$TBS->Show();
@mysql_close();
die();

function dieNice() {
	header("Location: index.php");
	die();
}

?>

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