RE: Re: My own "captcha" from 2 years ago......

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



.... Sorry.. Was playing around with dates and how long I've been sitting
here watching this generate random numbers..... Lol .. The only lines
referring to the "captcha" are the img lines... As you can tell... Calling
the next script... Should I do it this way? I'm pretty sure that is the
problem, cause the session variable is being created and set in that second
script which is called....  Session[security_code] is created in rnum1.php,
and session[code] is created in rnum2.php... Which I didn't include here...
But is the same concept only bigger.....

Index.php 
<?php
session_start();
header("Refresh: 1");

$before = $_SESSION['security_code'];

echo "<img src='rnum1.php'>";

$after = $_SESSION['security_code'];

if (!isset($_SESSION['start_time']))
{
  $_SESSION['start_time'] = time();
}
else
{
  $_SESSION['current_time'] = time();
}

$running_time = mktime(date("H", $_SESSION['current_time'])-date("H",
$_SESSION['start_time']), date("i", $_SESSION['current_time'])-date("i",
$_SESSION['start_time']), date("s", $_SESSION['current_time'])-date("s",
$_SESSION['start_time']), date("m", $_SESSION['start_time']), date("d",
$_SESSION['start_time']), date("Y", $_SESSION['start_time']));

echo '<br>Before: ' . $before . '<br>After: ' . $after . '<br>Time: ' .
date("H:i:s m-d-Y", $running_time) . '<br><img src=rnum2.php><br>' .
$_SESSION['code'];

?> 




Rnum1.php

<?php
session_start();

header("Content-type: image/png");

$_SESSION['security_code'] = $code = rand(1000,9999);

//width, height
$im = @ImageCreate(40, 20) or die("There is an error Jake");

// R, G, B
$background_color = ImageColorAllocate($im, 255, 255, 255);

//R, G, B
$text_color = ImageColorAllocate($im, 0, 0, 0);

//font size, left margin, top margin
ImageString($im, 10, 3, 3, $code, $text_color);

//display image
ImagePNG($im);

?>










> -----Original Message-----
> From: itoctopus [mailto:newsgroup@xxxxxxxxxxxxx] 
> Sent: Sunday, March 25, 2007 12:49 AM
> To: php-general@xxxxxxxxxxxxx
> Subject:  Re: My own "captcha" from 2 years ago......
> 
> Hey Jake,
> I checked the thing, and I tell you I did lots and lots of 
> captchas in my
> life and they mainly rely on the session.
> Is it possible for you to post the script so that me (or 
> anyone else for
> that matter) fix it for you?
> 
> Take care,
> 
> --
> itoctopus - http://www.itoctopus.com
> ""Jake McHenry"" <linux@xxxxxxxxxxxxxxxxx> wrote in message
> news:1c8a01c76e8d$a23cb4c0$6401a8c0@xxxxxxxxxxxxx
> > Well, I've been creating my own... Since like two years 
> ago... Lol.. But
> > this is the KNOWN name now..... Anyways... How can I get 
> the info from the
> > image creation script back to my main script? Sessions DO 
> NOT WORK! They
> > give me the previous entry instead of the current.. Which 
> obviously won't
> > work... This was on the back burner for a long time, but my 
> boss said
> .....
> > Oh wow.. That looks cool... And I told him I had started it 
> a long time
> > ago.. But never finished it cause he told me to work on 
> something else...
> > Anyways... U can see what I mean.... http://nittanytravel.com:8080/
> >
> > The numbers surrounding the images displayed are session 
> values created in
> > the image scripts...which as you will see are the previous 
> value.... It
> may
> > be a simple fix.. But once again... I'm tired... And had 
> one too many long
> > island iced teas tonight to think about this..... And 
> yes... My boss works
> > me even on saturdays after happy hour :(
> >
> >
> > Thanks,
> > Jake
> >
> >
> > --
> > No virus found in this outgoing message.
> > Checked by AVG Free Edition.
> > Version: 7.5.446 / Virus Database: 268.18.17/731 - Release 
> Date: 3/23/2007
> > 3:27 PM
> >
> 
> -- 
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, visit: http://www.php.net/unsub.php
> 
> -- 
> No virus found in this incoming message.
> Checked by AVG Free Edition.
> Version: 7.5.446 / Virus Database: 268.18.17/731 - Release 
> Date: 3/23/2007 3:27 PM
>  
> 

-- 
No virus found in this outgoing message.
Checked by AVG Free Edition.
Version: 7.5.446 / Virus Database: 268.18.17/731 - Release Date: 3/23/2007
3:27 PM
 

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


[Index of Archives]     [PHP Home]     [Apache Users]     [PHP on Windows]     [Kernel Newbies]     [PHP Install]     [PHP Classes]     [Pear]     [Postgresql]     [Postgresql PHP]     [PHP on Windows]     [PHP Database Programming]     [PHP SOAP]

  Powered by Linux