upload and display on the same admin page

PHP programming forum. Ask questions or help people concerning PHP code. Don't understand a function? Need help implementing a class? Don't understand a class? Here is where to ask. Remember to do your homework!

Moderator: General Moderators

Post Reply
abhikerl
Forum Newbie
Posts: 9
Joined: Wed Jun 04, 2008 2:07 am
Location: Mauritius

upload and display on the same admin page

Post by abhikerl »

Hi, I know the basic stuff of php. I already know how to upload picture and text in the database. But, as you know, the upload page and display page is different. What I want is to upload the picture and the text and display what I upload on the same page.
Any suggestions will be welcome. Thanks a lot :)

http://www.islandinfo.mu
User avatar
califdon
Jack of Zircons
Posts: 4484
Joined: Thu Nov 09, 2006 8:30 pm
Location: California, USA

Re: upload and display on the same admin page

Post by califdon »

abhikerl wrote:Hi, I know the basic stuff of php. I already know how to upload picture and text in the database. But, as you know, the upload page and display page is different. What I want is to upload the picture and the text and display what I upload on the same page.
Any suggestions will be welcome. Thanks a lot :)

http://www.islandinfo.mu
There are two things that you may be thinking of. One is to reload the page after uploading the picture and text to the database. Another is to not reload the page, but use Ajax to modify the page by assigning content to otherwise empty controls on the page.

The first is quite easy. On completion of the upload, just call the same script again only pass either a POST or GET parameter to it that your PHP script will test for and if it is present, it will display the uploaded image and text.

The Ajax solution isn't terribly difficult, but it requires additional familiarity with Ajax. Here's a beginning tutorial on Ajax: http://w3schools.com/ajax/ajax_intro.asp
Post Reply