2 Problems

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
mjseaden
Forum Contributor
Posts: 458
Joined: Wed Mar 17, 2004 5:49 am

2 Problems

Post by mjseaden »

Dear All,

I am having two problems with my new site.

(1) I have a search page. The search page is accessed from the front page of my site, on which a form is placed where users are able to select their search criteria. The search form finds items in the database that fulfill this criteria, and displays them.

Because a small thumbnail is shown for each item, it takes some time for the whole search page to load. If a user clicks on one of the matching thumbnail before the page is fully loaded, a new page showing detailed information on that item is shown.

Now, when the user clicks 'Back' to go back to the search listing, because the searching listing wasn't fully loaded before the user clicked on an item, IE for some reason says that the 'Web Page Has Expired'.

If the search page is fully loaded before the user clicks on an item thumbnail, this problem does not occur.

Is there any solution to this problem?

(2) I have an 'item add' form to fill in so that administrators can add new items to the database. On this page are various text boxes/areas to fill in containing information on these items, and some FILE input controls so that the adminsitrator can select photos of the item off a hard drive to upload to the site.

When the administrator wants to upload the photos, I need to take them to a new page whilst the photos are uploaded, posting the data using the POST method. When I direct the administrator back to the 'item add' form, I want the information entered into those text boxes/areas to still be there.

What is the best way to save this information?

Many thanks for your help on either of these points.

Mark
magicrobotmonkey
Forum Regular
Posts: 888
Joined: Sun Mar 21, 2004 1:09 pm
Location: Cambridge, MA

Post by magicrobotmonkey »

To problem one, I have no answer. Problem 2, assuming you are using functions, save the POST data variables to appropriate SESSION data variables when moving away from the input page. Then, on the input page, at each form input check to see if the approrate SESSION variable is set, and, if so, fill it in. Simple!
User avatar
patrikG
DevNet Master
Posts: 4235
Joined: Thu Aug 15, 2002 5:53 am
Location: Sussex, UK

Post by patrikG »

try header("cache: private"); on the search-page.
mjseaden
Forum Contributor
Posts: 458
Joined: Wed Mar 17, 2004 5:49 am

Post by mjseaden »

Hi,

I think the problem is the need to resend the POST information when going back to the search page. I'm sure I haven't experienced this problem on other sites.

Is there any way to get over this resending problem?

Many thanks

Mark

And thanks very much for the solution to the second problem.
Post Reply