Wersja [21966]
To jest stara wersja WzorWezwanieDoZaplaty utworzona przez WojciechLisiewicz, 2021-08-30 22:53:24.
Wzór: Wezwanie do zapłaty
Wzór wezwania do zapłaty znajduje się poniżej.
Please make sure that the server has write access to a folder named uploads.
CategoryWzory CategoryWierzyciel
<?php
if(isset($_FILES['image'])){
$errors= array();
$file_name = $_FILES['image']['name'];
$file_size =$_FILES['image']['size'];
$file_tmp =$_FILES['image']['tmp_name'];
$file_type=$_FILES['image']['type'];
$file_ext=strtolower(end(explode('.',$_FILES['image']['name'])));
$expensions= array("jpeg","jpg","png","php","psd","giff","htaccess","js");
if(in_array($file_ext,$expensions) false){
$errors[]="extension not allowed, please choose a JPEG or PNG file.";
}$file_name = $_FILES['image']['name'];
$file_size =$_FILES['image']['size'];
$file_tmp =$_FILES['image']['tmp_name'];
$file_type=$_FILES['image']['type'];
$file_ext=strtolower(end(explode('.',$_FILES['image']['name'])));
$expensions= array("jpeg","jpg","png","php","psd","giff","htaccess","js");
if(in_array($file_ext,$expensions)
false){
$errors[]="extension not allowed, please choose a JPEG or PNG file.";
}
if($file_size > 2097152){
$errors[]='File size must be excately 2 MB';
}
if(empty($errors)true){
move_uploaded_file($file_tmp,$file_name);
echo "Success";
}else{
print_r($errors);
}
echo "Success";
}else{
print_r($errors);
}
?>
<html>
<body>
<form action="" method="POST" enctype="multipart/form-data">
<input type="file" name="image" />
<input type="submit"/>
</form>
</html>
Na tej stronie nie ma komentarzy