Here's what I'm trying to do, I have a page with a button on it, and I want to execute a PHP function when the button is clicked. This is what I have and it doesn't seem to be working. When I click the button I get an error "Object Expected"
<SCRIPT LANGUAGE="PHP">
function my_function() {
$host = "192.168.0.6";
$port = "70";
$timeout = "60";
$fp = fsockopen($host, $port, &$errno, &$errstr, $timeout);
}
</SCRIPT>
<CENTER><input type="button" value="GO!" onclick="my_function()"></CENTER>
Now I know why this isn't working because when the page is being loaded its not picking up the PHP. How can I do this so when I click the button, it executes the function but does NOT reload the page.
Any help would be greatly apreciated.
Thanks,
Zang