It appears you have not yet registered with DEVPPL. To register please click here... (it's fast, easy and free!)

Forum

Log In Sponsors
Board index Programming PHP and MySQL Forum

Image Verification

Moderator: Malcolm

Re: Image Verification

Postby dflynn on Thu Mar 19, 2009 4:54 am

entered just like that, print_r($_COOKIE); , it shows

Debugging info:

Submitted verification: 8916

Required verification:

Array ( )
User avatar
dflynn
500+ Club
 
Posts: 860
Joined: Wed Oct 03, 2007 9:06 pm
Location: Guelph, Canada

Re: Image Verification

Postby dflynn on Thu Mar 19, 2009 4:55 am

entered with the cookie's name, still nothing.
User avatar
dflynn
500+ Club
 
Posts: 860
Joined: Wed Oct 03, 2007 9:06 pm
Location: Guelph, Canada

Re: Image Verification

Postby rangana on Thu Mar 19, 2009 4:58 am

What's with your verification variable.

Have you checked the input from the cookie you've set.

Please change this part:
Code: Select all
if(isset($todo)) {


...with
Code: Select all
if(isset($todo)) {
echo 'Input => '.(md5($verification).'a4xn').' Cookie => '.$_COOKIE['tntcon'];


Please let me know once your done so I could see it from your page.
User avatar
rangana
500+ Club
 
Posts: 935
Joined: Wed Feb 27, 2008 5:14 am
Location: Cebu City Philippines

Re: Image Verification

Postby rse on Thu Mar 19, 2009 4:59 am

That means it is not storing the cookie when the dynamic image generator script is run.

It's strange because when I run it on my server it works fine. I had a problem earlier where a cookie wouldnt set until I specified the domain and path in the setcookie, so maybe you could try this is your image generator:

Code: Select all
setcookie("tntcon", md5($rand_string).'a4xn', time()+60*60*24*30, "/", ".nnjoi.com");


Let me know how it goes :)
Adam Williams
PHP Web Developer

Personal: http://30things.net
Blog: http://www.root-servers.co.uk
User avatar
rse
100+ Club
 
Posts: 141
Joined: Sun Oct 10, 2004 8:15 pm
Location: Leeds, UK

Re: Image Verification

Postby dflynn on Thu Mar 19, 2009 5:03 am

Ok, Rangana, it's changed. Feel free to take a look
User avatar
dflynn
500+ Club
 
Posts: 860
Joined: Wed Oct 03, 2007 9:06 pm
Location: Guelph, Canada

Re: Image Verification

Postby dflynn on Thu Mar 19, 2009 5:04 am

rse wrote:That means it is not storing the cookie when the dynamic image generator script is run.

It's strange because when I run it on my server it works fine. I had a problem earlier where a cookie wouldnt set until I specified the domain and path in the setcookie, so maybe you could try this is your image generator:

Code: Select all
setcookie("tntcon", md5($rand_string).'a4xn', time()+60*60*24*30, "/", ".nnjoi.com");


Let me know how it goes :)


It's weird too cause it works with the contact form. Could it be causing an issue that I'm trying to get it to work with both forms?
I wouldn't think it would cause it's supposed to reset after the forms submitted.
User avatar
dflynn
500+ Club
 
Posts: 860
Joined: Wed Oct 03, 2007 9:06 pm
Location: Guelph, Canada

Re: Image Verification

Postby rse on Thu Mar 19, 2009 5:06 am

You could try changing the name of the cookie just to make sure. So change all references to tntcon to tntcon2 for example.
Last edited by rse on Thu Mar 19, 2009 5:06 am, edited 1 time in total.
Adam Williams
PHP Web Developer

Personal: http://30things.net
Blog: http://www.root-servers.co.uk
User avatar
rse
100+ Club
 
Posts: 141
Joined: Sun Oct 10, 2004 8:15 pm
Location: Leeds, UK

Re: Image Verification

Postby dflynn on Thu Mar 19, 2009 5:06 am

The last bit seemed to work Adam,
it didn't submit to the database it looks like, but it said that everything was alright and the hashs matched.
User avatar
dflynn
500+ Club
 
Posts: 860
Joined: Wed Oct 03, 2007 9:06 pm
Location: Guelph, Canada

Re: Image Verification

Postby rse on Thu Mar 19, 2009 5:07 am

Yeah I just tested it and it seemed to run successfully.

Just need to check your db connection now.

Glad we got it sorted.

:)
Adam Williams
PHP Web Developer

Personal: http://30things.net
Blog: http://www.root-servers.co.uk
User avatar
rse
100+ Club
 
Posts: 141
Joined: Sun Oct 10, 2004 8:15 pm
Location: Leeds, UK

Re: Image Verification

Postby dflynn on Thu Mar 19, 2009 5:10 am

Excellent. it's working perfectly. Thanks for all the help guys. :D
User avatar
dflynn
500+ Club
 
Posts: 860
Joined: Wed Oct 03, 2007 9:06 pm
Location: Guelph, Canada

PreviousNext

Who is online

Users browsing this forum: No registered users and 0 guests