Archive

Posts Tagged ‘image’

Crop image proportionally with PHP

November 6, 2009 ppshein Leave a comment

First of all, I’m not PHP geek. But, PHP is my second expert language after CF. I’ve created some freelance projects with PHP . You can hire me if you have some freelance projects for low cost and full reliable.

When I surf website for cropping image, I found this site. It’s cool. Check it out.

http://deepliquid.com/projects/Jcrop/demos/crop.php

Categories: php Tags: , ,

Image Captcha PHP

December 17, 2008 ppshein Leave a comment

In these days, one of my clients complaint me that he received a lot of spams from reservation form which I created without preventing spams. That’s why I need to put image captcha on it with PHP. For this, I don’t want to use complicated coding, and want to use simple way. That’s why I got suitable solutions from this website.

http://www.phpjabbers.com/captcha-image-verification-php19.html

<?php
session_start();
$text = rand(10000,99999);
$_SESSION["vercode"] = $text;
$height = 25;
$width = 65;

$image_p = imagecreate($width, $height);
$black = imagecolorallocate($image_p, 0, 0, 0);
$white = imagecolorallocate($image_p, 255, 255, 255);
$font_size = 14;

imagestring($image_p, $font_size, 5, 5, $text, $white);
imagejpeg($image_p, null, 80);
?>

Save this code in a file called captcha.php. Next we need to create our web form like register.html or reservation.html.

<form action=”submit.php” method=”post”>
Comment: <textarea name=”coment”></textarea><br>
Enter Code <img src=”captcha.php”><input type=”text” name=”vercode” /><br>
<input type=”submit” name=”Submit” value=”Submit” />
</form>

All we have to do now is to make the submit.php script which will check if the verification code you enter matches the one that has been randomly generated.

<?php
session_start();
if ($_POST["vercode"] != $_SESSION["vercode"] OR $_SESSION["vercode"]==”)  {
echo  ‘<strong>Incorrect verification code.</strong><br>’;
} else {
// add form data processing code here
echo  ‘<strong>Verification successful.</strong><br>’;
};
?>

Best Credit to : http://www.phpjabbers.com/captcha-image-verification-php19.html

Categories: php Tags: , , , ,

How to create Captcha in ASP.NET

September 12, 2008 ppshein Leave a comment

Image Captcha

 

In these days, our programmers need to create a simple customer feedback form for our client. As we all know, it’s quite simple to do. But, to have good security for our site, we should prevent any spam in advance. That’s why how to put Image Captcha in our site. I found following site.

Big Credit to : http://johnadonline.com/?tag=how-to-create-captcha-in-aspnet-c

Categories: ASP.NET #C Tags: , , , , ,