Jump to content

Possible to trigger php using javascript?


env3rt

Recommended Posts

Is it possible to use a javascript event (ex: onUnload()) and combine it with php so it would be weird but maybe something like this

 

<?php
echo "
<head>
<script>
function suber() {";
// EXAMPLE BELOW
$expage="expage.html";
$fh = fopen($expage, 'w');
$expagewriting = "hey";
fwrite($fh, $expagewriting);
fclose($fh);
//EXAMPLE ABOVE
echo "
}
</script>
</head>

<body onUnload='suber()'></body>";

?>

If you don't understand or can help please post :)

 

 

Link to comment
https://forums.phpfreaks.com/topic/74010-possible-to-trigger-php-using-javascript/
Share on other sites

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.