When i do refresh in php, the data in iframe become blank. How i still get the search results in iframe after press "refresh" button? Thanks!


In the iframe, it just like the search information php

<iframe width="650" height="400" frameborder="0" scrolling="yes" copyhistory="yes" name="Shopping" src="http://localhost/search.php" ></iframe>

If iframe's search page is your php code then you can make a session and save last url in that session.
When page is loaded or refreshed you can use session's remembered url as a src of iframe.

Member Avatar

WHy are you using an iframe? Possible to use ajax?

What is the code to save the last url? Thanks!

What is the code to save the last url? Thanks!

This is the simplest way to save current page url.
<?
	$_SESSION['sess_currPageName'] = basename($_SERVER['PHP_SELF']).'?'.$_SERVER['QUERY_STRING'];
?>

Agree to ardav, i also prefer ajax than iframe.
As in ajax all controls are in your hand.