Ver Mensaje Individual
  #1 (permalink)  
Antiguo 19/11/2019, 22:52
camaron2004
 
Fecha de Ingreso: diciembre-2009
Mensajes: 128
Antigüedad: 14 años, 4 meses
Puntos: 0
En local funciona, en linea no

Saludos a todos. Tengo el siguiente codigo que en si es un formulario, pero la la idea es que cuando en el select se escoja un registro ya existente en la tabla rellene los campo, en local me funciona bien, pero al subir al servidor ya no funciona. Espero alguien me pueda ayudar.
Código PHP:
Ver original
  1. <?
  2. $handle = fopen("conf.csv", "r");
  3. while (($data = fgetcsv($handle, 1000, ";")) !== FALSE) {
  4.         $ubicacion=$data[0];
  5.         $usuario=$data[1];
  6.         $contraseña=$data[2];
  7.         $base=$data[3];
  8.  
  9. }
  10. fclose($handle);
  11. ?><?
  12. if(isset($_SESSION) && $_SESSION["mazo"]=="1"){
  13. header("location:login.php");
  14. } else {
  15. if(isset($_SESSION) && $_SESSION["mazo"]=="2" or $_SESSION["mazo"]=="4"){
  16. ?>
  17. <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
  18. <html xmlns="http://www.w3.org/1999/xhtml">
  19. <head>
  20. <link rel="shortcut icon" href="img/ppym.ico">
  21.  
  22. <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
  23. <title>Formulario de dictamen MAZO</title>
  24. <script language="JavaScript" src="Scripts/calendar1.js"></script>
  25. </head>
  26. <body>
  27. <div id="contenido" style="width: 100%;">
  28. <div align="center">
  29.   <table width="100%" border="0" cellspacing="3" cellpadding="0">
  30.     <tr>
  31.       <td width="50%" valign="top"><table width="100%" height="100%" border="1" cellpadding="6" cellspacing="0" bordercolor="#000000" bgcolor="#FFFFFF" class="contentarea1">
  32.         <tr>
  33.           <td valign="top"><div align="center">
  34.            <?
  35. echo'<form onsubmit="return validar_formulario()" name="form1" id="form1" method="post">';
  36.  
  37. ?>
  38.               <table width="100%" border="0" cellspacing="3" cellpadding="0">
  39.               <tr>
  40.                         <td colspan="2" width="50%" align="middle" bgcolor="#eeeeee"><strong>Cliente Existente:</strong></td></tr>
  41.               <tr>
  42.                   <td width="50%" valign="top"><table width="100%" border="0" cellspacing="3" cellpadding="3">
  43.                           <tr><td bgcolor="#eeeeee" align="right"  ><b>Alias:  <b></td><td bgcolor="#eeeeee" align="left" colspan="2" >
  44. <select name="clienteant" id="clienteant" >
  45.  
  46.               <?
  47.  
  48.               echo'<option value="-">Selecciona...</option>';
  49. $dp = mysqli_connect("$ubicacion", "$usuario", "$contraseña", "$base");
  50. $resultali = mysqli_query($dp,"SELECT * FROM mazo_dic_cli_2018 order by id desc");
  51. if (mysqli_num_rows($resultali)){
  52. while ($rowali = @mysqli_fetch_array($resultali)) {
  53. echo'<option value="'.$rowali['id'].'">'.$rowali['alias'].'</option>';
  54. }}
  55.  
  56.           ?>
  57.             </select><input type="button" name="Submit3" value="ACEPTAR"  onclick= "document.form1.action = 'crear_dic_mazo_a.php'; document.form1.submit()"/>
  58. </td></tr>
  59. <?if(isset($_POST["clienteant"])){
  60. $dp = mysql_connect("$ubicacion", "$usuario", "$contraseña");
  61. mysql_select_db("$base", $dp);
  62. $result = mysql_query("SELECT * from mazo_dic_cli_2018 where id = '$_POST[clienteant]'",$dp);
  63. $Raz=mysql_result($result,0,"razon");
  64. $Ali=mysql_result($result,0,"alias");
  65. $Com=mysql_result($result,0,"comercial");
  66. $Dom=mysql_result($result,0,"domicilio");
  67. $Col=mysql_result($result,0,"colonia");
  68. $Mun=mysql_result($result,0,"municipio");
  69. $Est=mysql_result($result,0,"estado");
  70. $Cod=mysql_result($result,0,"codigo");
  71. $Rfc=mysql_result($result,0,"rfc");
  72. $Gir=mysql_result($result,0,"giro");
  73. $Con=mysql_result($result,0,"contacto");
  74. $Car=mysql_result($result,0,"cargo");
  75. $Lat=mysql_result($result,0,"lat");
  76. $Lon=mysql_result($result,0,"lon");
  77. $Apo=mysql_result($result,0,"apoyo");
  78. $Fs=mysql_result($result,0,"fec_s");
  79. $Fs2=explode("-",$Fs);
  80. $Fs3=$Fs2[2]."-".$Fs2[1]."-".$Fs2[0];
  81. $Fd=mysql_result($result,0,"fec_d");
  82. $Fd2=explode("-",$Fd);
  83. $Fd3=$Fd2[2]."-".$Fd2[1]."-".$Fd2[0];
  84.  
  85. $dp = mysql_connect("$ubicacion", "$usuario", "$contraseña");
  86. mysql_select_db("$base", $dp);
  87. $resultg = mysql_query("SELECT * from giro where id = '$Gir'",$dp);
  88. $Iro=mysql_result($resultg,0,"giro");
  89. }
  90. ?>
  91.                                             <tr>
  92.                         <td colspan="2" width="50%" align="middle" bgcolor="#eeeeee"><strong>Cliente Nuevo:</strong></td></tr>
  93. <tr><td bgcolor="#eeeeee" align="right"  ><b>Fecha de Solicitud:  <b></td><td bgcolor="#eeeeee" align="left" colspan="2" ><input name="fecha_s" type="text" id="fecha_s" size="10" value="<? echo"$Fs3";?>" /><a href="javascript:cal01.popup();" onblur="javascript:fecha()"><img src="img/cal.gif" width="16" height="16" border="0"/></a></td></tr>
  94. <tr><td bgcolor="#eeeeee" align="right"  ><b>Fecha de Verificacion:  <b></td><td bgcolor="#eeeeee" align="left" colspan="2" ><input name="fecha_d" type="text" id="fecha_d" size="10" value="<? echo"$Fd3";?>" /><a href="javascript:cal02.popup();"><img src="img/cal.gif" width="16" height="16" border="0"/></a></td></tr>
  95. <tr><td bgcolor="#eeeeee" align="right"  ><b>Razon Social:  <b></td><td bgcolor="#eeeeee" align="left" colspan="2" ><input name="razon" type="text" id="razon" size="90" value="<? echo"$Raz";?>" /></td></tr>
  96. <tr><td bgcolor="#eeeeee" align="right"  ><b>Alias:  <b></td><td bgcolor="#eeeeee" align="left" colspan="2" ><input name="alias" type="text" id="alias" size="90" value="<? echo"$Ali";?>" /></td></tr>
  97. <tr><td bgcolor="#eeeeee" align="right"  ><b>Nombre Comercial:  <b></td><td bgcolor="#eeeeee" align="left" colspan="2" ><input name="comercial" type="text" id="comercial" size="90" value="<? echo"$Com";?>" /></td></tr>
  98. <tr><td bgcolor="#eeeeee" align="right"  ><b>Calle y numero:  <b></td><td bgcolor="#eeeeee" align="left" colspan="2" ><input name="domicilio" type="text" id="domicilio" size="90" value="<? echo"$Dom";?>" /></td></tr>
  99. <tr><td bgcolor="#eeeeee" align="right"  ><b>Colonia:  <b></td><td bgcolor="#eeeeee" align="left" colspan="2" ><input name="colonia" type="text" id="colonia" size="90" value="<? echo"$Col";?>" /></td></tr>
  100. <tr><td bgcolor="#eeeeee" align="right"  ><b>Municipio:  <b></td><td bgcolor="#eeeeee" align="left" colspan="2" ><input name="municipio" type="text" id="municipio" size="90" value="<? echo"$Mun";?>" /></td></tr>
  101. <tr><td bgcolor="#eeeeee" align="right"  ><b>Estado:  <b></td><td bgcolor="#eeeeee" align="left" colspan="2" ><input name="estado" type="text" id="estado" size="90" value="<? echo"$Est";?>" /></td></tr>
  102. <tr><td bgcolor="#eeeeee" align="right"  ><b>Codigo Postal:  <b></td><td bgcolor="#eeeeee" align="left" colspan="2" ><input name="cp" type="text" id="cp" size="10" value="<? echo"$Cod";?>" /></td></tr>
  103. <tr><td bgcolor="#eeeeee" align="right"  ><b>RFC:  <b></td><td bgcolor="#eeeeee" align="left" colspan="2" ><input name="rfc" type="text" id="rfc" size="15" value="<? echo"$Rfc";?>" /></td></tr>
  104. <tr><td bgcolor="#eeeeee" align="right"  ><b>Giro:  <b></td><td bgcolor="#eeeeee" align="left" colspan="2" >
  105. <select name="giro" id="giro" >
  106.  
  107.               <?
  108. if(isset($_POST["clienteant"])){echo'<option value='.$Gir.'>'.$Iro.'</option>';}else{
  109.               echo'<option value="-">Selecciona giro...</option>';}
  110. $dp = mysqli_connect("$ubicacion", "$usuario", "$contraseña", "$base");
  111. $resultgiro = mysqli_query($dp,"SELECT * FROM giro order by id");
  112. if (mysqli_num_rows($resultgiro)){
  113. while ($rowgiro = @mysqli_fetch_array($resultgiro)) {
  114. echo'<option value="'.$rowgiro['id'].'">'.$rowgiro['giro'].'</option>';
  115. }}
  116.  
  117.           ?>
  118.             </select></td></tr>
  119. <tr><td bgcolor="#eeeeee" align="right"  ><b>Contacto:  <b></td><td bgcolor="#eeeeee" align="left" colspan="2" ><input name="contacto" type="text" id="contacto" size="90" value="<? echo"$Con";?>" /></td></tr>
  120. <tr><td bgcolor="#eeeeee" align="right"  ><b>Cargo:  <b></td><td bgcolor="#eeeeee" align="left" colspan="2" ><input name="cargo" type="text" id="cargo" size="90" value="<? echo"$Car";?>" /></td></tr>
  121. <tr><td bgcolor="#eeeeee" align="right"  ><b>Basculas:  <b></td><td bgcolor="#eeeeee" align="left" colspan="2" >
  122. <select name="inst" id="inst" >
  123. <option value=0>Selecciona...</option>
  124. <option value=1>1 Bascula</option>
  125. <option value=2>2 Basculas</option>
  126. <option value=3>3 Basculas</option>
  127. <option value=4>4 Basculas</option>
  128. <option value=5>5 Basculas</option></select>
  129. </td></tr>
  130. <tr><td bgcolor="#eeeeee" align="right"  ><b>Latitud:  <b></td><td bgcolor="#eeeeee" align="left" colspan="2" ><input name="lat" type="text" id="lat" size="10" value="<? echo"$Lat";?>" /></td></tr>
  131. <tr><td bgcolor="#eeeeee" align="right"  ><b>Longitud:  <b></td><td bgcolor="#eeeeee" align="left" colspan="2" ><input name="lon" type="text" id="lon" size="10" value="<? echo"$Lon";?>" /></td></tr>
  132. <tr><td bgcolor="#eeeeee" align="right"  ><b>Costo del servicio Total:  <b></td><td bgcolor="#eeeeee" align="left" colspan="2" ><select name="fac" id="fac" onclick="javascript:cos()">
  133. <option value=0>SEGUN FACTURA</option>
  134. <option value=1>Indicar Costo</option>
  135. </select>—>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;$<input name="costo" type="text" id="costo" size="3" disabled/>
  136. </td></tr>
  137.  
  138.                   </table></td>
  139.                 </tr>
  140.               </table>
  141. <input type="button" name="Submit" value="ACEPTAR"  onclick= "document.form1.action = 'process_dic_mazo.php?modulo=cliente&caso=nuevo'; document.form1.submit()"/>
  142.   &nbsp;
  143.   <input type="reset" name="Submit2" value="BORRAR"  />
  144.  
  145.           </div></td>
  146.         </tr>
  147.       </table></td>
  148.       </tr>
  149.   </table>
  150.  
  151.   </form>
  152.   <script language="JavaScript">
  153. var cal01 = new calendar1(document.forms['form1'].elements['fecha_s']);
  154. cal01.year_scroll = true;
  155. </script>
  156. <script language="JavaScript">
  157. var cal02 = new calendar1(document.forms['form1'].elements['fecha_d']);
  158. cal02.year_scroll = true;
  159. </script>
  160. </div>
  161. </div>
  162. </body>
  163. </html>
  164.  
  165. <?
  166. }}
  167. ?>