Hello and welcome to our community! Is this your first visit?
Register
Enjoy an ad free experience by logging in. Not a member yet? Register.
Results 1 to 3 of 3
  1. #1
    New to the CF scene
    Join Date
    Jan 2009
    Posts
    1
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Unhappy help in this image varification code in php

    help in this image varification contact form .the form is no working with image varification.
    my 2 fiiles are

    1) contact.php
    PHP Code:
    <?php

    session_start
    (); 
    if (
    $_POST["vercode"] != $_SESSION["vercode"] OR $_SESSION["vercode"]=='')  { 
         echo  
    '<strong>Incorrect verification code.</strong><br>Please use your back Button and try again'
    } else { 
    if (isset(
    $_POST['submit'])){

    $to="".$_POST['friendemail']."";

    $subject="".$_POST['yourname']." wants you to check this out!";

    $mail_from="from: ".$_POST['youremail']." \n";

    $mail_from .="Content-Type: text/html; charset=utf-8 \n";

    $message="<font size=\"2\" face=\"Verdana\"> <b>".$_POST['friendemail']."</b>,<br />
    "
    .$_POST['yourname']." wants you to check this website!!:<br />

    <a href=\"http://www.google.com\">google</a> </font>"
    ;

    $sentmail mail($to,$subject,$message,$mail_from);

    echo 
    "We told your friend!";


    }else{
    echo  
    '<strong>Verification successful.</strong><br>'
    };
    ?>

    <form action="contact.php" method="post">
    Your Name:<br />
    <input type="input" name="yourname" /><br />
    Your Email:<br />
    <input type="input" name="youremail" /><br />
    Friend name:<br />
    <input type="input" name="friendname" /><br />
    Friend email:<br />
    <input type="input" name="friendemail" /><br /><br />
    <br> 
    Enter Code <img src="captcha.php"><input type="text" name="vercode" /><br> 
    <input type="submit" name="submit" value="Tell Your Friend" />
    </form>

    <?php ?>
    2) captcha.php
    PHP Code:
    <?php 
    session_start
    (); 
    $text rand(10000,99999); 
    $_SESSION["vercode"] = $text
    $height 25
    $width 65
     
    $image_p imagecreate($width$height); 
    $black imagecolorallocate($image_p000); 
    $white imagecolorallocate($image_p255255255); 
    $font_size 14
     
    imagestring($image_p$font_size55$text$white); 
    imagejpeg($image_pnull80); 
    ?>
    Last edited by Inigoesdr; 01-26-2009 at 12:33 AM.

  • #2
    Supreme Master coder! abduraooft's Avatar
    Join Date
    Mar 2007
    Location
    N/A
    Posts
    14,865
    Thanks
    160
    Thanked 2,224 Times in 2,211 Posts
    Please edit your post and change the font-size to normal and use [CODE][/CODE] tag to wrap your code instead.
    The Dream is not what you see in sleep; Dream is the thing which doesn't let you sleep. --(Dr. APJ. Abdul Kalam)

  • #3
    Super Moderator Inigoesdr's Avatar
    Join Date
    Mar 2007
    Location
    Florida, USA
    Posts
    3,647
    Thanks
    2
    Thanked 406 Times in 398 Posts
    Please remember to read the stickies, rules and posting guidelines for this forum. In particular the one about using [php][/php] tags when posting code.


  •  

    Posting Permissions

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