resolu Php Javascript
Posté : 25 avr. 2010, 17:33
Bonjour
j'ai un blem je n'arrive pas as inserer code php dans un script java
voici le script en java
voici se que je voudrais
j'ai un blem je n'arrive pas as inserer code php dans un script java
voici le script en java
<script type="text/JavaScript">
var Affiche=document.getElementById("Compte");
function Rebour() {
var date1 = new Date();
var date2 = new Date ("Apr 25 17:45:00 2010");
var sec = (date2 - date1) / 1000;
var n = 24 * 3600;
if (sec > 0) {
j = Math.floor (sec / n);
h = Math.floor ((sec - (j * n)) / 3600);
mn = Math.floor ((sec - ((j * n + h * 3600))) / 60);
sec = Math.floor (sec - ((j * n + h * 3600 + mn * 60)));
Affiche.innerHTML = + h +":"+ mn +":"+ sec + " ";
window.status = "Compte rebours";
}
else {
Affiche.innerHTML = "Temp Terminés";
window.status = "Comte rebour fini";
}
tRebour=setTimeout ("Rebour();", 1000);
}
Rebour();
</script>
je voudrais que (var date2(CODE PHP) ) mais rien a faire je trouve pasvoici se que je voudrais
[color=#FF0000]<?php
$date="Apr 25 17:45:00 2010";
?>[/color]
<script type="text/JavaScript">
var Affiche=document.getElementById("Compte");
function Rebour() {
var date1 = new Date();
var date2 = new Date ([color=#FF0000]<?= $date ?>[/color]);
var sec = (date2 - date1) / 1000;
var n = 24 * 3600;
if (sec > 0) {
j = Math.floor (sec / n);
h = Math.floor ((sec - (j * n)) / 3600);
mn = Math.floor ((sec - ((j * n + h * 3600))) / 60);
sec = Math.floor (sec - ((j * n + h * 3600 + mn * 60)));
Affiche.innerHTML = + h +":"+ mn +":"+ sec + " ";
window.status = "Compte rebours";
}
else {
Affiche.innerHTML = "Temp Terminés";
window.status = "Comte rebour fini";
}
tRebour=setTimeout ("Rebour();", 1000);
}
Rebour();
</script>
qui peut m'aide svp