How to execute a php code when a web page is opened

0

How can I make an .php file when I open my web.html page, I leave the php file that I am occupying:

<!DOCTYPE html>
<html lang="es">

<head>
  <meta charset="UTF-8">
  <title>Notificaciones web</title>
  <script src="js/push.min.js"></script>
</head>

<body>
  <?php
echo '<script>
Push.create("descripcion",{
body: "descripcion 2",
icon: "img/logo.png",
timeout: 4000,
onClick: function () {
window.location="https://www.google.cl/";
this.close();
}
});
</script>';
?>
</body>

</html>

The code is complete, it is the PHP of webpush , the truth is that my web design is in HTML that is to say I have a index.html that is the one that opens when I open my website, what I need is that when loading my website will run this php, since it is a notification webpush .

    
asked by SWAT 15.07.2017 в 03:28
source

0 answers