<?php if ( ! defined('BASEPATH')) exit('No direct script access allowed');

if ( ! function_exists('kdate')) {
	function kdate($stamp) {
		return date('o년 n월 j일, G시 i분 s초', $stamp);
	}
}
출처 : http://opentutorials.org/course/697/3836

 

 

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

get_magic_quotes_gpc()  (0) 2014.10.14
form validation(폼 유효성 검사)  (0) 2014.10.13
$_POST 값이 안넘어올때  (0) 2014.10.13
지정된 날짜에만 팝업창 열기  (0) 2014.10.12
각 변수명으로 변경하기 - extract  (0) 2014.10.09
블로그 이미지

디츠

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

,

* php.ini

postmaxsize 확인
블로그 이미지

디츠

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

,
<?
$nowDay = date("Y-m-d",time());
$startDay = "2014-10-01";
$endDay = "2014-10-31";

if($startDay <= $nowDay && $endDay >= $nowDay) { ?>

<script type="text/javascript">
	window.open('open.html', '_blank', 'width=100, height=100, left=0, top=0, scrollbars=no, status=no');
</script> 
<? } ?>

 

블로그 이미지

디츠

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

,
  if($_GET) {
	foreach ($_GET as $key => $value) {
		$data[$key] = $this->input->get($key);
	}
}

if($_POST) {
	foreach ($_POST as $key => $value) {
		$data[$key] = $this->input->post($key);
	}
}

if($_COOKIE) {
	foreach ($_COOKIE as $key => $value) {
		$data[$key] = $this->input->cookie($key);
	}
}

if($_SERVER) {
	foreach ($_SERVER as $key => $value) {
		$data[$key] = $this->input->server($key);
	}
}

블로그 이미지

디츠

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

,
http://cikorea.net/user_guide_2.1.0/
블로그 이미지

디츠

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

,

* 방법1

$this->load->helper('email'); 
if (valid_email('email@somesite.com')) {
	echo 'email is valid';
} else {
	echo 'email is not valid';
}

* 방법2

- 컨트롤러

$this->load->library('form_validation');
$this->form_validation->set_rules('email',이메일 주소','required|valid_email|is_unique[user.email]');
if($this->form_validation->run() == TRUE) {
	// 성공
} else {
	// 실패
}

- 뷰

echo validation_errors();
// 입력된 내용이 그대로 입력되어 있게 하려면 value="<?=set_value('email')"

 

블로그 이미지

디츠

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

,