Jump to content

Janice

Members
  • Posts

    20
  • Joined

  • Last visited

Janice's Achievements

Newbie

Newbie (1/7)

0

Reputation

  1. Janice

    stats

    i have created a page like this.. i dont use any database for this..actually it is a form page followed by a stats box. when someone enter the form, it should add 1 extra number of members in stats and when someone enter total work(1000), it should be added in the stats aswell.
  2. I have another doubt..Email ID:</b><input type="text" name="email" size="20" />this will give output with a box for email id to be entered..how to make it show without a box?
  3. thanks alot justsomeguy .. you are always informative..it worked fine when I set 777 permissions to "images" folder but I know it is not safe!I will try your codings and let you know
  4. I hope I would get a good reply from someone who really knows what the issue is
  5. functions.php <?phpfunction standardheader($title) {?><!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/xtml" xml:lang="en" lang="en"><head> <meta http-equiv="content-type" content="text/html; charset=iso-8859-1" /> <title><?php echo $title; ?></title></head><body><?php}function stdfoot() {?></body><html><?php} class ocr_captcha { var $key; // ultra private static text var $long; // size of text var $lx; // width of picture var $ly; // height of picture var $nb_noise; // nb of background noisy characters var $filename; // file of captcha picture stored on disk var $imagetype="png"; // can also be "png"; var $public_key; // public key var $font_file="./include/adlibn.ttf"; function ocr_captcha($long=6,$lx=120,$ly=30,$nb_noise=25) { $this->key=md5("A nicely little text to stay private and use for generate private key"); $this->long=$long; $this->lx=$lx; $this->ly=$ly; $this->nb_noise=$nb_noise; $this->public_key=substr(md5(uniqid(rand(),true)),0,$this->long); // generate public key with entropy } function get_filename($public="") { if ($public=="") $public=$this->public_key; return "images/".$public.".".$this->imagetype; } // generate the private text coming from the public text, using $this->key (not to be public!!), all you have to do is here to change the algorithm function generate_private($public="") { if ($public=="") $public=$this->public_key; return substr(md5($this->key.$public),16-$this->long/2,$this->long); } // check if the public text is link to the private text function check_captcha($public,$private) { // when check, destroy picture on disk if (file_exists($this->get_filename($public))) unlink($this->get_filename($public)); return (strtolower($private)==strtolower($this->generate_private($public))); } // display a captcha picture with private text and return the public text function make_captcha($noise=true) { $private_key = $this->generate_private(); $image = imagecreatetruecolor($this->lx,$this->ly); $back=ImageColorAllocate($image,intval(rand(224,255)),intval(rand(224,255)),intval(rand(224,255))); ImageFilledRectangle($image,0,0,$this->lx,$this->ly,$back); if ($noise) { // rand characters in background with random position, angle, color for ($i=0;$i<$this->nb_noise;$i++) { $size=intval(rand(6,14)); $angle=intval(rand(0,360)); $x=intval(rand(10,$this->lx-10)); $y=intval(rand(0,$this->ly-5)); $color=imagecolorallocate($image,intval(rand(160,224)),intval(rand(160,224)),intval(rand(160,224))); $text=chr(intval(rand(45,250))); ImageTTFText ($image,$size,$angle,$x,$y,$color,$this->font_file,$text); } } else { // random grid color for ($i=0;$i<$this->lx;$i+=10) { $color=imagecolorallocate($image,intval(rand(160,224)),intval(rand(160,224)),intval(rand(160,224))); imageline($image,$i,0,$i,$this->ly,$color); } for ($i=0;$i<$this->ly;$i+=10) { $color=imagecolorallocate($image,intval(rand(160,224)),intval(rand(160,224)),intval(rand(160,224))); imageline($image,0,$i,$this->lx,$i,$color); } } // private text to read for ($i=0,$x=5; $i<$this->long;$i++) { $r=intval(rand(0,128)); $g=intval(rand(0,128)); $b=intval(rand(0,128)); $color = ImageColorAllocate($image, $r,$g,$; $shadow= ImageColorAllocate($image, $r+128, $g+128, $b+128); $size=intval(rand(12,17)); $angle=intval(rand(-30,30)); $text=strtoupper(substr($private_key,$i,1)); ImageTTFText($image,$size,$angle,$x+2,26,$shadow,$this->font_file,$text); ImageTTFText($image,$size,$angle,$x,24,$color,$this->font_file,$text); $x+=$size+2; } if ($this->imagetype=="jpg") imagejpeg($image, $this->get_filename(), 100); else imagepng($image, $this->get_filename()); ImageDestroy($image); } function display_captcha($noise=true) { $this->make_captcha($noise); $res="<input type=hidden name='public_key' value='".$this->public_key."'>\n"; $res.="<img align=middle src='".$this->get_filename()."' border='0'>\n"; return $res; } }?>
  6. I have a php verification / landing verification / image verification page. It worked fine before,Now i get this error after uploading and I dont see the image.Warning: imagepng() [function.imagepng]: Unable to open 'images/b804e0.png' for writing in /home/megax/public_html/include/functions.php on line 114What would be wrong?
  7. Janice

    php validation page

    thanks alot.. i will try this
  8. Janice

    php validation page

    Since I am a newbie, I dont understand this
  9. Janice

    php validation page

    hi all,i would like to know how to create a validation first page. something like the one in http://football2gold.comUser must enter a validation code (any number or alphabets) to enter the site.Since I am new to php, I would like to get a detailed answer with codings.Hope someone could help me, as this forum is the best place for learners
  10. How to add visual confirmation page? Something like, when someone goes to www.example.com, they will see any random numbers like turing numbers to enter to index page.
  11. Hello everyone, Hope you all fine here. I am in need of a help. Anyone know how to add a DDOS protection first page for a website? Something like typing a code to enter the website?I would be glad to get a detailed explanation for this with codings.Thanks alot. I always get excellent help here.Long Live w3 forum members
  12. Janice

    Help

    It works just fine..Thank yall
  13. Janice

    Help

    This aint work. I would like to get some more explanation. Please
  14. Janice

    Help

    Is it real hard?
  15. Janice

    Help

    Hi,Thanks alot for your help! It should go to the inputted username (inputted username.php)
×
×
  • Create New...