PHPStudy? ???? PHP?? ?? ???? ?????? ???????
PHPStudy? ???? PHP?? ?? ???? ?????? ??? ???????.
- Phpstudy ?? : ?? ?? ? ????? phpstudy? ?????? ??????. ?? ??? ???? ??? ??? ??????.
-
??? ?? ?? :
- Phpstudy? ???? Apache ? MySQL ???? ??????.
- "? ??? ??"??? ?? ? ?? "? ??? ??"? ???? ? ? ???? ????. ??? ?? (? :
localhost
)? ???? ?? ????? ??? ?? ??? PHP ??? ??????.
-
?? ???? ?? PHP ?? ?? :
- ? ???? ?? ???? (? : Windows ?
C:\phpStudy\WWW
)? ??????. -
? PHP ?? (? :
upload.php
)? ???? ?? ???? ???? ? ??? ??? ??????. ?? ?? ??? ????.<code class="php"> <form action="upload.php" method="post" enctype="multipart/form-data"> Select file to upload: <input type="file" name="fileToUpload" id="fileToUpload"> <input type="submit" value="Upload File" name="submit"> </form> <?php $target_dir = "uploads/"; $target_file = $target_dir . basename($_FILES["fileToUpload"]["name"]); $uploadOk = 1; $imageFileType = strtolower(pathinfo($target_file,PATHINFO_EXTENSION)); if(isset($_POST["submit"])) { if (move_uploaded_file($_FILES["fileToUpload"]["tmp_name"], $target_file)) { echo "The file ". htmlspecialchars( basename( $_FILES["fileToUpload"]["name"])). " has been uploaded."; } else { echo "Sorry, there was an error uploading your file."; } } ?></code>
- ? ???? ?? ???? (? : Windows ?
-
?? ??? ??? :
- ? ??????
http://localhost/upload.php
???????. - ??? ? ??? ???? "?? ???"??? ??????.
- ???
uploads
????? ????? ??????? ????? ??? ??????.
- ? ??????
PHPStudy? ?? ???? ??? ? ? ???? ???? ??? ??????
PHPStudy? ?? ???? ??? ? ?? ??? ?? ???? ??? ??? ? ????.
- ?? ?? : ? ??? ?? ????? ? ??? ?? ? ????. Apache ????
uploads
????? ?? ?? ???? ??? ??????. - ?? ?? ?? : PHP??
upload_max_filesize
?post_max_size
? ?? ?? ????? ? ? ?? ???? ?? ? ? ????.php.ini
?? ??? ??? ???? ? ?? ????. - ?? ?? : ?? PHP ?? ??? ? ?? ???? ?? ?? ?? ? ????.
php.ini
??max_execution_time
??? ??? ?? ? ? ????. - ?? ? ?? : PHP?? ??? ?? ??? ??? ??? (? :
fileinfo
)? ?? ? ????.php.ini
?? ??? ?? ??? ????? ??? ??????. - ?? ?? : ?? ? ????? ?? ???? ?? ???? ???? ?? ??? ?? ? ? ????. ??? ?? ? ??? ??? ??? ?? ??? ???????.
- ?? ?? : PHP ?????? ?? ?? ? ??? ?? ??? ?? ? ? ????. ?? ?? ?? ???? ???? ?? ??? ??? ?? ??????.
PHP?? ? ?? ???? ????? phpstudy? ????? ?????????
PHPStudy? PHP?? ? ?? ???? ????? ????? ?? ??? ?????.
-
php.ini
?? : phpstudy ????php.ini
??? ?????. ????? ???? ?? PHP ???php
??? ????. -
?? ?? ?? ?? :
-
php.ini
??upload_max_filesize
?post_max_size
??? ?????. -
? ? ??? ???? ?? ??? ?? ?????. ?? ??:
<code>upload_max_filesize = 100M post_max_size = 100M</code>
-
post_max_size
?upload_max_filesize
?? ??? ? ??????.
-
-
?? ?? ?? :
-
max_execution_time
??? ??? ? ? ??? ??? ????? ?????.<code>max_execution_time = 300</code>
- ?? ?? ?? ??? 5 ??? ????? ???? ? ?? ???? ?????.
-
- ??? ??? : ?? ??? ?? ? ? Phpstudy? Apache ???? ?? ???? ? ??? ??????.
- ?? ?? ?? : ? ?? (? ?? APACHE)? ? ? ?? ???? ????? ???? ??? ??????.
LimitRequestBody
? ??httpd.conf
???? ??? ???? ? ?? ????.
PHPStudy? ?? ???? ??? ? ? ?? ?? ??? ????????
PHPStudy? ?? ???? ??? ? ? ?? ?? ??? ???? ???? ?? ? ? ????.
-
?? ?? ??? ?? : ?? ?? ? ?? ??? ???? ?? ?? ??? ??? ? ? ????. PHP?
finfo
??? ???? MIME ??? ??????.<code class="php">$finfo = finfo_open(FILEINFO_MIME_TYPE); $mime_type = finfo_file($finfo, $_FILES['fileToUpload']['tmp_name']); if (in_array($mime_type, ['image/jpeg', 'image/png'])) { // File type is valid } else { // File type is not valid } finfo_close($finfo);</code>
- ?? ?? ?? : PHP?
upload_max_filesize
??? ????? ?? ??? ???? ???? ? ??? ????? ??????. -
?? ?? ?? ?? : ??? ? ?? ??? ??? ?? ??? ?? ?? ?? ???? ??? ? ??? ?? ? ?? ??? ???? ???????. ?? ???? ??? ???? ??? ??????.
<code class="php">$new_filename = uniqid() . '-' . $_FILES['fileToUpload']['name'];</code>
- ? ?? ??? ??? ?? : ?? ???? ???? ?? ? ??? ?? ?? ??? ? ??? ????? ??? ? ??? ?????. ?? ??, c : \ phpstudy \
C:\phpStudy\WWW\uploads
C:\phpStudy\secure_uploads
? ?? ????? ??? ??????. -
CSRF ?? ?? : ??? ???? ?? ??? ??? ??? ? ??? ??? ?? ?? ??? ?????.
<code class="php">session_start(); $token = bin2hex(random_bytes(32)); $_SESSION['csrf_token'] = $token; // In your HTML form <input type="hidden" name="csrf_token" value="<?php echo $token; ?>"> // And in your PHP script when processing the upload if ($_POST['csrf_token'] !== $_SESSION['csrf_token']) { die("CSRF token mismatch"); }</code>
- PHPStudy ? PHP : PHPStudy, PHP ? ?? ?? ?? ??? ?? ??? ???? ??? ???? ??????.
??? ?? ??? ???? PHPStudy ??? ???? ?? ???? ??? ??? ?? ?? ? ????.
? ??? PHPStudy? ???? PHP?? ?? ???? ?????? ???????? ?? ?????. ??? ??? PHP ??? ????? ?? ?? ??? ?????!

? AI ??

Undress AI Tool
??? ???? ??

Undresser.AI Undress
???? ?? ??? ??? ?? AI ?? ?

AI Clothes Remover
???? ?? ???? ??? AI ?????.

Clothoff.io
AI ? ???

Video Face Swap
??? ??? AI ?? ?? ??? ???? ?? ???? ??? ?? ????!

?? ??

??? ??

???++7.3.1
???? ?? ?? ?? ???

SublimeText3 ??? ??
??? ??, ???? ?? ????.

???? 13.0.1 ???
??? PHP ?? ?? ??

???? CS6
??? ? ?? ??

SublimeText3 Mac ??
? ??? ?? ?? ?????(SublimeText3)

??? ??









