자동등록방지 코드 > 기술자료 | 해피정닷컴

자동등록방지 코드 > 기술자료

본문 바로가기

사이트 내 전체검색

자동등록방지 코드 > 기술자료

PHP 자동등록방지 코드

페이지 정보


첨부파일

본문



write.html 코드중에서

<?php
$time = mktime();     // 시간 유닉스형식
$c_time = md5($time);    //암호화
$string = substr($c_time,14,5);  //글자크기를 5글자로 자름
$gd_image = "img/code_graph.gif"; // 출력할 이미지
$image = ImageCreate (150, 50); // 사이즈가 150x50인 이미지 생성
$color_black = ImageColorAllocate ($image, 0xFF, 0xFF, 0xFF); // 검정색을 설정
$color_white = ImageColorAllocate ($image, 0x00, 0x00, 0x00); // 흰색을 설정
ImageTTFtext ($image, 20, 10, 20, 40, $color_white, "./img/gulim.ttf", "$string"); // (100,150)에 navyism을 입력
//이미지가출력되는위치 이미지,위 아래 좌 우 , 바탕화면 , 폰트, 글자)
//ImageGif ($image); // 이미지 출력
imageJpeg($image, $gd_image, 100); // ($base 이미지를, 파일이름.jpg, 100% 품질로 저장)
echo "<img src=$gd_image>";
ImageDestroy ($image);  // 메모리에서 이미지 제거

///// 비교하기 /////
/*
// ( ltm_time을 히든값으로.. mktime(); )
$c_time = md5($ltm_time);
$string = substr($c_time,14,5);
if ($string != "$ltm_code"){ error_msg("입력하신 코드번호가 올바르지 않습니다."); }
*/
?>
※ <span class=8pt>자동글 방지를 위하여 <b>왼쪽에 보이시는 문구를 입력</b>하세요.</span><br>
<input type="text" name="ltm_code" class=input style="ime-mode:disabled">
<input type="hidden" name="ltm_time" value="<?=$time?>">


write_ok.php 에서
<?
$c_time = md5($ltm_time);
$string = substr($c_time,14,5);
 
 if ($string !== "$ltm_code"){
 echo " <script>alert('입력하신 코드번호가 올바르지 않습니다.');  document.location.href='form.htm'; </script>";
 exit;
 }
?>



[ 오류 1 ]
Warning: imagegif() [function.imagegif]: Unable to open 'img/code_graph.gif' for writing: Permission denied in /home/happyjung/www/write.html on line 50

또는

Warning: imagejpeg() [function.imagejpeg]: Unable to open 'img/code_graph.gif' for writing in /home/happyjung/www/write.html on line 50

원인 : code_graph.gif 파일의 퍼미션오류
해결 : chmod 766 code_graph.gif


[ 오류 2 ]
Warning: imagettftext() [function.imagettftext]: Could not find/open font in /home/happyjung/www/write.html on line 54

원인 : gullim.ttf 파일 경로 오류이거나, 파일을 찾을수 없을때
방법 : gullim.ttf 을 서버에 업로드

gullim.ttf 다운로드 :  http://offree.net/2808


참고사이트
http://offree.net/2808

댓글목록

등록된 댓글이 없습니다.


Total 196건 7 페이지
  • RSS
기술자료 목록
76
PHP   16335  2010-08-21 09:37 ~ 2014-10-06 00:00  
75
PHP   22213  2010-07-21 21:47 ~ 2024-03-22 08:47  
74
PHP   22273  2010-07-10 15:48 ~ 2021-01-03 22:59  
73
PHP   27819  2010-04-13 23:06  
72
PHP   26209  2010-03-24 18:51 ~ 2022-09-27 10:16  
71
PHP   19259  2010-03-21 12:30 ~ 2020-11-15 19:34  
70
PHP   19542  2010-03-18 22:00 ~ 2016-03-17 00:00  
69
PHP   20980  2010-03-16 22:11 ~ 2020-02-08 11:51  
68
PHP   26171  2010-03-08 19:42 ~ 2010-03-08 00:00  
67
PHP   38227  2009-10-23 02:37 ~ 2015-05-26 00:00  
열람
PHP   23536  2009-10-21 19:46 ~ 2009-10-21 00:00  
65
PHP   15913  2009-10-14 11:12  
64
PHP   17649  2009-10-10 10:00 ~ 2017-05-19 00:00  
63
PHP   23662  2009-09-09 22:42  
62
PHP   15255  2009-08-25 20:51  
61
PHP   15586  2009-08-25 20:50  
60
PHP   25319  2009-08-25 20:46 ~ 2020-04-08 11:35  
59
PHP   46028  2009-08-21 01:29 ~ 2017-08-03 00:00  
58
PHP   12979  2009-08-06 22:35  
57
PHP   16306  2009-07-22 18:49  

검색

해피정닷컴 정보

회사소개 회사연혁 협력사 오시는길 서비스 이용약관 개인정보 처리방침

회사명: 해피정닷컴   대표: 정창용   전화: 070-7600-3500   팩스: 042-670-8272
주소: (34368) 대전시 대덕구 대화로 160 대전산업용재유통단지 1동 222호
개인정보보호책임자: 정창용   사업자번호: 119-05-36414
통신판매업신고: 제2024-대전대덕-0405호 [사업자등록확인]  
Copyright 2001~2025 해피정닷컴. All Rights Reserved.