RewriteEngine On
RewriteCond $1 !^(index\.php|images|captcha|data|include|uploads|robots\.txt)
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule ^(.*)$ /index.php/$1 [L]
출처 : http://www.jkun.net/300

 

'php, codeigniter' 카테고리의 다른 글

png 이미지 글자 쓰기  (0) 2015.01.11
utf-8 글자 자르기  (0) 2015.01.02
요일 구하기  (0) 2014.12.24
mysql 인젝션(injection) 방어  (0) 2014.12.10
코드이그나이터 : 여러개의 필드 like  (0) 2014.12.04
블로그 이미지

디츠

“말은 쉽지, 코드를 보여줘.” “Talk is cheap. Show me the code.” – 리누스 토르발스(Linus Torvalds)

,

요일 구하기

php, codeigniter 2014. 12. 24. 15:47
<?
$week = array("일요일","월요일","화요일","수요일","목요일","금요일","토요일");
$date = date("Y-m-d");
echo $week[date('w',strtotime($date))];
?>
블로그 이미지

디츠

“말은 쉽지, 코드를 보여줘.” “Talk is cheap. Show me the code.” – 리누스 토르발스(Linus Torvalds)

,
<?php
// Quote variable to make safe
function quote_smart($value)
{
	// Stripslashes
	if (get_magic_quotes_gpc()) {
		$value = stripslashes($value);
	}
	// Quote if not integer
	if (!is_numeric($value)) {
		$value = "'" . mysql_real_escape_string($value) . "'";
	}
	return $value;
}

// Connect
$link = mysql_connect('mysql_host', 'mysql_user', 'mysql_password')
	OR die(mysql_error());

// Make a safe query
$query = sprintf("SELECT * FROM users WHERE user=%s AND password=%s",
	quote_smart($_POST['username']),
	quote_smart($_POST['password']));

mysql_query($query);
?>
출처 : http://hoooow.tistory.com/m/post/151
블로그 이미지

디츠

“말은 쉽지, 코드를 보여줘.” “Talk is cheap. Show me the code.” – 리누스 토르발스(Linus Torvalds)

,
WHERE CONCAT_WS(f_bill_title,f_bill_no,f_bill_daesu) like '%7%'
WHERE regexp_like(name,'AA|BB|DD')

'php, codeigniter' 카테고리의 다른 글

요일 구하기  (0) 2014.12.24
mysql 인젝션(injection) 방어  (0) 2014.12.10
파일 다운로드 취약점 방어  (0) 2014.11.20
이미지 생성하기  (0) 2014.11.19
모바일 파일 다운로드 헤더  (0) 2014.11.06
블로그 이미지

디츠

“말은 쉽지, 코드를 보여줘.” “Talk is cheap. Show me the code.” – 리누스 토르발스(Linus Torvalds)

,
if(eregi("\.\.|/", $filename )) {
	echo "상대경로로 접근할 수 없습니다.";
	exit;
}

 

출처 : http://m.blog.daum.net/_blog/_m/articleView.do?blogid=0YdvX&articleno=146#

'php, codeigniter' 카테고리의 다른 글

mysql 인젝션(injection) 방어  (0) 2014.12.10
코드이그나이터 : 여러개의 필드 like  (0) 2014.12.04
이미지 생성하기  (0) 2014.11.19
모바일 파일 다운로드 헤더  (0) 2014.11.06
게시판 첨부파일 추가  (0) 2014.11.05
블로그 이미지

디츠

“말은 쉽지, 코드를 보여줘.” “Talk is cheap. Show me the code.” – 리누스 토르발스(Linus Torvalds)

,
<?php
// File and new size
$filename = 'source.jpg';
$percent = 0.5;

// Content type
// header('Content-Type: image/jpeg');

// Get new sizes
list($width, $height) = getimagesize($filename);
$newwidth = $width * $percent;
$newheight = $height * $percent;

// Load
$thumb = imagecreatetruecolor($newwidth, $newheight);
$source = imagecreatefromjpeg($filename);

// Resize
imagecopyresized($thumb, $source, 0, 0, 0, 0, $newwidth, $newheight, $width, $height);

// Output
imagejpeg($thumb, "target.jpg", 100);
?>
블로그 이미지

디츠

“말은 쉽지, 코드를 보여줘.” “Talk is cheap. Show me the code.” – 리누스 토르발스(Linus Torvalds)

,