Jump to content

User upload Pic to Dir + DB


BaconBeast321

Recommended Posts

Hi there, still working on my site... and I am up to the final and hardest part :/

I have a section where users submit a journal with pictures for that journal. I have a journal search sytem by username and genres..--
Now, I want to be able to have a user upload a picture for a journal and have it upload the picture to a directory with the $journalname as prefix and incremental n.o as suffix. e.g (myadventure03.jpg). Then I want to add this label to the DB.

So that, when I click on a journal to view I can get it to display all pictures for that journal by a MYSQL search with journal (column) = $journalname for example...
--

I've looked around for tutorials on this and tried to do it myself but I am having a bit of trouble, any help would be greatly appreciated..

Thanks,
Link to comment
https://forums.phpfreaks.com/topic/14459-user-upload-pic-to-dir-db/
Share on other sites

  • 2 weeks later...
Hi well I've gone away and tried to use the tutorial but I am having no luck..

Here is my script:


--makeaj.php--
<form action="makeajcom.php" method="post"><br>
Type (or select) Filename: <input type="file" name="uploadFile">
<input type="submit" value="Upload File">
</form>






--makeajcom.php---
<?php

move_uploaded_file ($_FILES['uploadFile'] ['tmp_name'],
      "../journalpics/{$_FILES['uploadFile'] ['name']}")

?>


The directory journalpics is below the dir of these php files.. still... the files arent being uploaded into that directory..

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.