Banner

Sponsor

Login


Welcome Back!
Guest
Guest

Register

Lost your password?

49 users online



Quick Variable Question

Quick Variable Question

Currently viewing this thread: 1 (0 members and 1 guests)


SolidCell

SolidCell

I use Photoshop and like to help out the new guys
Status: Offline!

Quick Variable Question

hey i was trying to make my program dynamic by adding variables, but it always comes out with the same calcualtions with different variable values, when the static version works fine...am I doing something wrong? the PHP version on the server is v4. I need an form page to send this script the variable data, so i need ithe dynamic script to work. thanks guys!

static-works:

<html>
<head>
<title>Age ****</title>
</head>
<body>
<p>
<?php
function years() {
return (days() / 365);
}
function days() {
return (hours() / 24);
}
function hours() {
return (minutes() / 60);
}
function minutes() {
return (seconds() / 60);
}
function seconds() {
return (time() - mktime(0, 0, 0, 8, 23, 1987));
}
echo 'Jesse is ' . round(years(), 2) . ' years old, ';
echo round(days()) . ' days old, ';
echo round(hours()) . ' hours old, ';
echo round(minutes()) . ' minutes old, ';
echo 'and ' . round(seconds()) . ' seconds old.';
?>
</p>
</body>
</html>

dynamic-doesn't work:

<html>
<head>
<title>Age ****</title>
</head>
<body>
<p>
<?php
$name = 'Jesse';
$month = 8;
$day = 23;
$year = 1987;
function years() {
return (days() / 365);
}
function days() {
return (hours() / 24);
}
function hours() {
return (minutes() / 60);
}
function minutes() {
return (seconds() / 60);
}
function seconds() {
return (time() - mktime(0, 0, 0, $month, $day, $year));
}
echo $name . ' is ' . round(years(), 2) . ' years old, ';
echo round(days()) . ' days old, ';
echo round(hours()) . ' hours old, ';
echo round(minutes()) . ' minutes old, ';
echo 'and ' . round(seconds()) . ' seconds old.';
?>
</p>
</body>
</html>

___________________

Signature Rules

Quick Jump:

Main Navigation


Site & Graphic Design by Aeon Tan
Developed by Jeremie Pelletier & Scott Roach


NeverAPI generated this page in 0.0062 seconds.