Welcome Guest ( Log In | Register)



 
Reply to this topicStart new topic
> Themed Scripts (weekly), the theme changes each week
Tsunami
post Feb 13 2007, 11:07 PM
Post #1


Premium Member
********

Group: Members
Posts: 169
Joined: 2-August 06
From: North Carolina
Member No.: 27,662



ok the way this is gonna work is ... from monday to saturday you will be asking for scripts that go along with the theme... then on sunday every one will vote on a new theme for the next week... any one can ask for a script... any one can post a script...

the script DOESN'T NECESSARILY NEED TO BE ASKED FOR inorder for you to post it... just make sure it goes along with the theme... or you will loose all respect biggrin.gif

any ways this weeks theme is

SECURITY



So for the first script i thought i would show you how to make the randomly generated number images that you see on most registration pages....

i am not going to go into too much detail because this post would be a mile long if i did so here is the code:

CODE
<?php
  Header("(anti-spam-(anti-spam-content-type:)) image/gif");
  $fface = "fonts/TIMES.TTF";
  if(!$_GET['num'])
     $text = rand(100,999);
  else
     $text = $_GET['num'];
  if(!isset($s)) $s=25;
  $size = imagettfbbox($s,0,$fface,$text);
  $dx = abs($size[2]-$size[0]);
  $dy = abs($size[5]-$size[3]);
  $xpad=9;
  $ypad=9;



  $im = imagecreate($dx+$xpad,$dy+$ypad);
  $background = ImageColorAllocate($im, 0,0,0);

imagesetthickness($im,1);
$typeis = "circle";
for($i = 0; $i <= 10; $i++)
{
$mycol = ImageColorAllocate($im, rand(0,255),rand(0,255),rand(0,255));

if($typeis == "line")
ImageLine($im, rand(0,$dx+$xpad),rand(0,$dy+$ypad),rand(0,$dx+$xpad),rand(0,$dy+$ypad), $mycol);
else
ImageEllipse($im, rand(0,$dx+$xpad),rand(0,$dy+$ypad), 20,20, $mycol);
}

  $shadow = ImageColorAllocate($im, 100,100,100);
  $textcol = ImageColorAllocate($im, 150,150,150);
  ImageTTFText($im, $s, 0, (int)($xpad/2)+2, $dy+(int)($ypad/2), $shadow,$fface, $text);
  ImageTTFText($im, $s, 0, (int)($xpad/2), $dy+(int)($ypad/2)-2, $textcol,$fface, $text);
  ImageGif($im);
  ImageDestroy($im);
?>


Ok... some of the nice features of this script is that it allows you to pass in a number generated from the client page or you can just have one randomly generated... if you want to check for validity, i would pass it in... but here are previews of both:

here is a preview Tsunami's number generator
Go ahead.. reload the page... or try it on your own site...
To do a randomly generated number... just use this as an image tag: http://tsunamicentral.trap17.com/randnum.php3

to use your own... put a number in like so: http://tsunamicentral.trap17.com/randnum.php3?num=YOUR#HERE

right click and save as... ITS A PICTURE!!!
enjoy
Go to the top of the page
 
+Quote Post

Reply to this topicStart new topic

Collapse

> Similar Topics

Topics Topics
  1. Php, Some Easy Scripts(3)
  2. Php Programmers, How Long To Finish Your Scripts?(23)
  3. Php Scripts(2)
  4. Executing Scripts Without Include() Function(3)
  5. Uploading From Url(9)
  6. Need Scripts For Testing Server's Limitation(6)
  7. I Need Free Scripts(21)
  8. Good Scripts(10)
  9. Good Free Php Scripts(10)
  10. Php Scripts Free For Every One(12)
  11. Password Strength / User Availablity Scripts ?(2)
  12. Running Php Web Scripts On A Local Machine(6)
  13. How Do Scripts Select To Be Placed In Fantastico(2)
  14. Free Web Forum Scripts?(7)
  15. Releasing Wap/php Scripts?(3)
  1. Papular Wap Scripts 4 Your Sites(3)
  2. Phpbb Customization?(7)
  3. Wamp Packages Needed To Test Scripts(1)
  4. Scripts(5)
  5. Downloading Scripts(2)


 



- Lo-Fi Version Time is now: 13th October 2008 - 09:39 PM