Jump to content


Photo

PHP doesn't output a response can anyone help


  • Please log in to reply
3 replies to this topic

#1 madspof

madspof
  • Members
  • PipPipPip
  • Advanced Member
  • 271 posts

Posted 26 October 2006 - 09:41 PM

I have created this script and i cannot not get it to work anyone that could fix it and point out were i went wrong I would be very gratefull.

<html>
<head>
<title></title>
<META HTTP-EQUIV="refresh" content="60;URL=status1.php">
<style type="text/css">
<!--
body {
background-image: url(navi.jpg);
}
-->
</style>
<!-- The closing HEAD tag is right below this -->
</head>
<body bgcolor="white">
<?php
$hour = date('i/s');
$time = 10/00
if ($hour <= $time) {
echo "It's before ten minutes";
}
 
else { echo "Its past ten minutes";
}
?>
</body>
</html>

#2 Psycho

Psycho
  • Moderators
  • Move along, nothing to see here
  • 11,892 posts
  • LocationCanada

Posted 26 October 2006 - 10:15 PM

<?php

$minutes = date('i') + date('s')/60;
if ($minutes <= 10) {
   echo "It's before ten minutes" . $minutes;
}
 else {
  echo "Its past ten minutes" . $minutes;
}

?>

The quality of the responses received is directly proportional to the quality of the question asked.

I do not always test the code I provide, so there may be some syntax errors. In 99% of all cases I found the solution to your problem here: http://www.php.net

#3 madspof

madspof
  • Members
  • PipPipPip
  • Advanced Member
  • 271 posts

Posted 26 October 2006 - 11:29 PM

what is the need for the /60

#4 Psycho

Psycho
  • Moderators
  • Move along, nothing to see here
  • 11,892 posts
  • LocationCanada

Posted 26 October 2006 - 11:53 PM

I was calculating minutes. So, if you have 9 minutes and 30 seconds you can't just add them together - you would have 39.

9 minutes + 30 seconds/60 = 9.5 minutes.
The quality of the responses received is directly proportional to the quality of the question asked.

I do not always test the code I provide, so there may be some syntax errors. In 99% of all cases I found the solution to your problem here: http://www.php.net




0 user(s) are reading this topic

0 members, 0 guests, 0 anonymous users