Forum Moderators: coopster
Is any way I can make the page go blank (the page with the form) and show only the message while the page is loading?
I would use a meta refresh.
function refresh($search_data)
{
$html = '<html>';
$html .= '<head><title>Searching..</title></head>';
$html .= '<meta http-equiv=refresh content="3; url=search.php?keywords='.$search_data.'">';
$html .= '<body>';
$html .= 'Searching...please wait...';
$html .= '</body></html>';
exit;
}
Then on search submit you could use:
if (isset($_POST['keywords']))
{
echo refresh($_POST['keywords']);
}
Something like that might be ok. Or you can use javascript to pop up a message on submit.
dc
I try to uses flush(), but I'm not very familiar and I could make it work.
Then I tried the suggestion of dreamcatcher but I really didn't understand where to add the code. In the search page or in the result page.
I had:
search.php (with a template) --> results.php (with template)
I did some more research (I was hoping to find a example with AJAX, but I couldn't find it) and I found the following.
Make and extra page between the two that shows the message. with a meta redirection (like dreamcatcher suggested):
<META HTTP-EQUIV="refresh" content=1;URL="results.php?search_fields_">
Now I have:
search.php (with template) --> wait.php(with template) --> results.php (with template)
Is not working the way I really wanted to work but is better than nothing. The only downside is that is increasing the wait for the results to the already long wait.
Thanks again guys!