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<?
$handle = fopen("conf.csv", "r"); while (($data = fgetcsv($handle, 1000, ";")) !== FALSE) { $ubicacion=$data[0];
$usuario=$data[1];
$contraseña=$data[2];
$base=$data[3];
}
?><?
if(isset($_SESSION) && $_SESSION["mazo"]=="1"){ } else {
if(isset($_SESSION) && $_SESSION["mazo"]=="2" or
$_SESSION["mazo"]=="4"){ ?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<link rel="shortcut icon" href="img/ppym.ico">
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>Formulario de dictamen MAZO</title>
<script language="JavaScript" src="Scripts/calendar1.js"></script>
</head>
<body>
<div id="contenido" style="width: 100%;">
<div align="center">
<table width="100%" border="0" cellspacing="3" cellpadding="0">
<tr>
<td width="50%" valign="top"><table width="100%" height="100%" border="1" cellpadding="6" cellspacing="0" bordercolor="#000000" bgcolor="#FFFFFF" class="contentarea1">
<tr>
<td valign="top"><div align="center">
<?
echo'<form onsubmit="return validar_formulario()" name="form1" id="form1" method="post">';
?>
<table width="100%" border="0" cellspacing="3" cellpadding="0">
<tr>
<td colspan="2" width="50%" align="middle" bgcolor="#eeeeee"><strong>Cliente Existente:</strong></td></tr>
<tr>
<td width="50%" valign="top"><table width="100%" border="0" cellspacing="3" cellpadding="3">
<tr><td bgcolor="#eeeeee" align="right" ><b>Alias: <b></td><td bgcolor="#eeeeee" align="left" colspan="2" >
<select name="clienteant" id="clienteant" >
<?
echo'<option value="-">Selecciona...</option>';
$dp = mysqli_connect("$ubicacion", "$usuario", "$contraseña", "$base"); $resultali = mysqli_query($dp,"SELECT * FROM mazo_dic_cli_2018 order by id desc"); echo'<option value="'.$rowali['id'].'">'.$rowali['alias'].'</option>';
}}
?>
</select><input type="button" name="Submit3" value="ACEPTAR" onclick= "document.form1.action = 'crear_dic_mazo_a.php'; document.form1.submit()"/>
</td></tr>
<?if(isset($_POST["clienteant"])){ $result = mysql_query("SELECT * from mazo_dic_cli_2018 where id = '$_POST[clienteant]'",$dp); $Fs3=$Fs2[2]."-".$Fs2[1]."-".$Fs2[0];
$Fd3=$Fd2[2]."-".$Fd2[1]."-".$Fd2[0];
$resultg = mysql_query("SELECT * from giro where id = '$Gir'",$dp); }
?>
<tr>
<td colspan="2" width="50%" align="middle" bgcolor="#eeeeee"><strong>Cliente Nuevo:</strong></td></tr>
<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>
<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>
<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>
<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>
<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>
<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>
<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>
<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>
<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>
<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>
<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>
<tr><td bgcolor="#eeeeee" align="right" ><b>Giro: <b></td><td bgcolor="#eeeeee" align="left" colspan="2" >
<select name="giro" id="giro" >
<?
if(isset($_POST["clienteant"])){echo'<option value='.$Gir.'>'.$Iro.'</option>';}else{ echo'<option value="-">Selecciona giro...</option>';}
$dp = mysqli_connect("$ubicacion", "$usuario", "$contraseña", "$base"); $resultgiro = mysqli_query($dp,"SELECT * FROM giro order by id"); echo'<option value="'.$rowgiro['id'].'">'.$rowgiro['giro'].'</option>';
}}
?>
</select></td></tr>
<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>
<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>
<tr><td bgcolor="#eeeeee" align="right" ><b>Basculas: <b></td><td bgcolor="#eeeeee" align="left" colspan="2" >
<select name="inst" id="inst" >
<option value=0>Selecciona...</option>
<option value=1>1 Bascula</option>
<option value=2>2 Basculas</option>
<option value=3>3 Basculas</option>
<option value=4>4 Basculas</option>
<option value=5>5 Basculas</option></select>
</td></tr>
<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>
<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>
<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()">
<option value=0>SEGUN FACTURA</option>
<option value=1>Indicar Costo</option>
</select>—> $<input name="costo" type="text" id="costo" size="3" disabled/>
</td></tr>
</table></td>
</tr>
</table>
<input type="button" name="Submit" value="ACEPTAR" onclick= "document.form1.action = 'process_dic_mazo.php?modulo=cliente&caso=nuevo'; document.form1.submit()"/>
<input type="reset" name="Submit2" value="BORRAR" />
</div></td>
</tr>
</table></td>
</tr>
</table>
</form>
<script language="JavaScript">
var cal01 = new calendar1(document.forms['form1'].elements['fecha_s']);
cal01.year_scroll = true;
</script>
<script language="JavaScript">
var cal02 = new calendar1(document.forms['form1'].elements['fecha_d']);
cal02.year_scroll = true;
</script>
</div>
</div>
</body>
</html>
<?
}}
?>