Jump to content

Recommended Posts

Hi

 

Looking for some pointers or a tutorial on coding where I can upload an image from a admin/control panel and have it display on certain pages. Something like all the major and minor scripts like wordpress etc. the image I want to upload is the site logo and currently I have to manually change the logo from the css I like to have it where this can be done from the admin/cms panel of my site. I know that tables will have to be created code placed on the front and back end where this needs to be done. but like I said I am a rookie and would like to view a tutorial on how this is done so I can learn. Please excuse me I have yet to know the exact wording to ask since I am learning PHP as of know.   

Link to comment
https://forums.phpfreaks.com/topic/241376-php-help-for-a-rookie/
Share on other sites

Your particular request can be broken down into two parts and is easily found using Google.  Search for 'php image upload' and 'php admin panel'.  You should be able to find plenty of tutorials and if you run into coding trouble, then come back and ask for specific help.

Neither of these are a good starting point for a PHP programmer.

 

As a warning - you could easily open your entire site up to an attacker by allowing users to interface with your server, especially allowing file uploads.

 

If you base this code off of a tutorial, and not personal knowledge, you're trusting the entire contents of your site (possibly server) to the author of said tutorial.

Neither of these are a good starting point for a PHP programmer.

 

As a warning - you could easily open your entire site up to an attacker by allowing users to interface with your server, especially allowing file uploads.

 

If you base this code off of a tutorial, and not personal knowledge, you're trusting the entire contents of your site (possibly server) to the author of said tutorial.

 

I completely agree with what you said. I only like to know how this can be done and learn from the experience. I already have a cms in place which is for the most part secure and will continuously make it more secure when I see any holes or poor coding. Thanks to Maq for the search terms I have found a few tutorials but there tutorials are about making a full or semi full admin panel and all I need is to upload images to the img dir and have it stored in the db and the code to have it display on (for example) the header. I am still looking but have not found one that explains what i want for the most part I found uploading images and storing them into the db but nowhere how to display the stored images to pages as of yet. To put it simply I just want to add this functionality to the admin panel currently in place and not have to make the necessary image changes manually.

The first part of your problem, ie; image upload, is solved I hope. The second part is retrieving that image and show it in a fixed spot of your web page. For this part, I think you may keep that image in a image folder and put the extension in database. The rest of the part is not very complex. There are lot of tutorials and guides on internet that would help you to retrieve image for showing.

P.S. If it is for logo and you want it to change often from the admin panel, then you may use JavaScript to show it. So that load on server will be less.

Best of luck.

So all you need look at is" php image upload".

 

Figured that out now with some of the tutorials I read. Now how to display them to specific pages or section of the page is my issue.

semperfi, It would be easier for all of us if you create a new thread in the proper section with some of the code and a better explanation of what's troubling you.  We can't really help when you only write a one-liner of what you need.

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • 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.