Re: RES: [PHP] Help Call Javascript Methods Inside PHP
I was surprised it didnt came up before. As Tedd said, try to ajax-up your javascript On 20/05/2008, tedd [EMAIL PROTECTED] wrote: At 11:41 AM -0300 5/20/08, Thiago Pojda wrote: That way you can conditionally send some JS to client, but running actual JS in PHP is not possible. While running JS inside of PHP is at best confusing, it is possible to use both php and javascript together. For example: You can use php to run javascript, right? And, you can use javascript and run php, right? So, all you need between the two is communication, right? Think of ajax. Here's an example: http://webbytedd.com/b/timed-php/ It just takes a little work. Cheers, tedd -- --- http://sperling.com http://ancientstones.com http://earthstones.com -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Help Call Javascript Methods Inside PHP
You missed what I meant. Suppose there is a piece of code like: script language-javascript function hello() { document.write hello; } /script I want to call that method inside PHP: ?php $c = hello(); echo $c; ? Hope you get it. On Tue, May 20, 2008 at 5:40 PM, Chetan Rane [EMAIL PROTECTED] wrote: Yea You can use the script tag in PHP Its like ?php phpcode ? script language=javascript src=soruce of the file type=text\javascript/ script language=javascript Funcyion() /script ?php phpcode ? This works Chetan Dattaram Rane Software Engineer -Original Message- From: Shelley [mailto:[EMAIL PROTECTED] Sent: Tuesday, May 20, 2008 3:06 PM To: PHP General list Subject: [PHP] Help Call Javascript Methods Inside PHP Hi all, How can I call a javascript method inside PHP? That is: Suppose there is a js file: http://someurl/somejs.js There are some js methods in that js file, I want to include that js into PHP and call its methods. Is it possible? If it is, how? Thank you very much. -- Regards, Shelley -- Regards, Shelley
Re: [PHP] Help Call Javascript Methods Inside PHP
Yea, of course. On Tue, May 20, 2008 at 5:44 PM, jose javier parra sanchez [EMAIL PROTECTED] wrote: Do you know that php runs on the server and that javascript runs on the client ? 2008/5/20 Shelley [EMAIL PROTECTED]: Hi all, How can I call a javascript method inside PHP? That is: Suppose there is a js file: http://someurl/somejs.js There are some js methods in that js file, I want to include that js into PHP and call its methods. Is it possible? If it is, how? Thank you very much. -- Regards, Shelley -- Regards, Shelley
Re: [PHP] Help Call Javascript Methods Inside PHP
Shelley wrote: Hi all, How can I call a javascript method inside PHP? That is: Suppose there is a js file: http://someurl/somejs.js There are some js methods in that js file, I want to include that js into PHP and call its methods. Is it possible? No. What you can do though is use PHP to send some HTML to the browser which calls Javascript methods. -- Richard Heyes In Cambridge? Employ me http://www.phpguru.org/cv ++ | Access SSH with a Windows mapped drive | |http://www.phpguru.org/sftpdrive| ++ -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] Help Call Javascript Methods Inside PHP
Hi all, How can I call a javascript method inside PHP? That is: Suppose there is a js file: http://someurl/somejs.js There are some js methods in that js file, I want to include that js into PHP and call its methods. Is it possible? If it is, how? Thank you very much. -- Regards, Shelley
Re: [PHP] Help Call Javascript Methods Inside PHP
On 5/20/08, Shelley [EMAIL PROTECTED] wrote: Hi all, How can I call a javascript method inside PHP? That is: Suppose there is a js file: http://someurl/somejs.js There are some js methods in that js file, I want to include that js into PHP and call its methods. Is it possible? If it is, how? Thank you very much. -- Regards, Shelley Hello, Its possible. I think you have to find seamonkey binding for php or you have to create it. There is javascript engine from mozilla. you can use that too. -- A. K. M. Mokaddim http://talk.cmyweb.net
RES: [PHP] Help Call Javascript Methods Inside PHP
What Richard meant was: /// FILE.PHP /// ?php $var = 123; if ($var 100){ ? script language=JavaScript alert('Bigger than 100'); /script ?php } ? /// EOF /// That way you can conditionally send some JS to client, but running actual JS in PHP is not possible. (Not sure about Jscript [script runat=server] tho, I believe it only runs on IIS) Atenciosamente, www.softpartech.com.br Thiago Henrique Pojda Desenvolvimento Web +55 41 3033-7676 [EMAIL PROTECTED] Excelência em Softwares Financeiros -Mensagem original- De: Richard Heyes [mailto:[EMAIL PROTECTED] Enviada em: terça-feira, 20 de maio de 2008 06:53 Para: Shelley Cc: PHP General list Assunto: Re: [PHP] Help Call Javascript Methods Inside PHP Shelley wrote: Hi all, How can I call a javascript method inside PHP? That is: Suppose there is a js file: http://someurl/somejs.js There are some js methods in that js file, I want to include that js into PHP and call its methods. Is it possible? No. What you can do though is use PHP to send some HTML to the browser which calls Javascript methods. -- Richard Heyes In Cambridge? Employ me http://www.phpguru.org/cv ++ | Access SSH with a Windows mapped drive | |http://www.phpguru.org/sftpdrive| ++ -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
RES: [PHP] Help Call Javascript Methods Inside PHP
Yeah, I just checked out and that runat=Server thingy is an asp thing. Atenciosamente, www.softpartech.com.br Thiago Henrique Pojda Desenvolvimento Web +55 41 3033-7676 [EMAIL PROTECTED] Excelência em Softwares Financeiros -Mensagem original- De: Thiago Pojda [mailto:[EMAIL PROTECTED] Enviada em: terça-feira, 20 de maio de 2008 11:41 Para: [EMAIL PROTECTED]; 'Shelley' Cc: 'PHP General list' Assunto: RES: [PHP] Help Call Javascript Methods Inside PHP What Richard meant was: /// FILE.PHP /// ?php $var = 123; if ($var 100){ ? script language=JavaScript alert('Bigger than 100'); /script ?php } ? /// EOF /// That way you can conditionally send some JS to client, but running actual JS in PHP is not possible. (Not sure about Jscript [script runat=server] tho, I believe it only runs on IIS) Atenciosamente, www.softpartech.com.br Thiago Henrique Pojda Desenvolvimento Web +55 41 3033-7676 [EMAIL PROTECTED] Excelência em Softwares Financeiros -Mensagem original- De: Richard Heyes [mailto:[EMAIL PROTECTED] Enviada em: terça-feira, 20 de maio de 2008 06:53 Para: Shelley Cc: PHP General list Assunto: Re: [PHP] Help Call Javascript Methods Inside PHP Shelley wrote: Hi all, How can I call a javascript method inside PHP? That is: Suppose there is a js file: http://someurl/somejs.js There are some js methods in that js file, I want to include that js into PHP and call its methods. Is it possible? No. What you can do though is use PHP to send some HTML to the browser which calls Javascript methods. -- Richard Heyes In Cambridge? Employ me http://www.phpguru.org/cv ++ | Access SSH with a Windows mapped drive | |http://www.phpguru.org/sftpdrive| ++ -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: RES: [PHP] Help Call Javascript Methods Inside PHP
At 11:41 AM -0300 5/20/08, Thiago Pojda wrote: That way you can conditionally send some JS to client, but running actual JS in PHP is not possible. While running JS inside of PHP is at best confusing, it is possible to use both php and javascript together. For example: You can use php to run javascript, right? And, you can use javascript and run php, right? So, all you need between the two is communication, right? Think of ajax. Here's an example: http://webbytedd.com/b/timed-php/ It just takes a little work. Cheers, tedd -- --- http://sperling.com http://ancientstones.com http://earthstones.com -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] Help with Javascript
First thanks with the help I got yesterday with php and javascript problem, I have a problem with javascript and I need to know if anyone know of a javascript mailing like this, so some strange reason if I add the tag taget to this line... a href=javascript:gotoAd() target=_top Any of my browser give me an error, but it I remove it work, but it's lost due to frames. I know this is a php question so if you can give me a javascript mailing that would be a BIG help. Payne -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Help with Javascript
Pablo, Ok, I have it the page called top.php right now, are you that I need to place this in my index.html? Payne Pablo Gosse wrote: Hi Payne. The problem here is indeed the target attribute. You say that if you remove the target attribute it works, but is lost due to frames. What exactly is it you're trying to do with the frames? The solution might be to embed the js function in the frame itself, and then access it via href=Javascript:parent.targetframe.document.function(); Hope that helps. Pablo. -Original Message- From: Payne [mailto:[EMAIL PROTECTED] Sent: Wednesday, November 12, 2003 9:48 AM To: [EMAIL PROTECTED] Subject: [PHP] Help with Javascript First thanks with the help I got yesterday with php and javascript problem, I have a problem with javascript and I need to know if anyone know of a javascript mailing like this, so some strange reason if I add the tag taget to this line... a href=javascript:gotoAd() target=_top Any of my browser give me an error, but it I remove it work, but it's lost due to frames. I know this is a php question so if you can give me a javascript mailing that would be a BIG help. Payne -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Help with Javascript
On Thursday 13 November 2003 01:47, Payne wrote: I know this is a php question so if you can give me a javascript mailing that would be a BIG help. Is it that hard to type javascript mailing list into your favourite search engine? -- Jason Wong - Gremlins Associates - www.gremlins.biz Open Source Software Systems Integrators * Web Design Hosting * Internet Intranet Applications Development * -- Search the list archives before you post http://marc.theaimsgroup.com/?l=php-general -- /* Wasting time is an important part of living. */ -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] Help with Javascript, Delete record from mysql using PHP
Hi all, I am having a problem with getting this to work properly. When a user select DELETE I want an alert to pop up and say HEY YOUR DELETING THIS. This portion is working properly. If you hit CANCEL the desired effect takes place NOTHING. But if you really want to cancel this record, it bombs out. I am not sure where to put the coding for this. Any one habve a quick answer for this. I would greatley appreciate it. Thank you in advance. the variable $conf_id is where I am having the problem html head script language=javascript function conf() { var x=confirm(Are you sure you want to DELETE this Entry ?) if (x) window.location(delete.php?id=$conf_id) else alert(No Deletions Made) } /script /head ? $db = mysql_pconnect(localhost, uname, upass); mysql_select_db(distributor_db, $db); $result = mysql_query(SELECT * FROM main,$db); echo table width=95% border=1 align=center; echo trtd width=22%bCompany/btd width=22%bName/btd width=22%bEmail/btd width=22%bPhone/btd width=22% colspan=3bcenterOptions/center/b/tr; while ($myrow = mysql_fetch_array($result)) { $conf_id = $myrow[user_id] echo trtd.$myrow[company].td.$myrow[fname]. .$myrow[lname].td.$myrow[email].td.$myrow[phone]; echo td align=centera href=\view.php?id=.$myrow [user_id].\View/a; echo td align=centera href=\update.php?id=.$myrow [user_id].\Edit/a; echo td align=centera href=javascript:onclick=conf ()Delete/a; } echo /table; ? /html Thank You Daniel Negrón Lotus Notes Administrator / Developer KB Electronics, Inc. 954.346.4900x122 http://www.kbelectronics.com -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] Help on JavaScript Windows with PHP
Hello all! I've wrote to scripts that use Javascript too. The idea is to have a parent window teste_popup.php4 and a child window pop.php4. When a link is clicked on the parent window, the child window will open. After the user enters information on the child window he must close it and that will update the parent window.possibility to me. But there's a little problem,though. The only browser that it works is MS IE. It does not work on Nestcape (Win or *NIX) or Konqueror (*NIX). If I try it on a different browser, say Netscape or Konqueror, when I click the main window to open the popup window it does work. The thing that does not work is when you click close on the popup window. It does not close the popup window and if I close the window it does not update the parent window. I've written two test PHP scripts teste_popup.php4 (the main window) and pop.php4 that I am including below. Maybe someone can help me out by pointing where it is wrong. teste_popup.php4 (parent window script) ?php // teste_popup.php4 print(html\n); print(head\n); //print(script type=\text/javascript\\n); print(script language=\JavaScript\!--\n); print(function newWin(urlLoc) {\n); print(_winName=\Janelateste\;\n); print(_info = \toolbar=no\;\n); print(_info += \,location=no\;\n); print(_info += \,directories=no\;\n); print(_info += \,status=yes\;\n); print(_info += \,menubar=no\;\n); print(_info += \,scrollbars=yes\;\n); print(_info += \,resizable=yes\;\n); print(_info += \,titlebar=no\;\n); print(_info += \,dependent=no\;\n); print(_info += \,channelmode=no\;\n); print(_info += \,height=480\;\n); print(_info += \,width=640\;\n); print(_info += \,left=200\;\n); print(_info += \,top=100\;\n); print(DispWin=window.open(urlLoc,_winName,_info);\n); print(} \n); print(//--/script\n); print(/head\n); print(body\n); print(p\n); print(Esse e um teste usando Javascript para montar as janelas\n); print(a parte de numero de operacoes, pecas, etc de garantia.\n); print(/p\n); print(b\n); print(Data : .date(d./.m./.Y. .H.:.i.:.s).\n); print(b\n); print(br\n); print(br\n); print(a href=\JavaScript:newWin('pop.php4?oper=1');\link/a\n); print(br\n); print(/body\n); print(/html\n); ? pop.php4 - child popup window ?php // pop.php4 print(html\n); print(head\n); //print(script type=\text/javascript\\n); print(script language=\JavaScript\!--\n); print(self.menubar.visible=false\n); print(self.tollbar.visible=false\n); print(self.locationbar.visible=false\n); print(self.personalbar.visible=false\n); print(self.statusbar.visible=false\n); print(function oldWin(urlLoc) {\n); print(returnwin=window.opener.navigate(urlLoc);\n); print(window.opener.focus();\n); print(window.close();\n); print(} \n); print(//--/script\n); print(/head\n); print(body onunload=\JavaScript:oldWin('teste_popup.php4?oper=1')\\n); print(b\n); print(Child window\n); print(/b\n); print(br\n); print(Parametro oper = .$HTTP_GET_VARS[oper].\n); print(br\n); print(a href=\JavaScript:oldWin('teste_popup.php4?oper=1')\Close e Update/a\n); print(br\n); print(/body\n); print(/html\n); ? Could anyone help me out to adapt it to any browser? Thank you very much and merry christmas, Carlos Fernando Scheidecker Antunes. Salt Lake City, Utah - USA. -- 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]
Re: [PHP] Help on JavaScript Windows with PHP
I don't know if this is it, but you may: 1. Replace print(returnwin=window.opener.navigate(urlLoc);\n); with print(window.opener.location='urlLoc';\n); 2. Try opening the pop-up widow with Netscape allowing the location input box to appear, click on Close e Update and, if it doesn't work, type javascript: in the location bow -- then check for errors reported by Netscape. 9 cases out of 10, if you solve the problem with Netscape, Konqueror will work as well. Please let me know of your progress - I'm curious what the problem is. Bogdan Carlos Fernando Scheidecker Antunes wrote: Hello all! I've wrote to scripts that use Javascript too. The idea is to have a parent window teste_popup.php4 and a child window pop.php4. When a link is clicked on the parent window, the child window will open. After the user enters information on the child window he must close it and that will update the parent window.possibility to me. -- 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]