<?
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; 이런식으로찍어보세요
게시판 목록
프로그램
| 번호 | 제목 | 글쓴이 | 날짜 | 조회 |
|---|---|---|---|---|
| 8030 | 9년 전 | 425 | ||
| 8029 | 9년 전 | 349 | ||
| 8028 | 9년 전 | 302 | ||
| 8027 | 9년 전 | 318 | ||
| 8026 | 9년 전 | 392 | ||
| 8025 | 9년 전 | 415 | ||
| 8024 | 9년 전 | 403 | ||
| 8023 | 9년 전 | 427 | ||
| 8022 | 9년 전 | 345 | ||
| 8021 | 9년 전 | 372 | ||
| 8020 | 9년 전 | 374 | ||
| 8019 | 9년 전 | 388 | ||
| 8018 | 9년 전 | 486 | ||
| 8017 | 9년 전 | 570 | ||
| 8016 | 9년 전 | 391 | ||
| 8015 | 9년 전 | 429 | ||
| 8014 | 9년 전 | 358 | ||
| 8013 | 9년 전 | 277 | ||
| 8012 | 9년 전 | 279 | ||
| 8011 | 9년 전 | 482 | ||
| 8010 | 9년 전 | 336 | ||
| 8009 | 9년 전 | 352 | ||
| 8008 | 9년 전 | 324 | ||
| 8007 | 9년 전 | 471 | ||
| 8006 | 9년 전 | 507 | ||
| 8005 |
|
9년 전 | 1002 | |
| 8004 | 9년 전 | 391 | ||
| 8003 | 9년 전 | 462 | ||
| 8002 | 9년 전 | 362 | ||
| 8001 |
|
9년 전 | 702 | |
| 8000 | 9년 전 | 462 | ||
| 7999 | 9년 전 | 414 | ||
| 7998 | 9년 전 | 468 | ||
| 7997 | 9년 전 | 343 | ||
| 7996 | 9년 전 | 570 | ||
| 7995 | 9년 전 | 528 | ||
| 7994 | 9년 전 | 407 | ||
| 7993 | 9년 전 | 478 | ||
| 7992 | 9년 전 | 558 | ||
| 7991 | 9년 전 | 305 | ||
| 7990 | 9년 전 | 332 | ||
| 7989 | 9년 전 | 336 | ||
| 7988 | 9년 전 | 764 | ||
| 7987 | 9년 전 | 467 | ||
| 7986 | 9년 전 | 472 | ||
| 7985 | 9년 전 | 551 | ||
| 7984 | 9년 전 | 467 | ||
| 7983 | 9년 전 | 704 | ||
| 7982 | 9년 전 | 563 | ||
| 7981 | 9년 전 | 521 | ||
| 7980 | 9년 전 | 542 | ||
| 7979 | 9년 전 | 537 | ||
| 7978 | 9년 전 | 496 | ||
| 7977 | 9년 전 | 442 | ||
| 7976 | 9년 전 | 895 | ||
| 7975 | 9년 전 | 409 | ||
| 7974 | 9년 전 | 458 | ||
| 7973 | 9년 전 | 644 | ||
| 7972 | 9년 전 | 428 | ||
| 7971 | 9년 전 | 505 | ||
| 7970 | 9년 전 | 345 | ||
| 7969 | 9년 전 | 589 | ||
| 7968 | 9년 전 | 435 | ||
| 7967 | 9년 전 | 416 | ||
| 7966 | 9년 전 | 424 | ||
| 7965 |
|
9년 전 | 1053 | |
| 7964 | 9년 전 | 440 | ||
| 7963 | 9년 전 | 449 | ||
| 7962 | 9년 전 | 449 | ||
| 7961 |
전갈자리남자
|
9년 전 | 543 | |
| 7960 | 9년 전 | 1012 | ||
| 7959 | 9년 전 | 591 | ||
| 7958 | 9년 전 | 441 | ||
| 7957 | 9년 전 | 395 | ||
| 7956 | 9년 전 | 405 | ||
| 7955 | 9년 전 | 500 | ||
| 7954 | 9년 전 | 437 | ||
| 7953 | 9년 전 | 488 | ||
| 7952 | 9년 전 | 410 | ||
| 7951 | 9년 전 | 536 | ||
| 7950 | 9년 전 | 441 | ||
| 7949 | 9년 전 | 429 | ||
| 7948 | 9년 전 | 363 | ||
| 7947 | 9년 전 | 984 | ||
| 7946 | 9년 전 | 498 | ||
| 7945 | 9년 전 | 438 | ||
| 7944 | 9년 전 | 499 | ||
| 7943 | 9년 전 | 432 | ||
| 7942 | 9년 전 | 444 | ||
| 7941 | 9년 전 | 435 | ||
| 7940 | 9년 전 | 941 | ||
| 7939 | 9년 전 | 425 | ||
| 7938 | 9년 전 | 444 | ||
| 7937 | 9년 전 | 332 | ||
| 7936 | 9년 전 | 921 | ||
| 7935 | 9년 전 | 530 | ||
| 7934 | 9년 전 | 510 | ||
| 7933 | 9년 전 | 629 | ||
| 7932 | 9년 전 | 578 | ||
| 7931 | 9년 전 | 630 |
댓글 작성
댓글을 작성하시려면 로그인이 필요합니다.
로그인하기