ajax - Triggering two page at once in PHP -


suppose, have 4 pages (index.php, progressbar.php, buffering.php, trackvalue.php). want accomplish is,

1

when submit value index.php has landed in progressbar.php.

2

progressbar.php will grab current status value txt file created buffering.php.

3

buffering.php receive value index.php while submitting value @ first. , page output progress value in txt file.

so have trigger , send value buffering.php while clicks submit button have land in progressbar.php not in buffering.php. don't tell me include prgressbar.php in buffering.php because have capture real time data page. , buffering enable in buffering.php can't that. don't tell me disable output buffering, reason can't that.

please suggest me how can trigger script in background along passing value.

please suggest me how can trigger script in background along passing value.

the php page have finish processing before complete return.

to sounds trying do, need create event-driven code. doing following:

don't have index.php communicate buffering.php directly. have deal new file, initiate.php. when make request page "initiate" processing, have create event entry in event database table. then, have initiate.php return eventid created...not buffering.

turn buffering.php cron process looks through events table, finds new entries, , starts processing in background. if desired, can update row % complete, etc.

progressbar.php can receive eventid, query % complete in db , return value index.php, can show progress while waits cron process . when it's complete, redirect or load whatever complete data display user.

the main point need background process can pick event scripts using, nothing call index.php has wait entire process run-time.

this done messagequeue system, in-memory system memcache, or db table described...


Comments

Popular posts from this blog

php - failed to open stream: HTTP request failed! HTTP/1.0 400 Bad Request -

java - How to filter a backspace keyboard input -

java - Show Soft Keyboard when EditText Appears -