Jump to content

[SOLVED] click button without page refresh


nutt318

Recommended Posts

I have the following code when clicking the button in modifies a text file. Is there a way that I can click the button without the page refreshing? Basically there is a video feed on this same page and i have to restart it when clicking the button because it refreshes the page.

 


<?php
if($_POST['Submit']){
   $open = fopen("test.txt","a+");
   $text = "Left\n";
   fwrite($open, $text);
   fclose($open);
}
echo "<form action=\"".$_SERVER['PHP_SELF']."\" method=\"post\">";
echo "<input name=\"Submit\" type=\"submit\" value=\"Left\" />\n
</form>";
?>

 

Can I use a frame or a different type of php code?

 

Thanks.

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.