Mignon Hunter wrote:
Sorry - forgot to mention the data I'm collecting will go into a dbase, that's 
why I posted here.

fine. but your not having trouble putting data into a DB. yet. :-)

Thanks I'll work with the session angle.

Please see if this logic is flawed...

The hyperlink to the pdf will spawn a new window with my form to fill out. So I think I must start the session in the first page, the one that the pdf is on.

start the session on _every_ page. its best to put all the session startup code in one file and include that on each page (thats the general principal anyhow).

So I assign the variables collected in the 2nd window the session of the first. Then when the 2nd window is closed store in session and write to dbase ?

the session (or the server for that matter) does not know anything about windows. you can use 100 windows or just one, makes no difference.

Upon closing the 2nd window redirect to the pdf.
If user wants another file, spawn a third window with form but fill in most of 
what he entered (ie name,address,etc). I get this from the current session 

1. user clicks link to download pdf. 2. server send a page with a form in it. (possibly partially filled in from previous download in this session) 3. user submits (properly filled in) form. 4. server santizises user input, stores/updates session info, adds record to DB, then: either: spits out a PDF with appropriate headers so that the browser presents a download dialog. or: redirect to a page with a link (with some kind of token/key in the query part of the URL) to a page that spits out a PDF. or: redirect to a page with some javascript that sets the location of the parent window to a new URL or: something :-)

whether you use multiple windows to accomplish this on the clientside is 
irrelevant to what you have to do on the
server. if you are redirecting you will probably want to pass some token that 
you can check (a token is only generated
if someone filled out a form) before outputting the PDF.

Ultimately the data in the dbase is the goal and I just dont want the user to have to re-enter

you do realise that if you redirect, after the user submits, to a url like:


then I can skip the whole filling the form business in and just grab the file 



PHP Database Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php

Reply via email to