By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
449,018 Members | 870 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 449,018 IT Pros & Developers. It's quick & easy.

invoke script without user action

P: n/a
Nube warning!

I have a PHP script that does some calculations of user input. Under
certain circumstances, I
would like to have a popup on the user's computer. Since PHP can not
do this on the client, I
thought I would have PHP load a 'popup' page which would contain the
javascript to do the
popup.

1) Is this the right way?

2) if this is the right way, how can I invoke the action without having
the user selecting a link on
the 'popup' page.

Thanks for any insight.

Dec 19 '05 #1
Share this Question
Share on Google+
6 Replies


P: n/a
ke*********@usa.com wrote:
I have a PHP script that does some calculations of user input. Under
certain circumstances, I would like to have a popup on the user's
computer. Since PHP can not do this on the client, I thought I would have
PHP load a 'popup' page which would contain the javascript to do the
popup. 1) Is this the right way?
Popups bad. Popups annoying. Avoid popups.
2) if this is the right way, how can I invoke the action without having
the user selecting a link on the 'popup' page.


Just put the window.open call inline rather then inside a function or event
handler ... but the majority of browsers come with popup blockers which
will stop that from working (since the technique is/was so popular with
advertisers).

--
David Dorward <http://blog.dorward.me.uk/> <http://dorward.me.uk/>
Home is where the ~/.bashrc is
Dec 19 '05 #2

P: n/a
OK,

instead of a popup, I will direct them to an information page. When
they press ok on this page, I'll put them back into the normal flow.

Currently, the code does something like:

User inputs data -> (several pieces of info passed in form: <phtml
file>?=<some data>

I would like to do:
User inputs data -> show warning -> continue to next page.

How can I keep track of the <some data> along the way?

Dec 19 '05 #3

P: n/a
ke*********@usa.com wrote:
User inputs data -> show warning -> continue to next page. How can I keep track of the <some data> along the way?


Include the data in the query string of the link.
Use a form.
Sessions.
Cookies.

--
David Dorward <http://blog.dorward.me.uk/> <http://dorward.me.uk/>
Home is where the ~/.bashrc is
Dec 19 '05 #4

P: n/a
Will I regret the fact that I used $_Session[''] data to do it?

Dec 19 '05 #5

P: n/a
ke*********@usa.com wrote:
Will I regret the fact that I used $_Session[''] data to do it?


To do what? http://www.safalra.com/special/googlegroupsreply/

(And using sessions could cause problems if the user happens to be working
in two windows/tabs at the same time and one workspace overwrites your
session variable mid-process.)

--
David Dorward <http://blog.dorward.me.uk/> <http://dorward.me.uk/>
Home is where the ~/.bashrc is
Dec 19 '05 #6

P: n/a
On 2005-12-19, ke*********@usa.com <ke*********@usa.com> wrote:
OK,

instead of a popup, I will direct them to an information page. When
they press ok on this page, I'll put them back into the normal flow.

Currently, the code does something like:

User inputs data -> (several pieces of info passed in form: <phtml
file>?=<some data>

I would like to do:
User inputs data -> show warning -> continue to next page.

How can I keep track of the <some data> along the way?


$_SESSION (read about it in the PHP manual)
or hidden fields if the amount of data is small.

Bye.
Jasen
Dec 21 '05 #7

This discussion thread is closed

Replies have been disabled for this discussion.