Re: Calling a PHP function since javascript:onclick function..

From: Date: Thu, 21 Sep 2000 19:20:53 +0000
Subject: Re: Calling a PHP function since javascript:onclick function..
References: 1  Groups: php.db 
Request: Send a blank email to php-db+get-3030@lists.php.net to get a copy of this message
There is no way of calling php functions from JavaScript. JavaScript is executed on the client, php is executed on the client, before the page (document) is loaded. You can only call entyre scripts through JavaScript "window.location" property (window.location = "script.php" ). I hope this helps. Jayme. http://www.conex.com.br/jjeffman -----Mensagem Original----- De: Javier Morquecho Morquecho <jmorquec@cedetel.com.mx> Para: <php-db@lists.php.net> Enviada em: quinta-feira, 21 de setembro de 2000 13:16 Assunto: [PHP-DB] Calling a PHP function since javascript:onclick function.. > Hi you all.. > > I have worked about this, but I can't find the solution, help !! > > How can I call a PHP function since a javascript:onclick function ??.. > > can I do something like ?: > > <? > function save_fields() > { > <? > <script language=javascript> > echo "$f1=document.x.field1"; > echo "$f2=document.x.field2"; > </script> > $sql="insert into table1 values($f1, $f2)"; > $result = pg_Exec($database, $sql); > } > ?> > <body> > <form name=x> > <? > $database = pg_Connect("...."); > echo "<input type=text name=field1> "; > echo "<input type=text name=field2>"; > echo "<input type=button name=x2 onclick=save_fields()></br>"; > ?> > </form> > > > Thanks in advance... > > Ing. J@vier Morquecho Morquecho > Tel : 177-10-87 > Cel : 177-00-87 > e-mail : jmorquec@cedetel.com.mx > e-movil : 5281770087@emovil.cedetel.com.mx > Home Cedetel : http://www.cedetel.com.mx > > "#define QUESTION ((bb) || !(bb)) // Shakespeare" > > > > -- > PHP Database Mailing List (http://www.php.net/) > To unsubscribe, e-mail: php-db-unsubscribe@lists.php.net > For additional commands, e-mail: php-db-help@lists.php.net > To contact the list administrators, e-mail: php-list-admin@lists.php.net >

« previous php.db (#3030) next »