Jump to content

scferg

Members
  • Posts

    68
  • Joined

  • Last visited

    Never

Profile Information

  • Gender
    Not Telling

scferg's Achievements

Member

Member (2/5)

0

Reputation

  1. Well, I certainly don't know how to do that Oh well... Thanks for the help though!
  2. I need the code to work with this form: Which already has an action value (not result.php). Therefore, the CAPTCHA code is not checked for validity. <form action="http://mysite.com/v-cgi/forms.cgi" enctype="application/x-www-form-urlencoded" method="post"> <table style="font-family: helvetica; font-size: 12px;"> <tr> <th align="right"> Name: </th> <td> <input class="input" type="text" name="Name" size="30" /> </td> </tr> <tr> <th align="right"> Email Address: </th> <td> <input class="input" type="text" name="Email_Address" size="30" /> </td> </tr> <tr> <th align="right"> Message Subject: </th> <td> <input class="input" name="Message_Subject" size="30" /> </td> </tr> <tr valign="top"> <th align="right"> Message: </th> <td> <textarea class="input2" name="Message" rows="6" cols="30"></textarea> </td> </tr> <tr valign="top"> <th align="right"> Validation: </th> <td> <img style="margin-bottom:5px;" alt="Random Number" src="http://sims2news.com/image.php"><br /> <input class="input" type="text" name="num" size="30" /> </td> </tr> <tr> <th></th> <td> <input class="submit" type="submit" name="Submit" value="Submit" onclick="submitForm();" /> <input class="submit" type="reset" name="Submit" value="Reset" /> </td> </tr> </table><input type="hidden" name="_FORMID" value="###" /> </form>
  3. The script requires 3 files. image.php (self explanatory) <?php // Font directory + font name $font = 'fonts/Disney.ttf'; // Total number of lines $lineCount = 40; // Size of the font $fontSize = 40; // Height of the image $height = 50; // Width of the image $width = 150; $img_handle = imagecreate ($width, $height) or die ("Cannot Create image"); // Set the Background Color RGB $backColor = imagecolorallocate($img_handle, 255, 255, 255); // Set the Line Color RGB $lineColor = imagecolorallocate($img_handle, 175, 238, 238); // Set the Text Color RGB $txtColor = imagecolorallocate($img_handle, 135, 206, 235); // Do not edit below this point $string = "abcdefghijklmnopqrstuvwxyz0123456789"; for($i=0;$i<6;$i++){ $pos = rand(0,36); $str .= $string{$pos}; } $textbox = imagettfbbox($fontSize, 0, $font, $str) or die('Error in imagettfbbox function'); $x = ($width - $textbox[4])/2; $y = ($height - $textbox[5])/2; imagettftext($img_handle, $fontSize, 0, $x, $y, $txtColor, $font , $str) or die('Error in imagettftext function'); for($i=0;$i<$lineCount;$i++){ $x1 = rand(0,$width);$x2 = rand(0,$width); $y1 = rand(0,$width);$y2 = rand(0,$width); imageline($img_handle,$x1,$y1,$x2,$y2,$lineColor); } header('Content-Type: image/jpeg'); imagejpeg($img_handle,NULL,100); imagedestroy($img_handle); session_start(); $_SESSION['img_number'] = $str; ?> form.php (a form showing it in action) <form action="result.php" method="post"> <img alt="Random Number" src="image.php"> <input type="text" name="num"><br> <input type="submit" name="submit" value="Check"> </form> result.php (where the code is checked) <?php session_start(); if($_SESSION['img_number'] != $_POST['num']){ echo'The number you entered doesn\'t match the image.<br> <a href="form.php">Try Again</a><br>'; }else{ echo'The numbers Match!<br> <a href="form.php">Try Again</a><br>'; } ?> And I still don't get what you are saying about $_POST['num'] == $_SESSION['Captcha']
  4. Well, my forms are weird...and the only thing I know how to do with php is a simple include statement. To see how my forms work, try one out here: http://sims2news.com/?page=contact I've added the CAPTCHA validation image and input box, but the result.php page is not in the action value. The result.php file is where the validation code is checked to see if it's correct or not. So, it's like I need two action values... :-\ Sorry for my lack of knowledge about this.
  5. Well, I was told to start a topic here about my question, so I am. I was referred to this CAPTCHA script for my forms. I have made those 3 files, and have got them the way I want them, but I have an issue. My forms already have action values, so I can't have the action=result.php code for the CAPTCHA to work. All of my form have an action value of http://mysite.com/v-cgi/forms.cgi. And if I get passed that problem, I have another issue. The result of the CAPTCHA either is "Code in correct" or "Code is incorrect." Well, I need the form to submit if the code is correct (instead of just saying the numbers are valid). So, if anybody has any help to offer, I'd really appreciate it.
  6. Then you can move it there. This kind of branched of my original Javascript thread.
  7. Hmmm....how would I implement this with my current forms if they already have an action? All of my forum have a action of http://mysite.com/v-cgi/forms.cgi
  8. Ok...nevermind again The Disney font was too hard to understand, and half the time the characters were cut off. I just changed it to a different font. Thanks the help !
  9. Nevermind...I just had to download the Disney.ttf font. But, now, I can't seem to get a valid code. http://sims2news.com/form.php Everything I've tried always returns with "The number you entered doesn't match the image."
  10. I tried the Advanced CAPTCHA script, but the image.php script seems messed up. Go to http://sims2news.com/image.php to see it. I don't know how to fix it...
  11. Ok, I was using that as a type of CAPTCHA thing. I just needed something simple, but it was dumb of me to do it this way -- the bots have already gotten passed it. I've search all over the internet for a *real* CAPTCHA system, but all of them seem confusing. Like, some require databases and such. Do any of you know of a good CAPTCHA script, or know how to make one? I really appreciate it
  12. Ok, got it. Anything else? I'm getting ready to contact my host to tell them to start the move.
  13. Here are my options: (radio buttons) - Structure only - Structure and data - Data only - Export to XML format - LaTeX (check boxes) - Add 'drop table' - Complete inserts - Extended inserts - Enclose table and field names with backquotes - Save as file ( "zipped" "gzipped" ) What should I do?
  14. I haven't been able to upload anything via FTP to my site. I asked my host why it is, and they said it was because my server was full. So they said they are going to move me to a another server. They said I need to backup everything (duh), which I have. I downloaded my whole site (which took about 5 hours - 6,213 files, 314 folders). I've also backed up my forum and news system. I've never moved my site, so what else do I need to do -- if anything? They are moving my site, but I've backed everything up just to be safe. I'm also wondering if I need to backup my databases...if I do, please let me know how, I've never done it before. I use phpmyadmin, so any suggestions would be great. Thanks
×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.