SitePoint Sponsor

User Tag List

Results 1 to 9 of 9
  1. #1
    Non-Member
    Join Date
    Nov 2003
    Location
    here
    Posts
    258
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Those "Image Verification" things you see on web sites:

    I'm trying to make one. I make a random string then print it in an image. The image displays ok when I do img src="imageverification.php"...

    However the question is, how can I get the string created in imageverification.php into my form.php file, it's really confused me.

  2. #2
    Tranceoholic lilleman's Avatar
    Join Date
    Feb 2004
    Location
    Írebro, Sweden
    Posts
    2,716
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Hi,

    I think it would be a better solution to store the random code in a session variable instead. This verification method is often used to prevent automated scripts from abusing your script, and if the code can be accessed publically, the verification would be of no use.
    ERIK RIKLUND :: Yes, I've been gone quite a while.

  3. #3
    Brian.Michael Metalish's Avatar
    Join Date
    Nov 2004
    Location
    Virginia Beach, VA
    Posts
    174
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    I used google and found this.....
    http://www.phpnoise.com/tutorials/1/2

  4. #4
    Non-Member
    Join Date
    Nov 2003
    Location
    here
    Posts
    258
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Tried setting session variable, but I'm using a database session wrapper. For some reason it adds a different string to the session data to the one displayed in the image, maybe the previously created string or something.

    Doesn't seem to be working though

    Hmm but maybe I need to wait for the form to submit for the value to be updated, not sure sessions are funny

  5. #5
    Tranceoholic lilleman's Avatar
    Join Date
    Feb 2004
    Location
    Írebro, Sweden
    Posts
    2,716
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Hi,

    Perhaps you have some code you can show to us? It would be easier to help then.
    ERIK RIKLUND :: Yes, I've been gone quite a while.

  6. #6
    Non-Member
    Join Date
    Nov 2003
    Location
    here
    Posts
    258
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    There code just doesn't work for me...

    It's simply creating random string, creating session variable, outputting image.

    Now when I put the <img src="imagecreator.php"> in it's not adding the variable to the session, even if I use session_start in the imagecreator.php....

    Not sure about this

  7. #7
    Freelance Web Guy freekrai's Avatar
    Join Date
    May 2003
    Location
    Penticton,BC
    Posts
    400
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    I've made these for quite a few sites and scripts, and yes, you store a variable as a session which you then compare to the value entered on the next step of verifying data.
    Not sure why you're database wrapper would be doing weird things to the session, but it might be an idea to fix the wrapper or simply use the usualy db code.
    Roger Stringer
    DBStract - Build a database - Gather data - View it from every angle
    Other Sites: [ 1 ][ 2 ][ 3 ][ 4 ][ 5 ]


  8. #8
    Sell crazy someplace else markl999's Avatar
    Join Date
    Aug 2003
    Location
    Manchester, UK
    Posts
    4,007
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    There's a PEAR package for this if you're into that sorta thing. See the examples in the package for .. examples

  9. #9
    SitePoint Addict
    Join Date
    Oct 2004
    Location
    Brooklyn, NY
    Posts
    359
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Quote Originally Posted by markl999
    There's a PEAR package for this if you're into that sorta thing.
    There's also an article about this:

    http://phpsec.org/articles/2005/text-captcha.html
    Chris Shiflett
    http://shiflett.org/


Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •