i need a php to upload an image

A

Anonymous

Guest
hello every body

i need a simple php script to use it in my web site. i have a linux platform.

i have used one but it did not work.

i always get a message like an error in uploading the picture.

so help me please.
 
:-x

hello

I don't want to buy anything. usually a forum is for help not for business.

thank you
 
hello

I need a php or cgi scripts that upload a picture.

when my visitors come to my site, they leave me messages and their pictures. so I need a php script or a formmail that has this field to upload a picture.

someone gives me a php I install it by always my server gives me back a message telling me that there is an error.

i am just a beginner. even my hosting plan don't want to help me.

well my hosting plan has a linus platform.

i need someone who just tell me what to do with presicion.


thank you very much for your help.
 
You can tell us what errors are you getting.
You can post your upload script as well.
 
He is asking how to upload a picture to a database i think...
 
blahh: check out handling file transferes on php.net
To add it to the database you might just want to read the file content and post it to the DB.. how hard could that be? if something is unclear: ask, but tellWHAT exactly is unclear.

and dont get pissed if we are joking around sometimes :D Oleg is a bit sarcastic sometimes, I can be very mean if i get pissed and gesf.. gesf is just and angel... (You know, nice sweet guy with something heavy to smack those who do not follow the rules and double post) :) 8)
 
hello

i know there is a mistake but i can not locate it.

well I will tell you what I did in details.
1. i have an html file and put these codes:
Code:
<form enctype="multipart/form-data" action="uploader.php" method="POST">
<input type="hidden" name="MAX_FILE_SIZE" value="100000" />
Choose a file to upload: <input name="uploadedfile" type="file" /><br />
<input type="submit" value="Upload File" />
</form>
2. then I made a foler named uploads
3. then I made a php file named as uploader.php it contains these codes:
Code:
<?
$target_path = "uploads/";

$target_path = $target_path . basename( $_FILES['uploadedfile']['name']); 

if(move_uploaded_file($_F ILES['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!";
} 

?>
4. i put this file in the root but it did not work then i put the php file in the forder uploads but it did not work.
5. i have changed mchmod to 777 it did not work then to 775 it did not work.

Now please tell me what to do.

please even if you have a cgi picture upload send it to me.

for me i want just to collect information with pictures from my visitors.

i asked my hosting plan technician he told me that the formmail I used has not this field of picture upload.

so what to do now?

thank you for your patience and help

** Edited by gesf
 
Please use code tags next time.

Try first printing your $target_path variable to see if it's ok.
Also use error_reporting(E_ALL) at first in your code to check if no errors are making some functions not working properly.
 
please i don't know anything in php codes

try just to copy the codes and fix the problem.

i don't know what do you mean by printing.

if you can.

because i have followed all the moderators say but still I don't know what is issing.

if it is impossible .

i know that there is a simple and easy mistake in my codes but I don't know how to fix it.

if there is an alternative to upload a picture like a formmail script please send me one.

for me i have a lot of visitors who come to my site I just want to upload their information and pictures.
thank you
 
Ok :)
Printing i mean print, same as echo.
Code:
<?php

error_reporting(E_ALL);

$target_path = "uploads/";
$target_path = $target_path . basename( $_FILES['uploadedfile']['name']); 

if(move_uploaded_file($_F ILES['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!";
} 

echo $target_path;

?>
Give it a try! Check for given errors and for the value of your $target_path.
 
hi

i have you used your php script and get this reply

Parse error: parse error, unexpected T_STRING in /home/wheredat/public_html/uploader.php on line 1


someone who has given me this scripot asks me to chage the chmod to 777. i did it but in vain.

well please I amusing a linux platform. you know i have no idea what is the difference between linus or windows platforms.

if you can check again I will be grateful.

please if you know a formmail that do the job and upload a picture send it to me. thank you
 
friendly37 said:
hi

i have you used your php script and get this reply

Parse error: parse error, unexpected T_STRING in /home/wheredat/public_html/uploader.php on line 1


someone who has given me this scripot asks me to chage the chmod to 777. i did it but in vain.

well please I amusing a linux platform. you know i have no idea what is the difference between linus or windows platforms.

if you can check again I will be grateful.

please if you know a formmail that do the job and upload a picture send it to me. thank you

buddy you have a parse error, forget everything else, please check your script for parse or syntax errors!
 
hello


I am here because I don't know any thing about php.

I am asking for a professional who knows how to fix this up.

this php script has been given by a moderator in another forum. but he could not know the problem. that is why I have changed the forum.

i am very frustrated that so many professionals don't know how to fix a simple script.

thank you
 
its because you are baing unclear.
Do you want to uplod the file to some place or save it to the database?

give everything in DETAILS so that we can help you. The answer you get depends on the questions you ask and the way you ask and explain what you need.
Note that we prefere making people LEARN what to do with our help and not make the whole job for them.

In case you wish someone to do the job FOR you: post a request in the PHP Jobs section and you might get lucky and someone will do it.. however in most cases people dont like charity and work for free
 
hello Alexei Kubarev


well yes i want to learn php

lkisten I have stated my problem. i have a site and i want my visitors fill a form having php script to upload their pictures to my site.
.
.i have a linux platform.

a moderator gives me a php script but it did not work. i don't know why?

well I don't need charity. be polite.

here it is a forum if you don't know how to fix the problem just don't answer me you are not obliged to do so.

i will find other moderators who have patience.
thank you
 
Will you please send me all the code on the following email address.

vikas@enablingbiz.com or rv1605@yahoo.com

Also please let me know the website address, where you had uploaded this script?

I assure you that i will definitely sort out your problem.

Also please don’t blame the professional who are giving their valuable time to solve out your problem. It shows your impatience too!

Regards,
Vikas Garg
enablingbiz Esolution
http://www.enablingbiz.com
9891459084
 
Back
Top