<?
if(!isset($_GET['send'])) {
?>
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<title> Fileupload </title>
</head>
if(!isset($_GET['send'])) {
?>
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<title> Fileupload </title>
</head>
<body>
<form action="./upload.php?send" method="post" enctype="multipart/form-data">
<input type="file" name="upload"></input>
<input type="submit"></input>
</body>
</html>
<?
} else {
$path = "/home/계정/public_html/upload/files/";
if($_FILES["upload"]["error"] > 0){
echo "파일전송실패";
} else {
$tmp_name = $_FILES["upload"]["tmp_name"][$key];
$name = $_FILES["upload"]["name"][$key];
if (is_uploaded_file($_FILES['upload']['tmp_name'])) {
echo "파일전송 성공<br/>";
$ext = substr(strrchr($_FILES["upload"]["name"],"."),1) ;
move_uploaded_file($_FILES["upload"]["tmp_name"], $path.$date("ymdHis").strtolower($ext));
//파일명 그대로 : move_uploaded_file($_FILES["upload"]["tmp_name"], $path.$_FILES["upload"]["name"]);
echo "업로드 된 파일 : ".$path.$date("ymdHis").strtolower($ext);
}
}
}
?>
<form action="./upload.php?send" method="post" enctype="multipart/form-data">
<input type="file" name="upload"></input>
<input type="submit"></input>
</body>
</html>
<?
} else {
$path = "/home/계정/public_html/upload/files/";
if($_FILES["upload"]["error"] > 0){
echo "파일전송실패";
} else {
$tmp_name = $_FILES["upload"]["tmp_name"][$key];
$name = $_FILES["upload"]["name"][$key];
if (is_uploaded_file($_FILES['upload']['tmp_name'])) {
echo "파일전송 성공<br/>";
$ext = substr(strrchr($_FILES["upload"]["name"],"."),1) ;
move_uploaded_file($_FILES["upload"]["tmp_name"], $path.$date("ymdHis").strtolower($ext));
//파일명 그대로 : move_uploaded_file($_FILES["upload"]["tmp_name"], $path.$_FILES["upload"]["name"]);
echo "업로드 된 파일 : ".$path.$date("ymdHis").strtolower($ext);
}
}
}
?>
인데
Fatal error: Function name must be a string in /home/계정/public_html/upload/upload.php on line 27
이 에러가 뜨네요 ㅜㅜ
뭐가 문제인거죠?
펑션을 지정하지 않은건가?
아 그리고 업로드 누르면 모든파일(*) 이런거 있던데 꼭 이미지만 업로드하게하려면 어케하죠??
27번째 줄은
27 |
move_uploaded_file($_FILES["upload"]["tmp_name"], $path.$date("ymdHis").strtolower($ext)); |
move_uploaded_file($_FILES["upload"]["tmp_name"], $path.$date("ymdHis").strtolower($ext));
예요
댓글 3개
13년 전
$date("ymdHis")
이게 무엇이지요 ?
이게 무엇이지요 ?
13년 전
머딱바두 날자 지정하느거구만,
13년 전
move_uploaded_file($_FILES["upload"]["tmp_name"], $path.$date("ymdHis").strtolower($ext));
echo $path; 이런식으로찍어보세요
echo $path; 이런식으로찍어보세요
게시판 목록
프로그램
| 번호 | 제목 | 글쓴이 | 날짜 | 조회 |
|---|---|---|---|---|
| 6930 |
SOFTA
|
11년 전 | 5986 | |
| 6929 |
|
11년 전 | 1604 | |
| 6928 | 11년 전 | 1762 | ||
| 6927 | 11년 전 | 1788 | ||
| 6926 | 11년 전 | 1887 | ||
| 6925 | 11년 전 | 2279 | ||
| 6924 | 11년 전 | 3878 | ||
| 6923 | 11년 전 | 2280 | ||
| 6922 |
level999
|
11년 전 | 1045 | |
| 6921 | 11년 전 | 822 | ||
| 6920 | 11년 전 | 963 | ||
| 6919 | 11년 전 | 1074 | ||
| 6918 | 11년 전 | 1317 | ||
| 6917 | 11년 전 | 15430 | ||
| 6916 | 11년 전 | 1430 | ||
| 6915 | 11년 전 | 590 | ||
| 6914 | 11년 전 | 623 | ||
| 6913 | 11년 전 | 882 | ||
| 6912 | 11년 전 | 3134 | ||
| 6911 |
사랑해요79
|
11년 전 | 973 | |
| 6910 | 11년 전 | 751 | ||
| 6909 | 11년 전 | 786 | ||
| 6908 | 11년 전 | 648 | ||
| 6907 | 11년 전 | 836 | ||
| 6906 | 11년 전 | 1592 | ||
| 6905 | 11년 전 | 576 | ||
| 6904 | 11년 전 | 1015 | ||
| 6903 | 11년 전 | 1685 | ||
| 6902 |
2donggalbi
|
11년 전 | 525 | |
| 6901 | 11년 전 | 1402 | ||
| 6900 | 11년 전 | 725 | ||
| 6899 | 11년 전 | 867 | ||
| 6898 |
열라뽕똬이
|
11년 전 | 1320 | |
| 6897 |
this1mg
|
11년 전 | 1619 | |
| 6896 |
sbdossb
|
11년 전 | 587 | |
| 6895 |
봉보로봉봉
|
11년 전 | 1163 | |
| 6894 |
똘똘이스머츠
|
11년 전 | 502 | |
| 6893 |
네이비컬러
|
11년 전 | 3648 | |
| 6892 | 11년 전 | 1082 | ||
| 6891 |
네이비컬러
|
11년 전 | 1328 | |
| 6890 | 11년 전 | 1154 | ||
| 6889 | 11년 전 | 596 | ||
| 6888 | 11년 전 | 731 | ||
| 6887 | 11년 전 | 624 | ||
| 6886 | 11년 전 | 5063 | ||
| 6885 | 11년 전 | 562 | ||
| 6884 |
asfasdfd235
|
11년 전 | 593 | |
| 6883 | 11년 전 | 3058 | ||
| 6882 | 11년 전 | 953 | ||
| 6881 | 11년 전 | 4446 | ||
| 6880 | 11년 전 | 1827 | ||
| 6879 |
퍼블리셔지노군
|
11년 전 | 2639 | |
| 6878 | 11년 전 | 573 | ||
| 6877 | 11년 전 | 589 | ||
| 6876 | 11년 전 | 1453 | ||
| 6875 | 11년 전 | 637 | ||
| 6874 | 11년 전 | 1610 | ||
| 6873 | 11년 전 | 1610 | ||
| 6872 | 11년 전 | 4467 | ||
| 6871 |
Abilityarch
|
11년 전 | 974 | |
| 6870 | 11년 전 | 2136 | ||
| 6869 | 11년 전 | 1416 | ||
| 6868 | 11년 전 | 1463 | ||
| 6867 | 11년 전 | 1532 | ||
| 6866 | 11년 전 | 751 | ||
| 6865 | 11년 전 | 1625 | ||
| 6864 | 11년 전 | 484 | ||
| 6863 | 11년 전 | 3758 | ||
| 6862 | 11년 전 | 1856 | ||
| 6861 | 11년 전 | 1654 | ||
| 6860 | 11년 전 | 1313 | ||
| 6859 |
cityman
|
11년 전 | 6819 | |
| 6858 | 11년 전 | 1277 | ||
| 6857 |
의정부아줌마
|
11년 전 | 876 | |
| 6856 | 11년 전 | 2379 | ||
| 6855 | 11년 전 | 1711 | ||
| 6854 | 11년 전 | 837 | ||
| 6853 | 11년 전 | 1214 | ||
| 6852 | 11년 전 | 2604 | ||
| 6851 | 11년 전 | 1981 | ||
| 6850 | 11년 전 | 1804 | ||
| 6849 | 11년 전 | 2095 | ||
| 6848 | 11년 전 | 2373 | ||
| 6847 | 11년 전 | 3151 | ||
| 6846 | 11년 전 | 2728 | ||
| 6845 | 11년 전 | 2809 | ||
| 6844 | 11년 전 | 3534 | ||
| 6843 | 11년 전 | 3279 | ||
| 6842 |
아트291
|
11년 전 | 699 | |
| 6841 | 11년 전 | 4175 | ||
| 6840 | 11년 전 | 5192 | ||
| 6839 | 11년 전 | 903 | ||
| 6838 |
|
11년 전 | 2102 | |
| 6837 | 11년 전 | 1287 | ||
| 6836 |
netdf
|
11년 전 | 621 | |
| 6835 |
|
11년 전 | 1015 | |
| 6834 | 11년 전 | 684 | ||
| 6833 |
|
11년 전 | 2693 | |
| 6832 |
울산굿모닝
|
11년 전 | 1674 | |
| 6831 |
|
11년 전 | 677 |
댓글 작성
댓글을 작성하시려면 로그인이 필요합니다.
로그인하기