Created
October 8, 2014 14:39
-
-
Save peace098beat/22f612a62f953d456ab2 to your computer and use it in GitHub Desktop.
ファイルアップロードPHP | 動画、静止画に対応
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| <?php | |
| /********************************************************** | |
| / アップロードファイルの保存 | |
| /**********************************************************/ | |
| if( $data = $_FILES["photo"] ){ | |
| move_uploaded_file( $data["tmp_name"], "./img/".date(U).$data["name"] ); | |
| // move_uploaded_file( $data["tmp_name"], "./img/".$data["name"] ); | |
| // echo("<img src='"."./img/".date(U).$data["name"]."' alt=''>"); | |
| }else{ | |
| // echo "nono"; | |
| } | |
| header("HTTP/1.1 301 Moved Permanently"); | |
| header("Location: http://orange.house.fififactory.com/www/index.php"); | |
| ?> |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| <form class="form" role="form" action="post.php" enctype="multipart/form-data" method="post"> | |
| <div class="form-group"> | |
| <input class="button " type="file" name="photo" accept="image/*; capture=camera"> | |
| <input class="button sign-up" type="submit" value="UPLOAD"> | |
| </div> | |
| </form> | |
| <form action="post.php" enctype="multipart/form-data" method="post"> | |
| <input class="button " type="file" name="upfile" accept="image/*; capture=camera, video/*; capture=camera"> | |
| <input class="button sign-up" type="submit" value="UPLOAD"> | |
| </form> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment