View Full Version : Php output error.
dragos240
May 11th, 2009, 11:53 PM
I was uploading an upload script to my website, for a simple desktop upload site much like ourdesktops.com, oddly, it just displays the contents of the file: Here is the file:
$target_path = "";
$target_path = $target_path . basename( $_FILES['uploadedfile']['name']);
if(move_uploaded_file($_FILES['uploadedfile']['tmp_name'], $target_path)) {
echo "The file ". basename( $_FILES['uploadedfile']['name']).
" has been uploaded";
} else{
echo "There was an error uploading the file, please try again!";
}
jinksys
May 12th, 2009, 02:27 AM
Is the script in proper form?
By that I mean,
do you use <?php ?>
Is the script have the php extension?
Do you have PHP installed?
Reiger
May 12th, 2009, 02:36 AM
Just for reference: you should really check the size of the upload as well as the 'error' code (should be UPLOAD_ERR_OK).
dragos240
May 12th, 2009, 08:32 PM
Is the script in proper form?
By that I mean,
do you use <?php ?>
Is the script have the php extension?
Do you have PHP installed?
I recall using that,
I have a php extention
Hai, I do.
hessiess
May 12th, 2009, 09:50 PM
So the PHP code displays in the browser?, do any outher PHP scripts work? If you are using a local server are you browsing to the file with the webserver, i.e. http://localhost/phpscript.php. Just doubbleckicking on the file won't work.
You do know that that script is exreamly inscure and could be used to upload PHP scripts(MASSIVE sccurity hole), or anything basically.
dragos240
May 12th, 2009, 09:59 PM
Yes, I am sure, I have 2 files for the uploader, upload.php and uploader.php. Upload.php works, and I have a simple machine forum, it works great. I'm just not sure whats happening now.
EDIT: I have a 2mb limit, and it only uploads to a certain directory, this is in upload.php, uploader.php is the one I posted as it doesn't work. If you want me to post upload.php, I will.
Powered by vBulletin® Version 4.2.2 Copyright © 2024 vBulletin Solutions, Inc. All rights reserved.