|
Posted by d on 03/21/06 16:46
"gerg" <noemail@noemail.com> wrote in message
news:wP6dnfYl1bm674LZnZ2dnUVZ_vmdnZ2d@comcast.com...
> Typically in my scripts, I have the script do something, IE upload a file,
> grab some database info, etc...and then display a confirmation/results
> page. I'm wondering if I can have a page do just the opposite, Display
> something , but still work on something else, IE uploading a file,
> grabbing some database info, etc... What I want to do is have a file
> upload form, that submits to a page that loads all html and gives a
> message like, please wait while your file loads. You will be re-directed
> upon a successful upload, type of message. Then when the file uploads the
> redirect would happen, etc... Would this mess with the headers? Would
> this be a good use for the output buffer? Thanks in advance.
>
> Greg
It's definitely possible. I'm currently working on a project for an
advertising agency (client extranet), and I used something similar: I wrote
a page that the user can use to upload large files to the server. The page
transfers the files in the background, and gets updated during the process
(speed/percentage complete, etc.). That allows the user to queue up a list
of files (as many as they want), and the system will keep uploading them
until they're all transferred safely.
To have stuff working in the background, it's a good idea to use iframes
and/or ajax to perform the asynchronous request. Think about having a
hidden iframe that can contain PHP scripts. Your javascript can just switch
PHP pages in and out of that iframe, and the PHP pages can spit out
javascript. You can even have forms submitting to it (get or post - doesn't
matter). Hey presto - two-way communication between browser and PHP without
refreshing the page.
dave
Navigation:
[Reply to this message]
|