<?
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; 이런식으로찍어보세요
게시판 목록
프로그램
| 번호 | 제목 | 글쓴이 | 날짜 | 조회 |
|---|---|---|---|---|
| 5730 | 13년 전 | 778 | ||
| 5729 | 13년 전 | 3593 | ||
| 5728 | 13년 전 | 1162 | ||
| 5727 |
freejazzme
|
13년 전 | 1115 | |
| 5726 | 13년 전 | 1457 | ||
| 5725 |
itlang
|
13년 전 | 441 | |
| 5724 | 13년 전 | 521 | ||
| 5723 |
crocojea
|
13년 전 | 1506 | |
| 5722 | 13년 전 | 1991 | ||
| 5721 | 13년 전 | 717 | ||
| 5720 |
쿠우우우우
|
13년 전 | 474 | |
| 5719 | 13년 전 | 621 | ||
| 5718 |
|
13년 전 | 598 | |
| 5717 | 13년 전 | 1454 | ||
| 5716 |
|
13년 전 | 1045 | |
| 5715 | 13년 전 | 473 | ||
| 5714 | 13년 전 | 475 | ||
| 5713 | 13년 전 | 539 | ||
| 5712 |
|
13년 전 | 777 | |
| 5711 | 13년 전 | 702 | ||
| 5710 |
minini
|
13년 전 | 494 | |
| 5709 |
|
13년 전 | 1337 | |
| 5708 | 13년 전 | 693 | ||
| 5707 | 13년 전 | 5863 | ||
| 5706 |
오니기리죠
|
13년 전 | 1030 | |
| 5705 |
HSEngine
|
13년 전 | 659 | |
| 5704 |
Giggle
|
13년 전 | 1703 | |
| 5703 | 13년 전 | 512 | ||
| 5702 |
AMDbest
|
13년 전 | 1426 | |
| 5701 |
|
13년 전 | 2895 | |
| 5700 | 13년 전 | 507 | ||
| 5699 |
미션임파썩을
|
13년 전 | 550 | |
| 5698 | 13년 전 | 635 | ||
| 5697 | 13년 전 | 552 | ||
| 5696 | 13년 전 | 460 | ||
| 5695 |
|
13년 전 | 715 | |
| 5694 | 13년 전 | 456 | ||
| 5693 | 13년 전 | 986 | ||
| 5692 | 13년 전 | 955 | ||
| 5691 |
쉽다zzz
|
13년 전 | 720 | |
| 5690 | 13년 전 | 477 | ||
| 5689 | 13년 전 | 638 | ||
| 5688 | 13년 전 | 1418 | ||
| 5687 | 13년 전 | 469 | ||
| 5686 | 13년 전 | 2455 | ||
| 5685 |
AMDbest
|
13년 전 | 2160 | |
| 5684 | 13년 전 | 2045 | ||
| 5683 | 13년 전 | 1374 | ||
| 5682 |
AMDbest
|
13년 전 | 709 | |
| 5681 | 13년 전 | 3827 | ||
| 5680 |
|
13년 전 | 1688 | |
| 5679 | 13년 전 | 2097 | ||
| 5678 |
|
13년 전 | 536 | |
| 5677 |
mobiler
|
13년 전 | 470 | |
| 5676 | 13년 전 | 1614 | ||
| 5675 | 13년 전 | 594 | ||
| 5674 |
PHPㅡASP프로그래머
|
13년 전 | 1826 | |
| 5673 |
PHPㅡASP프로그래머
|
13년 전 | 1499 | |
| 5672 |
PHPㅡASP프로그래머
|
13년 전 | 1290 | |
| 5671 |
PHPㅡASP프로그래머
|
13년 전 | 1221 | |
| 5670 |
PHPㅡASP프로그래머
|
13년 전 | 4617 | |
| 5669 | 13년 전 | 3053 | ||
| 5668 | 13년 전 | 1419 | ||
| 5667 | 13년 전 | 501 | ||
| 5666 | 13년 전 | 1150 | ||
| 5665 |
Darby
|
13년 전 | 1615 | |
| 5664 | 13년 전 | 1343 | ||
| 5663 | 13년 전 | 1131 | ||
| 5662 | 13년 전 | 795 | ||
| 5661 | 13년 전 | 459 | ||
| 5660 | 13년 전 | 844 | ||
| 5659 | 13년 전 | 712 | ||
| 5658 | 13년 전 | 532 | ||
| 5657 | 13년 전 | 538 | ||
| 5656 | 13년 전 | 991 | ||
| 5655 | 13년 전 | 437 | ||
| 5654 | 13년 전 | 391 | ||
| 5653 |
졸린다젠장
|
13년 전 | 481 | |
| 5652 |
|
13년 전 | 400 | |
| 5651 | 13년 전 | 1032 | ||
| 5650 | 13년 전 | 727 | ||
| 5649 | 13년 전 | 2238 | ||
| 5648 | 13년 전 | 481 | ||
| 5647 | 13년 전 | 757 | ||
| 5646 | 13년 전 | 1493 | ||
| 5645 | 13년 전 | 683 | ||
| 5644 | 13년 전 | 617 | ||
| 5643 |
|
13년 전 | 574 | |
| 5642 |
쿠마하우스
|
13년 전 | 685 | |
| 5641 |
goaway
|
13년 전 | 1084 | |
| 5640 |
쿠마하우스
|
13년 전 | 648 | |
| 5639 | 13년 전 | 677 | ||
| 5638 |
쿠마하우스
|
13년 전 | 1002 | |
| 5637 | 13년 전 | 825 | ||
| 5636 | 13년 전 | 1420 | ||
| 5635 |
goaway
|
13년 전 | 912 | |
| 5634 |
lllolll
|
13년 전 | 422 | |
| 5633 | 13년 전 | 970 | ||
| 5632 | 13년 전 | 4275 | ||
| 5631 | 13년 전 | 580 |
댓글 작성
댓글을 작성하시려면 로그인이 필요합니다.
로그인하기