Notice
Recent Posts
Recent Comments
Link
일 | 월 | 화 | 수 | 목 | 금 | 토 |
---|---|---|---|---|---|---|
1 | ||||||
2 | 3 | 4 | 5 | 6 | 7 | 8 |
9 | 10 | 11 | 12 | 13 | 14 | 15 |
16 | 17 | 18 | 19 | 20 | 21 | 22 |
23 | 24 | 25 | 26 | 27 | 28 |
Tags
- JavaScript
- 전략
- variables
- Linux
- date
- php
- UTF-8
- OOP
- curl
- function
- 경영
- Ajax
- string
- Apache
- Regex
- file-upload
- Arrays
- 웹하드순위
- 웹하드추천
- jquery
- composer-php
- 무료다운로드쿠폰
- Laravel
- MySQL
- JSON
- HTML
- post
- Session
- Forms
Archives
- Today
- Total
개발! 딱 깔끔하고 센스있게!
Phongap 으로 아이 폰 에서 PHP 로 사진 올 리 기 본문
PHP 에서 일 하 는 (웹 에서 일 하 는) 양식 을 간단하게 올 리 고, Phongap (base64) 을 사용 하여 아이 폰 에서 사진 을 캡 처 하고 장치 에 표시 할 수 있 습 니 다.
제 서버 에 PHP 로 올 리 는 방법 을 모 르 겠 어 요.
다음은 PHP 에서 작 동 하 는 코드 입 니 다:
INDEX. PHP 인덱스
//print_r($_POST); if($_POST["action"] == "Upload Image") { unset($imagename); if(!isset($_FILES) && isset($HTTP_POST_FILES)) $_FILES = $HTTP_POST_FILES; if(!isset($_FILES['image_file'])) $error["image_file"] = "An image was not found."; $imagename = basename($_FILES['image_file']['name']); //echo $imagename; if(empty($imagename)) $error["imagename"] = "The name of the image was not found."; if(empty($error)) { $newimage = "images/" . $imagename; //echo $newimage; $result = @move_uploaded_file($_FILES['image_file']['tmp_name'], $newimage); if(empty($result)) $error["result"] = "There was an error moving the uploaded file."; } } include("upload_form.php"); if(is_array($error)) { while(list($key, $val) = each($error)) { echo $val; echo "
\n"; } } include("list_images.php"); ?>
이 두 개 는...
폼 올 리 기. PHP
LIST IMAGS PHP 목록
$handle = @opendir("images"); if(!empty($handle)) { while(false !== ($file = readdir($handle))) { if(is_file("images/" . $file)) echo '
'; } } closedir($handle); ?>
다음은 Phonegap 에서 아이 폰 4 (iOS. 4) 에서 실 행 된 코드 입 니 다.
INDEX. HTML (Phnegap 의 WW 디 렉 터 리 에서 실행)
Camera