Jump to content

PHP with Javascript


corkg

Recommended Posts

<?

session_start();

include "includes/_db_connect.php";

include "includes/_functions.php";

logincheck();

$username=$_SESSION['username'];

$above = mysql_query("SELECT * FROM users WHERE username='$username'");

$info = mysql_fetch_object($above);

$left = $info->lastcrime - time();?>

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">

<html xmlns="http://www.w3.org/1999/xhtml">

<head>

<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />

<title>Untitled Document</title>

 

 

<SCRIPT LANGUAGE="JavaScript">

 

var start=new Date();

start=Date.parse(start)/1000;

var counts= <<<<Variable here>>>>> function CountDown(){

var now=new Date();

now=Date.parse(now)/1000;

var x=parseInt(counts-(now-start),10);

if(document.form1){document.form1.clock.value = x +" Seconds";}

if(x>0){

timerID=setTimeout("CountDown()", 1000)

}else{

location.href="http://javascript.internet.com"

}

}

//  End -->

</script>

<SCRIPT LANGUAGE="JavaScript">

<!--

window.setTimeout('CountDown()',100);

-->

</script></head><body><? echo"$left" ?><FORM NAME="form1">

You are being redirected in

<INPUT TYPE="text" NAME="clock" readonly style="border:0">

 

</FORM>

 

</body>

</html>

 

Link to comment
https://forums.phpfreaks.com/topic/63419-php-with-javascript/#findComment-316053
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.