You could pass a url parameter to the page identifying the page that it came from from one page or the other. Then use that to change the redirect page based on the page it came from like:
<?php echo(isset($_GET["media"])?"mediaresults.php":"clientresults.php"); ?>