Jump to content

jayo

New Members
  • Posts

    3
  • Joined

  • Last visited

    Never

Profile Information

  • Gender
    Not Telling

jayo's Achievements

Newbie

Newbie (1/5)

0

Reputation

  1. I've this code: <?php $coi = new COM("Coi4ImplP.Coi4");       $empresas = $coi->Inicio("C:\Archivos de programa\ASPEL\ASPEL-COI 4.0");       $hresult=$coi->Empresa("2"); $ruta=$coi->Ruta; echo "$coi->Ruta<br>"; echo "$coi->Niveles<br>"; echo "$coi->Nombre<br>"; echo "$coi->Tipos<br>"; echo "$coi->Version<br>"; echo date("d/m/Y");//date("Y-m-d"); echo "\n"; echo "$ruta<br>"; print '<pre>\n'; print_r($coi); print '</pre>\n'; function rcuenta($vale){ echo "hola".$vale; echo "<br>"; } ?> <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN"   "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd"> <html xmlns="http://www.w3.org/1999/xhtml"> <head> <title>Otro ejemplo relacionando variables php</title> </head> <body>   <?php echo "$coi->Ruta<br>"; ?>   <?php echo "rcuenta(\"HOLA\")<br>"; ?>   <?php rcuenta("OTRO"); ?>   <?php echo "<br>"; ?>   <input type="text" name="ruta" size="10" value="<?php echo $ruta;?>">   <input type="button" value="REGISTRA" name="Registra" onclick="limpia()"><br /> <script language="javascript" type="text/javascript"> function limpia(){ alert($ruta); } </script> </body> </html> The output: C:\Coi\Fycampo\HUGO\Datos\ 4 3 3 3 FYCAMPO S.A DE C.V Dr Ig Eg SERVIDOR COIW4, VERSION 1.0 PARA FYCAMPO, S.A. DE C.V. 19/01/2007 C:\Coi\Fycampo\HUGO\Datos\ \ncom Object \n C:\Coi\Fycampo\HUGO\Datos\ rcuenta("HOLA") holaOTRO in the input box is the variable $ruta, that's OK, but when I press the button 'REGISTRA'  the page gets an error. How can I get in a javascript function a Com variable like this? Thank you in advance.
  2. I have a COM Server that create an object with PHP, when from the html input sentence using onchange, goes to a javascript function, as parameter the input value, within this value i want to get from the COM Server an answer. From PHP the object is created with new, as: $coi = new COM("Coi4ImplP.Coi4"); and I can get from the server the answer as: $hresult=$coi->Empresa($_POST["empresa"]); $ruta=$coi->Ruta(); $niveles=$coi->Niveles(); $nombree=$coi->Nombre(); but in the input area from the html page in the from like: <td><input type="text" size="25" name="cuenta[<? echo($n); ?>]" value="<? echo($cuenta[$n]); ?>" onChange="<? echo rdes($cuenta[$n]);?>"></td> the function is:     function  rdes(cta){ var <?php global $coi; $k=$coi->Ruta(); echo('$k='.$k); ?>; alert($k); } I get an error in the page, if I change $k=$coi->Ruta(); to $k=5; it works fine. Can somebody help me please? Thank you in advance.
×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.