Copy link to clipboard
Copied
In the past couple of weeks i've followed tutorials to create a database in myphpadmin and create php pages in dreamweaver. My aim is for a site visitor to input information; name, location etc and have it save in the database table and be displayed on a profiles page. No problem, the tutorials worked and I can manage that but how do I allow a user to attach an image which uploads not to the database but to a designated folder. I'd also need to input the textual name of this image into the database rather than the image itself. How do I acheive this? Any links to tutorials, code examples, extensions etc would be much appreciated, thanks!!
Copy link to clipboard
Copied
This may not be the right answer for you or maybe one you don't like but here's what I did.
I had a lot of loose php knowledge scattered around in my head from working on various projects but never really a complete understanding of all I needed to know.
Then I started working with phpBB because I wanted a mod which did not exist. I found that working with a project like that which is well constructed and learning the nitty gritty of how it worked helped me tremendously. Now I often go back to phpBB and use it as kind of a library, how do they do this or that? I can often borrow php code sections from phpBB and use them in completely different projects.
You could do this with other open source projects like drupal as well. It's not quick but you'll gain a much better understanding of what's really going on.
To get back to your specific problem, I'd cheat and go right back to phpBB and see how it's done there. How do they handle uploading of image files for attachments and save the link in the db? That's exactly what you want to do.
Copy link to clipboard
Copied
Hello.. If you are looking for how to upload an image, u can try to have a look at this thread HERE. You just need to save the path in database and the image will be stored in folder.