Jump to content


Photo

how to get php on server to clear client screen


  • Please log in to reply
5 replies to this topic

#1 gfridd

gfridd
  • New Members
  • Pip
  • Newbie
  • 2 posts

Posted 16 April 2006 - 09:15 PM

I have a php process running on the server that generates a webpage for the client's browser, does some calculateions and lookups, then I want it to clear the client's browser window (same one) and replace it with what the php process calculated. The problem I can't solve is how to blank that window before sending a new set of HTML to create the new window. What happens with whatever I have tried is that the new HTML jsut tacks onto the HTML that's already there. Anyone know how to do this?
Thanks!

#2 bonaparte

bonaparte
  • Members
  • PipPipPip
  • Advanced Member
  • 44 posts
  • Location#172, I Floor, 'Hamsashree', Defence Colony, Sahakaranagar, Bangalore, India

Posted 17 April 2006 - 03:06 PM

[!--quoteo(post=365401:date=Apr 16 2006, 04:15 PM:name=gfridd)--][div class=\'quotetop\']QUOTE(gfridd @ Apr 16 2006, 04:15 PM) View Post[/div][div class=\'quotemain\'][!--quotec--]
I have a php process running on the server that generates a webpage for the client's browser, does some calculateions and lookups, then I want it to clear the client's browser window (same one) and replace it with what the php process calculated. The problem I can't solve is how to blank that window before sending a new set of HTML to create the new window. What happens with whatever I have tried is that the new HTML jsut tacks onto the HTML that's already there. Anyone know how to do this?
Thanks!
[/quote]


Does sending a blank page in between serve the purpose?

#3 redbullmarky

redbullmarky
  • Staff Alumni
  • Advanced Member
  • 2,863 posts
  • LocationBedfordshire, England

Posted 17 April 2006 - 03:22 PM

[!--quoteo(post=365401:date=Apr 16 2006, 10:15 PM:name=gfridd)--][div class=\'quotetop\']QUOTE(gfridd @ Apr 16 2006, 10:15 PM) View Post[/div][div class=\'quotemain\'][!--quotec--]
I have a php process running on the server that generates a webpage for the client's browser, does some calculateions and lookups, then I want it to clear the client's browser window (same one) and replace it with what the php process calculated. The problem I can't solve is how to blank that window before sending a new set of HTML to create the new window. What happens with whatever I have tried is that the new HTML jsut tacks onto the HTML that's already there. Anyone know how to do this?
Thanks!
[/quote]

1, you say the new HTML tacks on to the end, but how are you currently sending the HTML to the browser?
2, is the process automated, or does it require the user to click/select/type something before the new page is requested?
"you have to keep pissing in the wind to learn how to keep your shoes dry..."

I say old chap, that is rather amusing!

#4 gfridd

gfridd
  • New Members
  • Pip
  • Newbie
  • 2 posts

Posted 18 April 2006 - 01:03 PM

[!--quoteo(post=365541:date=Apr 17 2006, 11:06 AM:name=bonaparte)--][div class=\'quotetop\']QUOTE(bonaparte @ Apr 17 2006, 11:06 AM) View Post[/div][div class=\'quotemain\'][!--quotec--]
Does sending a blank page in between serve the purpose?
[/quote]
I assume a 'page' means everything between <html> and </html>. If I send 3 pages from the same PHP process, the middle one being blank if you like, the 3 pages are tacked on one after the other, i.e. making one longer page. Maybe it's Firefox that's the problem?????

#5 AndyB

AndyB
  • Staff Alumni
  • Advanced Member
  • 5,465 posts
  • LocationToronto

Posted 18 April 2006 - 01:12 PM

The 'problem' is that there isn't any browser instruction that clears the display. That said, the 'solution' can only be to direct the browser to a new page, i.e. to a separate script.
Legend has it that reading the manual never killed anyone.
My site

#6 kenrbnsn

kenrbnsn
  • Staff Alumni
  • Advanced Member
  • 8,235 posts
  • LocationHillsborough, NJ, USA

Posted 18 April 2006 - 01:46 PM

To the OP:

Can you post the script you're using?

Try this script (created on the fly)
<?php
if (!isset($_GET['action'])) exit('You did not indicate what to do');
switch($_GET['action']) {
    case 'clear':
          exit();
          break;
    case 'page1':
          echo '<h1 style="text-align:center">This is Page 1</h1>';
          break;
    case 'page2':
          echo '<h1 style="text-align:center">Page 2<br>' . date('l, F j, Y \a\t G:i') . '</h1>';
          break;
    default:
          echo '<p style="text-align:center;font-weight:bold;color:red">This page has been intentionally left blank -- IBM :-)</p>';
}
?>

Ken




0 user(s) are reading this topic

0 members, 0 guests, 0 anonymous users