What it does.
Effectively Limits URL manipulation not injection related to the Results Per page
Returned using Zoom Search.
Example query.
http://example.com/search/index.php?zoom_query=dog&zoom_per_page=10
10 results would be on each page returned. 10 is the default Per_page.
If the visitors had the knowledge and wanted to He could change the URL to read;
http://example.com/search/index.php?zoom_query=dog&zoom_per_page=1000
Causing 1000 results per page to be displayed.
Lets say for some reason you don't want visitors to ever have more the 35 returned.
Use the below form to prevent more the 35 results from ever being shown on 1 page.
#############################################
NOTE: Changing this is a matter of your personal reasons. THIS IS NOT A BUG. And by not using this
tool ZOOM will function normal. In short there is nothing wrong with Zoom as it is.
###############################################
Save the code below and name it perpage.php
Place it in the same directory on your server as your Zoom search.php .
Open your browser and Navigate to the "perpage.php".
Next, change you URL in your browsers address bar only change search.php to search1.php. Leave the rest as is.
You should have a page the looks exactly like the search page you were using prior.
To finalize the change
Go back to the folder where you earlier placed the "perpage.php".
Rename search.php to search.phpbak and search1.php to search.php
All should be normal. Do a search and try changing the URL zoom_per_page= to something greater then 35.
Regards
Note in the above code. "35" can be changed. That is the value for the MAXIMUM amount of results that will return.TO UNDO JUST REPLACE the altered search.php with an original search.php.
Effectively Limits URL manipulation not injection related to the Results Per page
Returned using Zoom Search.
Example query.
http://example.com/search/index.php?zoom_query=dog&zoom_per_page=10
10 results would be on each page returned. 10 is the default Per_page.
If the visitors had the knowledge and wanted to He could change the URL to read;
http://example.com/search/index.php?zoom_query=dog&zoom_per_page=1000
Causing 1000 results per page to be displayed.
Lets say for some reason you don't want visitors to ever have more the 35 returned.
Use the below form to prevent more the 35 results from ever being shown on 1 page.
#############################################
NOTE: Changing this is a matter of your personal reasons. THIS IS NOT A BUG. And by not using this
tool ZOOM will function normal. In short there is nothing wrong with Zoom as it is.
###############################################
Save the code below and name it perpage.php
Place it in the same directory on your server as your Zoom search.php .
Open your browser and Navigate to the "perpage.php".
Next, change you URL in your browsers address bar only change search.php to search1.php. Leave the rest as is.
You should have a page the looks exactly like the search page you were using prior.
To finalize the change
Go back to the folder where you earlier placed the "perpage.php".
Rename search.php to search.phpbak and search1.php to search.php
All should be normal. Do a search and try changing the URL zoom_per_page= to something greater then 35.
Regards
PHP Code:
<?php
//#######//KILL ERRORS
error_reporting(0);
//#######//Get search.php
$html = file_get_contents("search.php");
//#######// locate Array variables and Change them
$html = str_replace('$per_page = 1;', ' $per_page = 1; if ($per_page > 35) $per_page = 35;', $html);
//#######// Create new file
$fp=fopen("search1.php",'w');
//#######//write new search page
fwrite($fp,$html);
//#######// Close new search page
fclose($fp);
echo 'Done';
?>
Comment