PDA

View Full Version : مشکل در captcha



m.a.najimi
یک شنبه 07 اردیبهشت 1393, 09:48 صبح
سلام به همگی.....
راستش من خودم .NET کار می کنم و از php چیز زیادی نمی دونم پس اگه سوالم تو بخش اشتباهی هست به بزرگی خودنون ببخشین.
من یه سایت دارم که فغلا اولویتم اینه رو لوکال جواب بده.وقتی سایت رو سرور publish می کنم و از یه کامپیوتر دیگه بهش دسترسی پیدا می کنم همه چی اوکیه،ولی وقتی همون سایت رو دقیقا با همون config روی local نصب می کنم همه چی درست کار میکنه به جر بخش مربوط به نمایش captcha..................نشونش نمی ده.gd libarray رو هم تست کردم درست باشه درست بود(extension کتابخونه uncomment بود)....به سرور دسترسی ندارم.....
کسی چیزی به ذهنش می رسه؟؟؟؟؟؟؟؟؟؟؟؟
با تشششکر

thinkdiff
یک شنبه 07 اردیبهشت 1393, 09:58 صبح
این کد های صفحه نمایش کپچا :

<?php session_start();
$ran1 = rand(1,51);
$ran2 = rand(1,51);
$word1 = "abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWX YZ";
$word2 = "abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWX YZ";
$rand =rand(11111,99999);
$_SESSION['capcha'] = $word1+$rand+$word2;
?>


<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>Untitled Document</title>
</head>
<img src="capcha.php" />
<form action="" method="post">
<input type="text" name="text" />
<input type="submit" name="sub" />
</form>
<body>
</body>
</html>

این هم کد های صفحه تولین کننده کپچا :

<?php session_start();
header('Content-text:image/png');
if(isset($_SESSION['capcha'])){
$code = $_SESSION['capcha'];
$width = 150;
$height = 50;
$image=imagecreate($width,$height);
imagecolorallocate($image,250,250,250);
$color = imagecolorallocate($image,0,0,0);
$size = 20;
$font = 'font.ttf';
$angle = 7;
imagettftext($image,$size,$angle,30,40,$color,$fon t,$code);
imagepng($image);
}
?>

m.a.najimi
یک شنبه 07 اردیبهشت 1393, 13:34 عصر
مرسی...ولی گفتک که من از php زیاد سر در نمیارم میخام ببینم کسی هست این مشکل واسش به وجود اومده باشه؟اصلا طبیعی هست همچین چیزی؟