<?
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; 이런식으로찍어보세요
게시판 목록
프로그램
| 번호 | 제목 | 글쓴이 | 날짜 | 조회 |
|---|---|---|---|---|
| 7930 | 9년 전 | 485 | ||
| 7929 | 9년 전 | 419 | ||
| 7928 | 9년 전 | 493 | ||
| 7927 | 9년 전 | 402 | ||
| 7926 | 9년 전 | 711 | ||
| 7925 | 9년 전 | 435 | ||
| 7924 | 9년 전 | 417 | ||
| 7923 | 9년 전 | 409 | ||
| 7922 | 9년 전 | 430 | ||
| 7921 | 9년 전 | 447 | ||
| 7920 | 9년 전 | 356 | ||
| 7919 | 9년 전 | 366 | ||
| 7918 | 9년 전 | 514 | ||
| 7917 | 9년 전 | 374 | ||
| 7916 | 9년 전 | 460 | ||
| 7915 | 9년 전 | 477 | ||
| 7914 | 9년 전 | 484 | ||
| 7913 | 9년 전 | 657 | ||
| 7912 | 9년 전 | 496 | ||
| 7911 | 9년 전 | 417 | ||
| 7910 | 9년 전 | 466 | ||
| 7909 | 9년 전 | 582 | ||
| 7908 | 9년 전 | 514 | ||
| 7907 | 9년 전 | 457 | ||
| 7906 | 9년 전 | 476 | ||
| 7905 | 9년 전 | 439 | ||
| 7904 | 9년 전 | 428 | ||
| 7903 | 9년 전 | 438 | ||
| 7902 | 9년 전 | 616 | ||
| 7901 |
|
9년 전 | 786 | |
| 7900 | 9년 전 | 671 | ||
| 7899 | 9년 전 | 459 | ||
| 7898 | 9년 전 | 454 | ||
| 7897 | 9년 전 | 411 | ||
| 7896 | 9년 전 | 428 | ||
| 7895 | 9년 전 | 549 | ||
| 7894 | 9년 전 | 455 | ||
| 7893 | 9년 전 | 429 | ||
| 7892 | 9년 전 | 469 | ||
| 7891 | 9년 전 | 826 | ||
| 7890 | 10년 전 | 1252 | ||
| 7889 | 10년 전 | 793 | ||
| 7888 |
limsy1987
|
10년 전 | 604 | |
| 7887 | 10년 전 | 646 | ||
| 7886 | 10년 전 | 532 | ||
| 7885 | 10년 전 | 501 | ||
| 7884 | 10년 전 | 496 | ||
| 7883 | 10년 전 | 501 | ||
| 7882 | 10년 전 | 557 | ||
| 7881 | 10년 전 | 534 | ||
| 7880 | 10년 전 | 653 | ||
| 7879 | 10년 전 | 543 | ||
| 7878 | 10년 전 | 1305 | ||
| 7877 | 10년 전 | 834 | ||
| 7876 | 10년 전 | 572 | ||
| 7875 | 10년 전 | 644 | ||
| 7874 |
|
10년 전 | 849 | |
| 7873 | 10년 전 | 573 | ||
| 7872 | 10년 전 | 734 | ||
| 7871 | 10년 전 | 552 | ||
| 7870 | 10년 전 | 670 | ||
| 7869 | 10년 전 | 487 | ||
| 7868 | 10년 전 | 528 | ||
| 7867 | 10년 전 | 533 | ||
| 7866 | 10년 전 | 589 | ||
| 7865 | 10년 전 | 533 | ||
| 7864 | 10년 전 | 587 | ||
| 7863 | 10년 전 | 585 | ||
| 7862 | 10년 전 | 557 | ||
| 7861 | 10년 전 | 727 | ||
| 7860 | 10년 전 | 704 | ||
| 7859 | 10년 전 | 472 | ||
| 7858 | 10년 전 | 779 | ||
| 7857 | 10년 전 | 1167 | ||
| 7856 | 10년 전 | 593 | ||
| 7855 | 10년 전 | 835 | ||
| 7854 | 10년 전 | 775 | ||
| 7853 | 10년 전 | 673 | ||
| 7852 | 10년 전 | 590 | ||
| 7851 | 10년 전 | 590 | ||
| 7850 | 10년 전 | 667 | ||
| 7849 | 10년 전 | 442 | ||
| 7848 | 10년 전 | 506 | ||
| 7847 | 10년 전 | 740 | ||
| 7846 | 10년 전 | 525 | ||
| 7845 | 10년 전 | 499 | ||
| 7844 | 10년 전 | 467 | ||
| 7843 | 10년 전 | 505 | ||
| 7842 | 10년 전 | 483 | ||
| 7841 | 10년 전 | 453 | ||
| 7840 | 10년 전 | 479 | ||
| 7839 | 10년 전 | 518 | ||
| 7838 | 10년 전 | 588 | ||
| 7837 | 10년 전 | 417 | ||
| 7836 | 10년 전 | 459 | ||
| 7835 | 10년 전 | 546 | ||
| 7834 |
|
10년 전 | 1246 | |
| 7833 | 10년 전 | 504 | ||
| 7832 | 10년 전 | 490 | ||
| 7831 | 10년 전 | 662 |
댓글 작성
댓글을 작성하시려면 로그인이 필요합니다.
로그인하기