[PHP] Invoke PHP script from onLoad handler?
Sorry if this has come up before. I want to update a select list from a mySql database whenever the browser window gets the focus. This is because I anticipate that the user will frequently use a second window to make additions to the database that holds the list values while filling in the form, and I want those additions to be in the select list when the user returns. At present I have PHP querying the db before I output the body tag, and an onLoad() handler passes the returned records to a Javascript which populates the list box with the query results, but I have only figured out how to query the db when the page initially loads. I really need to query the db and invoke the Javascript every time the window gets focus. So, I guess my question is twofold: can I invoke a php function with an onLoad handler, and if so, how can I have onLoad do both things - run the php function to query the database, then run the Javascript to populate the list box? Or is there another way? TIA, Chuck Mayo -- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED]
Re: [PHP] Invoke PHP script from onLoad handler?
OK, I've gone back through the archives and now understand the situation with client- and server-side. I just wasn't thinking it through. Spawning a window to let PHP query the db and somehow passing returned values back to the parent window is something I could do, I suppose, but it seems that what I and the other zillion people who keep asking the same question need is a way to get to our databases using a client-side technology like Javascript. I recognize the shortcomings of client-side stuff like compatility issues and on/off preferences and in this case am willing to let the user take some reponsibility for his browsing experience. Now I'm completely off-topic, but does anyone have any ideas regarding database access with Javascript, perhaps by having JS run a shell or perl script? How would JS get the values back? Something like function getdb () { var mylist = execute.some.remote.program(./getmysqldata.pl); } With all the traffic on this type of request, I'm surprised the FAQ doesn't take up the subject. Thanks, Chuck - Original Message - You *can* have a JavaScript handler invoke PHP -- but it requires accessing a URL and waiting for the web-server to respond, so your response time will not be so hot. I'm afraid I don't recall how, but it has been posted here before... -- Visit the Zend Store at http://www.zend.com/store/ Wanna help me out? Like Music? Buy a CD: http://l-i-e.com/artists.htm Volunteer a little time: http://chatmusic.com/volunteer.htm - Original Message - From: Chuck Mayo <[EMAIL PROTECTED]> Newsgroups: php.general Sent: Friday, January 26, 2001 10:10 AM Subject: [PHP] Invoke PHP script from onLoad handler? > Sorry if this has come up before. > > I want to update a select list from a mySql database whenever the > browser window gets the focus. This is because I anticipate that the > user will frequently use a second window to make additions to the > database that holds the list values while filling in the form, and I > want those additions to be in the select list when the user returns. > > At present I have PHP querying the db before I output the body tag, and > an onLoad() handler passes the returned records to a Javascript which > populates the list box with the query results, but I have only figured > out how to query the db when the page initially loads. I really need to > query the db and invoke the Javascript every time the window gets focus. > > So, I guess my question is twofold: can I invoke a php function with an > onLoad handler, and if so, how can I have onLoad do both things - run > the php function to query the database, then run the Javascript to > populate the list box? Or is there another way? > > TIA, > Chuck Mayo -- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED]
Re: [PHP] Invoke PHP script from onLoad handler?
This is an interesting idea - I hadn't considered having the second window be subordinant to the first, and really didn't even know I could pass data between windows. I'll play with this, it might work out. Thanks, Chuck Jonathan Sharp wrote: > I wrote a browser based application (yes it is an application!) (but I can't > let you see it cause it's propriatary technology) but the client side was > javascript and I had PHP save the data and read data... > > I won't go into detail, but basically I had PHP print JavaScript, and then > have a variable in the main window that the child window would save the new > data to... > > for example, have the javascript (which PHP generates) be something like > > var DATAARY = new Array(); > DATAARY[0] = 'Some data'; > DATAARY[1] = 'Some data'; > DATAARY[2] = 'Some data'; > DATAARY[3] = 'Some data'; > window.parent.document.MAINDATAARY = DATAARY; > > It was something to that extent, it works quite nicely, and it definetly > pushes the limits of the technology used. > > -Jonathan Sharp > > Director of Technology - Imprev Inc. > Renwick Development Group - Flyerware > http://www.flyerware.com/ > Phone: (425)688-9200 > Cell: (425)766-1398 > EPage: [EMAIL PROTECTED] > > -Original Message- > From: Chuck Mayo [mailto:[EMAIL PROTECTED]] > Sent: Saturday, January 27, 2001 4:05 PM > To: [EMAIL PROTECTED] > Subject: Re: [PHP] Invoke PHP script from onLoad handler? > > OK, I've gone back through the archives and now understand the situation > with client- and server-side. I just wasn't thinking it through. > > Spawning a window to let PHP query the db and somehow passing returned > values back to the parent window is something I could do, I suppose, but > it seems that what I and the other zillion people who keep asking the > same question need is a way to get to our databases using a client-side > technology like Javascript. > > I recognize the shortcomings of client-side stuff like compatility > issues and on/off preferences and in this case am willing to let the > user take some reponsibility for his browsing experience. > > Now I'm completely off-topic, but does anyone have any ideas regarding > database access with Javascript, perhaps by having JS run a shell or > perl script? How would JS get the values back? Something like > > function getdb () { >var mylist = execute.some.remote.program(./getmysqldata.pl); >} > > With all the traffic on this type of request, I'm surprised the FAQ > doesn't take > up the subject. > > Thanks, > Chuck > > - Original Message - > You *can* have a JavaScript handler invoke PHP -- but it requires > accessing > a URL and waiting for the web-server to respond, so your response time > will > not be so hot. > > I'm afraid I don't recall how, but it has been posted here before... > > -- > Visit the Zend Store at http://www.zend.com/store/ > Wanna help me out? Like Music? Buy a CD: http://l-i-e.com/artists.htm > Volunteer a little time: http://chatmusic.com/volunteer.htm > - Original Message - > From: Chuck Mayo <[EMAIL PROTECTED]> > Newsgroups: php.general > Sent: Friday, January 26, 2001 10:10 AM > Subject: [PHP] Invoke PHP script from onLoad handler? > > > Sorry if this has come up before. > > > > I want to update a select list from a mySql database whenever the > > browser window gets the focus. This is because I anticipate that the > > user will frequently use a second window to make additions to the > > database that holds the list values while filling in the form, and I > > want those additions to be in the select list when the user returns. > > > > At present I have PHP querying the db before I output the body tag, > and > > an onLoad() handler passes the returned records to a Javascript which > > populates the list box with the query results, but I have only figured > > > out how to query the db when the page initially loads. I really need > to > > query the db and invoke the Javascript every time the window gets > focus. > > > > So, I guess my question is twofold: can I invoke a php function with > an > > onLoad handler, and if so, how can I have onLoad do both things - run > > the php function to query the database, then run the Javascript to > > populate the list box? Or is there another way? > > > > TIA, > > Chuck Mayo > > -- > PHP General Mailing List (http://www.php.net/) > To unsubscribe, e-mail: [EMAIL PROTECTED] > For additional commands, e-mail: [EMAIL PROTECTED] > To contact the list administrators, e-mail: [EMAIL PROTECTED] > > -- > PHP General Mailing List (http://www.php.net/) > To unsubscribe, e-mail: [EMAIL PROTECTED] > For additional commands, e-mail: [EMAIL PROTECTED] > To contact the list administrators, e-mail: [EMAIL PROTECTED] -- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED]
[PHP] VIRUS ON LIST?
I don't want to be an alarmist, but wanted to give everyone a heads-up. Our firewall at corporate scrubbed a virus from a mail sent to the php-db list from "Angel2 Gabriel Lena Valega". The virus was in an attachment named "Emanuel.exe" and the message subject was "i need help with odbc!" John Coonrod wrote: > Right. That's what I saw here also: a virus attachment from Angel2 Gabriel > Lena Valega in Peru > > = Original Message from Chuck Mayo <[EMAIL PROTECTED]> at 1/29/01 6:17 pm > >Virus in this mail? > > > >Angel2 Gabriel Lena Valega wrote: > > > >> -- Virus Warning Message (on the network) > >> > >> Found virus TROJ_NAVIDAD.E in file Emanuel.exe > >> The file is deleted. > >> > >> - > >> > >> > >> > >> -- Virus Warning Message (on the network) > >> > >> Emanuel.exe is removed from here because it contains a virus. > >> > >> - > > > > > >-- > >PHP Database Mailing List (http://www.php.net/) > >To unsubscribe, e-mail: [EMAIL PROTECTED] > >For additional commands, e-mail: [EMAIL PROTECTED] > >To contact the list administrators, e-mail: [EMAIL PROTECTED] > > > Dr. John Coonrod, Vice President, [EMAIL PROTECTED] > The Hunger Project, 15 East 26th Street, NY, NY 10010 www.thp.org -- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED]
[PHP] Preserve variables between page loads?
This may have crossed the list a bazillion times, but I couldn't really find anything appropriate in the archives... maybe I just didn't look hard enough. In a MySQL app, I have the usual row of paging links at the bottom of the page and need to pass to the next iteration more variables than I can comfortably url-encode in the hyperlink. If all these paging links were submit buttons I could pass anything I wanted in hidden form fields, but since they're hyperlinks I don't seem to have that option. Is there a way to selectively preserve variables between iterations? Something like variables that are global to PHP, as opposed to being global within the script? -- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED]
Re: [PHP] Preserve variables between page loads?
Sounds like just what I need. Thanks, Ankur & Maxim. Ankur Verma wrote: > try using session variables. > > take a look at phplib if you are using PHP3 or > > http://www.php.net/manual/en/ref.session.php > > if you are using PHP4 > > hope that helps > > Ankur Verma > HCL Technologies > A1CD, Sec -16 > Noida, UP > India > > - Original Message - > From: "Chuck Mayo" <[EMAIL PROTECTED]> > To: <[EMAIL PROTECTED]> > Sent: Monday, February 12, 2001 10:53 AM > Subject: [PHP] Preserve variables between page loads? > > > This may have crossed the list a bazillion times, but I couldn't > really > find > > anything appropriate in the archives... maybe I just didn't look hard > enough. > > > > In a MySQL app, I have the usual row of paging links at the bottom of > the > page > > and need to pass to the next iteration more variables than I can > comfortably > > url-encode in the hyperlink. If all these paging links were submit > buttons > I > > could pass anything I wanted in hidden form fields, but since they're > > hyperlinks I don't seem to have that option. > > > > Is there a way to selectively preserve variables between iterations? > Something > > like variables that are global to PHP, as opposed to being global > within > the > > script? > > > > > > -- > > PHP General Mailing List (http://www.php.net/) > > To unsubscribe, e-mail: [EMAIL PROTECTED] > > For additional commands, e-mail: [EMAIL PROTECTED] > > To contact the list administrators, e-mail: > [EMAIL PROTECTED] > > -- > PHP General Mailing List (http://www.php.net/) > To unsubscribe, e-mail: [EMAIL PROTECTED] > For additional commands, e-mail: [EMAIL PROTECTED] > To contact the list administrators, e-mail: [EMAIL PROTECTED] -- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED]