Beauford.2002 | 24 Mar 1998 02:44
Favicon

Calculating the difference between two dates

Does any one know how to calculate the difference between two dates. I need
to find out the age of a user to make sure they are over the age of 13. I
have searched for hours on this and found nothing that will help.

TIA

--

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php

Beauford.2002 | 24 Mar 1998 05:53
Favicon

Re: reloading a page..

It's definitely going through the if statement as it does "reload" the
page - print($_SERVER['HTTP_REFERER']); shows
http://www.myserver.com/oldpage.html - which is correct. print("{$userlevel}
and {$neededlevel}"); also shows the correct info.   $no_permission does
have a string, but even if I hard code the message it still doesn't work.

Note though....if I take out  include ($_SERVER['HTTP_REFERER']); from the
if statement and put in print($_SERVER['HTTP_REFERER']); and print
$message - they both display.

So I am at a loss....

> No you shouldn't rely on it to do anything important but in your case
> its just where the user will be redirected to.  Even if someone fakes
> the referrer to point to the restricted page it will just go into an
> infinite loop.
>
> > if($userlevel != $neededlevel) {
> > include ($_SERVER['HTTP_REFERER']);
> > $message = $no_permission;
> > $exit;
> > }
> >
> > ...on referring page....
> >
> > <? if ($message) { echo $message; } ?>
>
> Code seems fine.  You probably are never entering into that if
> statement or the referrer is outputting something unexpected.
> Use some print statements to debug this..
(Continue reading)


Gmane