![]() |
![]() |
![]() |
||||
Welcome to the GoFuckYourself.com - Adult Webmaster Forum forums. You are currently viewing our boards as a guest which gives you limited access to view most discussions and access our other features. By joining our free community you will have access to post topics, communicate privately with other members (PM), respond to polls, upload content and access many other special features. Registration is fast, simple and absolutely free so please, join our community today! If you have any problems with the registration process or your account login, please contact us. |
|
New Webmasters ask "How-To" questions here. This is where other fucking Webmasters help. |
|
Thread Tools |
![]() |
#1 |
Retired
Industry Role:
Join Date: Jul 2011
Location: PDXXX
Posts: 1,976
|
Need a Help with Form
My form works great but I can't get the user submitted images to save to my server or display in the email that I receive once form is submitted. What is wrong here:
Code:
$allowed_extensions = array("jpg", "jpeg", "gif", "bmp", "png"); //Get the uploaded file information $name_of_uploaded_file = basename($_FILES['photo']['name']); //get the file extension of the file $type_of_uploaded_file = substr($name_of_uploaded_file, strrpos($name_of_uploaded_file, '.') + 1); $size_of_uploaded_file = $_FILES["photo"]["size"]/1024;//size in KBs //copy the temp. uploaded file to uploads folder $path_of_uploaded_file = $_SERVER['DOCUMENT_ROOT'] .'/' . $name_of_uploaded_file; $tmp_path = $_FILES["photo"]["tmp_name"]; if(is_uploaded_file($tmp_path)) { if(!copy($tmp_path,$path_of_uploaded_file)) { $errors .= '\n error while copying the uploaded file'; } }
__________________
Piper Pines |
![]() |
![]() ![]() ![]() ![]() |
![]() |
#2 |
Confirmed User
Industry Role:
Join Date: Dec 2012
Posts: 117
|
Didnt read the code, but maybe the issue is with your upload folder permissions as they always sux.
|
![]() |
![]() ![]() ![]() ![]() |
![]() |
#3 |
Guest
Posts: n/a
|
double check the words 'photo' 'name' and 'size' are the same words as in the html on the front end form, that usually gets me.
|
![]() ![]() ![]() ![]() |
![]() |
#4 |
Registered User
Industry Role:
Join Date: Aug 2013
Location: Spain, Barcelona
Posts: 67
|
do not try to check all the code, find the place where you loose your file -
from the begining: die($name_of_uploaded_file); will give you the name of the file or you are not receiving it on the server at all? if you have the file - try to use "move_uploaded_file" include all the checkings, renamings, filters only after you will solve the main problem - getting your file in the place it should appear. |
![]() |
![]() ![]() ![]() ![]() |