본문 바로가기

개발

(326)
개발/php
Send Files via FTP Using PHP $connection = ftp_connect($server); $login = ftp_login($connection, $ftp_user_name, $ftp_user_pass); if (!$connection || !$login) { die('Connection attempt failed!'); } $upload = ftp_put($connection, $dest, $source, $mode); if (!$upload) { echo 'FTP upload failed!'; } ftp_close($connection); 2011.12.21
개발/php
Force A Secure Page Using PHP //force redirect to secure page if($_SERVER['SERVER_PORT'] != '443') { header('Location: https://'.$_SERVER['HTTP_HOST'].$_SERVER['REQUEST_URI']); exit(); } 2011.12.21
개발/php
Force Secure (SSL) Pages With .htaccess RewriteEngine On RewriteCond %{SERVER_PORT} 80 RewriteRule ^(.*)$ https://domain.com/$1 [R,L] 2011.12.21
개발/php
PHP Force Download // grab the requested file's name $file_name = $_GET['file']; // make sure it's a file before doing anything! if(is_file($file_name)) { /* Do any processing you'd like here: 1. Increment a counter 2. Do something with the DB 3. Check user permissions 4. Anything you want! */ // required for IE if(ini_get('zlib.output_compression')) { ini_set('zlib.output_compression', 'Off'); } // get the file m.. 2011.12.21
개발/php
PHP Headers and Popular Mime Types Atom header('Content-type: application/atom+xml'); CSS copyheader('Content-type: text/css'); Javascript header('Content-type: text/javascript'); JPEG Image header('Content-type: image/jpeg'); JSON header('Content-type: application/json'); PDF header('Content-type: application/pdf'); RSS header('Content-Type: application/rss+xml; charset=ISO-8859-1'); Text (Plain) header('Content-type: text/plain.. 2011.12.21
개발/서버
Crontab을 이용한 ftp 파일 자동 전송받기 data파일을 특정 디렉토리에 쌓이도록 하고 ftp셀을 이용한다 우선 클라이언트단에서 쉘 작성 =====ftp_file.sh==== #! /bin/ksh . /home1/kbsms/.profile today=`date +"%y%m%d"` { echo user 아이디 패스워드 echo prompt off echo hash echo bi echo mget * } | ftp -n -v ftp서버아이피 & ==================== 작 성된 쉘파일을 Crontab에 등록.. ======Crontab 간단한 설명====== crontab -l : 현재의 crontab 내용을 본다 crontab -e : crontab 편집모드 * * * * * command | | | | | | | | | +--> 요일.. 2011.12.21