I am modifying the accepted answer by Frank Farrer to work for different requests:
Turning it on twice will cause a problem:
$_REQUEST['mls'] = $_REQUEST['mlid']; $_REQUEST['lid'] = 0; $_REQUEST['v'] = 'agent'; include("agentview.php"); //changing the v to another $_REQUEST['v'] = 'agent2'; include("agentview.php");
For those who are facing this issue with multiple inclusions, you can wrap the code inside "agentview.php" in a function:
Inside agentview.php
function abc($mls,$lid,$v){ ...your original codes here... }
file must be called agentview.php
include_once("agentview.php"); abc($_REQUEST['mlid'], 0, 'agent'); abc($_REQUEST['mlid'], 0, 'agent2');
Hope this helps someone run into the same problem as me, and thanks to Frank Farmer for the great solution that saved me a lot of time.
jeffsama
source share