If returning a floating point variable, cast it back to an (int)
hth

"Tristan Pretty" <[EMAIL PROTECTED]> wrote in message
news:[EMAIL PROTECTED]
> Cheers for all ideas/suggetions so far..
> I've made a little progres...
> Visit this URL:
> http://www.risk.sungard.com/secure.php?secure=126807.714285714
>
> and here's the code..
> <?
>         $today_day = date("d");
>         $code1 = ($today_day+1) * $_GET[secure];
>         $code2 = $today_day * $_GET[secure];
>         $code3 = ($today_day-1) * $_GET[secure];
>         $master_code = "887654";
>
> if (($code1 == $master_code) || ($code2 == $master_code) || ($code3 ==
> $master_code)) {
>         $woopee = "<h2>DONE IT!!!</h2>";
> }
>
> ?>
> <html>
> <head>
>         <title>Secure Test</title>
> </head>
> <body>
> <?=$woopee ?>
> <b>Debug:</b>
> <br />Secure: <?=$_GET[secure] ?>
> <br />Day: <?=$today_day ?>
> <br />Master: <?=$master_code ?>
> <br />Code 1: <?=$code1 ?>
> <br />Code 2: <?=$code2 ?>
> <br />Code 3: <?=$code3 ?>
> </body>
> </html>
>
> If I change the GET requests to simple variables, and assign a new
> variable called $secure, and asign it the value: 126807.714285714
> The page works!
> Makes me think there's a GET error?
>
> Can anyone spot my potentially obvious error?
>
> Tris...
>
>
>
>
>
>
> Jason Wong <[EMAIL PROTECTED]>
> 07/05/2004 13:37
>
> To
> [EMAIL PROTECTED]
> cc
>
> Subject
> Re: [PHP] A work around my HTTP_REFERER Prob...
>
>
>
>
>
>
> On Friday 07 May 2004 20:05, [EMAIL PROTECTED] wrote:
>
> > > varibale called 'secure'
> > > we asign that variable that value of '4654376534' and divide it by the
> >
> > day
> >
> > > (eg: if it's the 12th of may, we divide by 12.. 7th of June, we divide
> >
> > by
> >
> > > 7)
>
> That would result in a floating point number ...
>
> > > if (($code1 == $master_code) || ($code2 == $master_code) || ($code3 ==
> > > $master_code)) {
>
> ... which does not lend easily to such comparisons.
>
> If you're still intent on using this *ahem* 'security' scheme then I
> suggest
> you use multiplication instead (just make sure that the largest number
> you're
> processing is less than 2147483648 - or use the BCMath functions).
>
> -- 
> Jason Wong -> Gremlins Associates -> www.gremlins.biz
> Open Source Software Systems Integrators
> * Web Design & Hosting * Internet & Intranet Applications Development *
> ------------------------------------------
> Search the list archives before you post
> http://marc.theaimsgroup.com/?l=php-general
> ------------------------------------------
> /*
> After all, it is only the mediocre who are always at their best.
>                                  -- Jean Giraudoux
> */
>
> -- 
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, visit: http://www.php.net/unsub.php
>
>
>
>
>
> *********************************************************************
> The information contained in this e-mail message is intended only for
> the personal and confidential use of the recipient(s) named above.
> If the reader of this message is not the intended recipient or an agent
> responsible for delivering it to the intended recipient, you are hereby
> notified that you have received this document in error and that any
> review, dissemination, distribution, or copying of this message is
> strictly prohibited. If you have received this communication in error,
> please notify us immediately by e-mail, and delete the original message.
> ***********************************************************************

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

Reply via email to