Click to See Complete Forum and Search --> : PHP and page load


Maria76
02-03-2005, 05:07 AM
Hello,
Im now going to work on a web page where it is needed to send to the COM port some stuff when the user clicks on a certain button. However, as far as i have understood it has to be implemented so that this button click (in an html form)activates an action to another page for instance COMport.php .. The problem is that then the page has to be loaded again, and that may appear to the user which is not good. How is it possible to do this "com port stuff" in the "background" when activated without reloading the page?...

Thanks!

phpnovice
02-03-2005, 09:28 AM
Kindof a hack, but you could target the navigation result to a hidden IFRAME so that the user wouldn't see it.

<a href="commport.php?key=value" target="iframeName">Comm Link</a>
<iframe name="iframeName" style="display:none;"></iframe>

Maria76
02-04-2005, 02:52 AM
Thank you! I will try this! I have always heard about frames being BAAAAD BAAAAD, but I guess i have to do some kind of a thing here. the other solution would be to activate a javascript onclick event that would then execute the code?

phpnovice
02-04-2005, 08:23 AM
Well, if you want to talk about a JavaScript solution -- also a hack:

var tmp = new Image();
tmp.src = "commport.php?key=value";

That will send the request to the server side and you do not care about the response.
IE supports a cleaner client-to-server communication method in JavaScript.
Let me know if you want to know more about that.