عرض مشاركة واحدة
عضو سوبر نشيط
تاريخ التسجيل: Apr 2006-
#12 (permalink)  

درس جميل ومفيد

يمكن وضع تشويش تحت اﻷرقام والحروف

الكود
كود PHP:

<?php
$img
=imagecreatetruecolor(120,40);
$bg=imagecolorallocate($img,250,50,80);
$color=imagecolorallocate($img,154,251,23);
$color2=imagecolorallocate($img,250,20,0);
$char=array("a","b","c","d","e","f","g","h","i","j","k","l","m","n","o","p","q","s","t","u","v","w","x","y","z"
,"A","B","C","D","E","F","G","H","I","J","K","L","M","N","O","P","Q","S","R","T","U","V","X","Y","Z",1,2,3,4,5,6,7,8,9,0);
for(
$i=0;$i<6;$i++)
  {
$txt=$char[rand(0,count($char)-1)];
$txt2.=$char[rand(0,count($char)-1)];
imagestring($img,20,rand(5,80),rand(5,20),$txt,$color);
}
imagestring($img,20,40,15,$txt2,$color2);
header("(anti-spam-content-type:) image/png");
imagepng($img);

?>
طبعا المتغير هو $txt2
يمكن حفظه في جلسة ﻻستخدامه التحقق كما في الدرس ...






عبد الواحد البشيري غير متواجد حالياً   قديم 17-04-2008, 01:59 AM
رد مع اقتباس