Advertisement
Guest User

Untitled

a guest
Dec 15th, 2011
107
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 3.61 KB | None | 0 0
  1. <?php
  2. $multiplikator = rand(100, 1000);
  3.  
  4.  
  5. function styler() {
  6. ?><style> body {color:white;text-shadow:0 1px 0 rgba(0, 0, 0, 0.5);font-family:arial;font-size:12px !important;}
  7. input {background:none repeat scroll 0 0 rgba(0, 0, 0, 0.25);border:0;color:white;text-shadow:0 1px 0 rgba(0, 0, 0, 0.5);}
  8. td {color:white;font-size:11px}
  9. .two {box-shadow: 0 0 4px 0 rgba(255, 255, 255, 0.4);border:0;background:none repeat scroll 0 0 rgba(0, 0, 0, 0.25);color:rgba(255,255,255,0.88);font-family:arial;text-shadow:0 1px 0 rgba(0, 0, 0, 0.5);}
  10. img {background:rgba(0,0,0,0.7);position:relative;top:4px;left:2px;}
  11. </style><?php
  12. }
  13.  
  14. if(isset($_GET["img"])) {} else { if(isset($_GET["write"])) {} else { styler();
  15. ?><form name="input" action="?write=1&code=<?php echo $multiplikator; ?>" method="post">
  16. <table><tr><td>
  17. Titel :</td><td> <input style="width:570px;" type="text" name="title"></td></tr><tr><td>
  18. <br>Beschreibung : </td><td><TEXTAREA type="text" class="two" style="height:200px;width:570px;" name="desc"></TEXTAREA></td></tr><tr><td>
  19. <br>Embedcode/Filehoster : </td><td><TEXTAREA class="two" type="text" style="height:200px;width:570px;" name="hoster"></TEXTAREA></td></tr><tr><td>
  20. <br>Bild url : </td><td><input style="width:570px;" type="text" name="image"></td></tr><tr><td>
  21. <br>captcha Code: </td><td><input type="text" name="captcha"><?php echo "<img src=?img=$multiplikator>"; ?></td></tr><tr><td>
  22. <br>Optional Uploader Name: </td><td><input type="text" name="namer"></td></tr><tr><td>
  23. <br><input type="submit" value="Eintragen" /></td></tr>
  24. </tr></table></form>
  25. <?php
  26. }}
  27. if(isset($_GET["write"]) and isset($_GET["code"])) {
  28. styler();
  29. if(strlen($_POST["image"]) > 0 and strlen($_POST["captcha"]) > 0 and strlen($_POST["hoster"]) > 0 and strlen($_POST["desc"]) > 0 and strlen($_POST["title"]) > 0) {
  30. $captcha_input = $_POST["captcha"];
  31. if (is_numeric($captcha_input)) { //CHECK CAPTCHA
  32. $code = "1"; $multiplikator =$_GET["code"];
  33. $code .= $multiplikator * substr(ereg_replace("\.", "", $_SERVER['REMOTE_ADDR']),1,2);
  34. if ($code == $captcha_input) { //CAPTCHA RICHTIG -->eintragen
  35.  
  36. $timestamp = time();$datum = date("d_m_Y",$timestamp);$uhrzeit = date("H_i_s",$timestamp);
  37. $datei = fopen("$datum.$uhrzeit.txt","a+");
  38.  
  39. rewind($datei);
  40. fwrite($datei, $_POST["title"]."\n\n\n------------".$_POST["desc"]."\n\n------------".$_POST["hoster"]."\n\n------------".$_POST["image"]."\n\n------------".$_POST["namer"]);
  41. fclose($datei);
  42. echo "Danke für deinen Eintrag! Er wird in kürze überprüft..";
  43. } else {echo "falsche Captcha eingabe!";}
  44.  
  45.  
  46. } else {echo "falsche Captcha eingabe!";}
  47.  
  48. }
  49. else {
  50. echo "Unvollständig!";
  51. }
  52. }
  53.  
  54. ?><?php
  55. if(isset($_GET["img"])) {
  56.  
  57. class CaptchaSecurityImages {
  58.  
  59. var $font = 'monofont.ttf';
  60.  
  61. function CaptchaSecurityImages($width='120',$height='30',$characters='6') {$zufallszahl = rand(1000, 100000);
  62. $code = "1"; $multiplikator =$_GET["img"];
  63. $code .= $multiplikator * substr(ereg_replace("\.", "", $_SERVER['REMOTE_ADDR']),1,2);//$this->generateCode($characters);
  64.  
  65. $imgA = imagecreate(90, 18);
  66. // $colorA['lime'] = imagecolorallocate($imgA, 0x00, 0xFF, 0x00);
  67. $colorA['red'] = imagecolorallocate($imgA, 0x00, 0x00, 0x00);
  68. $colorA =ImageColorAllocate($imgA, 75, 75, 75);
  69. $ttfA = "monofont.ttf";
  70. $ttfsizeA = 20;
  71. $angleA =rand(0,5);
  72. $t_xA = 0;rand(5,30);
  73. $t_yA = 20;
  74. imagettftext($imgA, $ttfsizeA, $angleA, $t_xA, $t_yA, $colorA, $ttfA, $code);
  75. imagecolortransparent($imgA, $colorA['red']);
  76. header("Content-type: image/png");
  77. imagepng($imgA);
  78. // imagedestory($imgA);
  79.  
  80. }
  81. }
  82. $captcha = new CaptchaSecurityImages(2 * 20, 32, 3);
  83. }
  84. ?>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement