Hello i'm trying to realize where i'm doing wrong if any one of u can tell me where i'm wrong i'll be thankfull .
so my problem is i have a button and when i click on that it's working OK but the problem if i reload the page the function excetuciton itself so ...
So all is working ok but i want to executee the function just onclick of button not On Refresh of page .... ?
any suggestion or any help ?
so my problem is i have a button and when i click on that it's working OK but the problem if i reload the page the function excetuciton itself so ...
<script type="text/Javascript" >
function checkout()
{
<?php
include "database.php";
$UserID = 0 ;
$$Types = 1 ;
if (!$mysqli->query("CALL h_check_out('$id','$ReservationID' , '$Client' , '$RoomNumber' , '$UserID', '$Types')"))
{
echo "CALL failed: (" . $mysqli->errno . ") " . $mysqli->error;
}
?>
alert ("Check in realizaed succesfully");
window.location.reload();
}
</script>
<input type="button" id="php_code" onclick="checkout()" value="Checkout">
So all is working ok but i want to executee the function just onclick of button not On Refresh of page .... ?
any suggestion or any help ?