keeping output to print on another 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
malcolmboston
DevNet Resident
Posts: 1826
Joined: Tue Nov 18, 2003 1:09 pm
Location: Middlesbrough, UK

keeping output to print on another page

Post by malcolmboston »

ok, im basically looking at a nice way of passing results from page 1 to page 3 for eg.

page 1) Search form
page 2) go to a page saying "searching our database" (meta refresh to p3)
page 3) print "results";

i have thought of a few methods but they all have downsides

+ hold in a temp cookie (cookies can be disabled)
+ hold in a session var (no point in instantiating a session for this imo)
+ use GET parameter (unsafe)
+ use javascript auto post data from P2 (unsafe, can be circumvented)

any ideas?
User avatar
JayBird
Admin
Posts: 4524
Joined: Wed Aug 13, 2003 7:02 am
Location: York, UK
Contact:

Post by JayBird »

why even have page 2? that kind of thing just usually does my head in..."take me to the results already!" :lol:
malcolmboston
DevNet Resident
Posts: 1826
Joined: Tue Nov 18, 2003 1:09 pm
Location: Middlesbrough, UK

Post by malcolmboston »

mark, i absolutely agree with you, i also hate this because in my opinion it just slows down the browsing experience, however this has been requested, thyey see it as a bit of a "noob" feature.

basically, its crap i know, but i need to know the best way of doing it, i could do it in many ways but theres too many pitfalls with each.

What im looking for, for eg. is something like hotscripts.com
User avatar
patrikG
DevNet Master
Posts: 4235
Joined: Thu Aug 15, 2002 5:53 am
Location: Sussex, UK

Post by patrikG »

I'd use GET. Can't really see why it should be unsafe if you have a proper filter in place.
User avatar
wwwapu
Forum Contributor
Posts: 197
Joined: Wed Apr 07, 2004 11:57 am
Location: Turku, Finland

Post by wwwapu »

malcolmboston wrote:... i also hate this ... its crap i know...
Isn't serving the customers a delight :D

The ways you listed maybe the cookie is the best. You can always state that this service requires cookies.
User avatar
phpScott
DevNet Resident
Posts: 1206
Joined: Wed Oct 09, 2002 6:51 pm
Location: Keele, U.K.

Post by phpScott »

why not a form and hidden input types on page 2, the form can be post and know one would know without looking at the view source.

in fact if you wanted you probably could produce the query on page 1 put it onto page 2 in the form then when that page gets submitted it pass along the query to page 3. unsafe i know but just another thought.
User avatar
artexercise
Forum Commoner
Posts: 33
Joined: Thu Nov 20, 2003 9:38 am
Location: Raleigh, NC

Post by artexercise »

What about faking a page 2?

Put the "searching because I have to..." message in a div statment and give it a visibility style of "visible". If you declare this in the header and at the beginning of the body tag add an onLoad variable which points to a function that hides the "waiting..." statement and makes visible the valuable information kept neatly in another div.

That way you don't have to page stuff through a useless page, hide variables, etc...

JOE--
timvw
DevNet Master
Posts: 4897
Joined: Mon Jan 19, 2004 11:11 pm
Location: Leuven, Belgium

Post by timvw »

This is how the flow in my pages is usually set up:

(1) Present user a list with all the records (well, at least a page - pagination)
(2) Present a screen that allows the user to input limitations
(3) Go back to (1) but add the limitations to the WHERE clause
malcolmboston
DevNet Resident
Posts: 1826
Joined: Tue Nov 18, 2003 1:09 pm
Location: Middlesbrough, UK

Post by malcolmboston »

malcolmboston wrote:i absolutely agree with you, i also hate this because in my opinion it just slows down the browsing experience, however this has been requested, they see it as a bit of a "noob" feature.
It has to be done
Post Reply