Q&A: HI, I I NEED A PHP SCRIPT TO DESIGN A WEBSITE WERE PEOPLE CAN UPLOAD IMAGES AND VOTE?

Question by irina:
Hi, I i need a php script to design a website were people can upload images and vote?
Its more like a contest, whoever wins gets a contract with a t-shirt company. But for this, people need to be able to upload the art and everyone should be able to vote for their favs.
This is for a private celebration so i cannot use google images or something like that, does anyone know of a php script that I can use?
——————————————
Answer by just “JR”
For uploading images:
UPLOADING FILES
The
type FILE will show an input field and a “browse” button.
Clicking the browse button will grant the user to choose a file to
upload.
Clicking the submit will submit the form to this same file.
Your “upfiles.php”:
{
$ uploaddir = 'uploadedfiles/';
if (is_uploaded_file($ fname['tmp_name']))
{
$ filname = basename($ fname['name']);
$ uploadfile = $ uploaddir . basename($ fname['name']);
if (move_uploaded_file ($ fname['tmp_name'], $ uploadfile))
$ res = "File " . $ filname . " was successfully uploaded and stored.
“;
else
$ res = “Could not move “.$ fname['tmp_name'].” to “.$ uploadfile.”
“;
}
else
$ res = “File “.$ fname['name'].” failed to upload.”;
return ($ res);
}
?>
if ($ _FILES['picture']['name'] != "")
{
$ res = UploadOne($ _FILES['picture']);
$ filname = $ _FILES['picture']['name'];
echo ($ res);
}
?>
UPLOADING FILES
Finally: you must create a directory where to put the uploaded files, and that
directory MUST have permissions set to 0777… (here called “uploadedfiles”)
(This set of functions works, but is NOT secure against viruses or “injection”:
the prevention of these is a much more complicated matter!)
—-
For voting: go to http://www.web2coders.com and download “thumbs up, thumbs down” free script.
Good luck!
——————————————
Know better? Leave your own answer in the comments!









about 1 year ago
Blogger does accept scripts.
You click add widget, html/javascript, and then you cut and paste the code you need.
Do not put it in the template html as that is written in xml and will be considered not to be well formed.
Also, they have an adsense widget specifically.
about 1 year ago
That’s because you’re not properly inserting the code. You need to copy/paste the AdSense code as it’s found on the AdSense site.