Foros del Web » Programando para Internet » PHP »

PHP OO LLenar texbox con datos de MySQL

Estas en el tema de LLenar texbox con datos de MySQL en el foro de PHP en Foros del Web. Hola quiero que me ayuden necesito llenar los datos de acuerdo ah una base existente aqui la un demo online [URL="http://reyesdelcamino.org/pedido/pedidos.php"]http://reyesdelcamino.org/pedido/pedidos.php[/URL] aqui en codigo Código ...
  #1 (permalink)  
Antiguo 22/08/2013, 17:15
Avatar de jose29di  
Fecha de Ingreso: agosto-2013
Mensajes: 1
Antigüedad: 10 años, 8 meses
Puntos: 0
Pregunta LLenar texbox con datos de MySQL

Hola quiero que me ayuden necesito llenar los datos de acuerdo ah una base existente

aqui la un demo online
[URL="http://reyesdelcamino.org/pedido/pedidos.php"]http://reyesdelcamino.org/pedido/pedidos.php[/URL]

aqui en codigo

Código PHP:
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head>
<title>MEGAPLAST S.A.: Haga sus pedidos aqui!</title>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
<style type="text/css">
<!--
body {
  margin-left: 0px;
  margin-top: 0px;
  margin-right: 0px;
  margin-bottom: 0px;
}
body,td,th {
  font-size: 14px;
  font-family: Trebuchet MS, Arial, Helvetica, sans-serif;
}
.trebu {
  font-family: Trebuchet MS, Arial, Helvetica, sans-serif;
}
-->
#div_box{
color:black;
margin-left:20px;
height:auto;
animation:alternate;
font-family:"Comic Sans MS", cursive;
font-style:italic;
font-size-adjust:inherit;
margin: auto; marquee-style:scroll;
}
#div_boxx{
color:red;
margin-left:25px;
}
</style>
<script type="text/javascript">
function disable()
  {
  document.getElementById("habi2").disabled=false
  document.getElementById("habi").disabled=false
  document.getElementById("2").disabled=true
  document.getElementById("3").disabled=true
  document.getElementById("4").disabled=true
  document.getElementById("5").disabled=true
  document.getElementById("6").disabled=true
  document.getElementById("7").disabled=true
  document.getElementById("8").disabled=true
  document.getElementById("9").disabled=true
  document.getElementById("10").disabled=true
  document.getElementById("11").disabled=true
  }
function enable()
  {
  document.getElementById("habi2").disabled=true
  document.getElementById("habi").disabled=true
  document.getElementById("2").disabled=false
  document.getElementById("3").disabled=false
  document.getElementById("4").disabled=false
  document.getElementById("5").disabled=false
  document.getElementById("6").disabled=false
  document.getElementById("7").disabled=false
  document.getElementById("8").disabled=false
  document.getElementById("9").disabled=false
  document.getElementById("10").disabled=false
  document.getElementById("11").disabled=false
  }
</script>
</head>

<body link="#000000">
  <FORM action="http://reyesdelcamino.org/pedido/formmail/formmail.php" method="POST"><?php echo "<INPUT TYPE=hidden NAME=\"_req_IP\" VALUE=\"".$_SERVER['REMOTE_ADDR']."\">"?></font>
  
    <table width="40%" align="center" border="0" cellspacing="0" cellpadding="0">
        <tr>
            <td>
            <fieldset class="trebu">
                <legend> Formulario de Ingreso de Pedido</legend>
                    <P>
                    <table width="100%">
                        <tr>
                            <td>
                            <fieldset class="trebu">
                <legend>Metodo de Ingreso</legend>
                <div id="div_box">Codigo:        
                    <input type="button" onclick="enable()" value="Manual">
                    <input type="button" onclick="disable()" value="Codigo">
                    <INPUT TYPE="text" NAME="codigo" MAXLENGTH="6" SIZE="5" id="habi" disabled>
                    <input type="button" onclick="enable()" value="Consultar" id="habi2" disabled>
                </div>
                                </fieldset>            
            
                </td>
                    </tr>
            </table>
                
            <div id="div_box">Nombre de la Empresa (*):</div>
                <div  id="div_boxx">
                <INPUT TYPE="text" NAME="_req_Empresa" SIZE="45" id="2">
                </div>
            <div id="div_box">Nombre de Contacto (*): </div>
                <div id="div_boxx"> <INPUT NAME="_req_Contacto" TYPE="text" SIZE="45" maxlength="20" id="3"> </div>
            <div id="div_box">Vendedor: </div>
                <div id="div_boxx">
                    <SELECT name="Vendedor" id="4">
                      <OPTION VALUE="name1"> nombre vendedor
                      <OPTION VALUE="name2"> nombre 2
                      <OPTION VALUE="name3"> otros                   
                    </SELECT>
                </div>             
            <div id="div_box">Ciudad (*): </div>
                <div id="div_boxx">
                <INPUT TYPE="text" NAME="_req_Ciudad" size="30" id="5"> </div>
            <div id="div_box">Telefono (*):</div>
                <div id="div_boxx"> 
                <INPUT NAME="_req_Telefono" SIZE="14" MAXLENGTH="9" id="6"></div>
            <div id="div_box">Fax:</div>
                <div id="div_boxx">
                <INPUT TYPE="text" NAME="Fax" SIZE="14" MAXLENGTH="9" id="7"></div>
            <div id="div_box">Email:</div>
                <div id="div_boxx">
                <INPUT TYPE="text" NAME="E-mail" SIZE="30" id="8"></div>
            <div id="div_box">Tipo de Negocio: </div>
                <div id="div_boxx">
                    <SELECT name="Negocio" id="9">
                      <OPTION VALUE="Ferreteria" SELECTED> Ferreteria 
                        <OPTION VALUE="Constructor"> Constructor 
                        <OPTION VALUE="Distribuidor"> Distribuidor
                        <OPTION VALUE="Importador/Exportador"> Importador y/o exportador
                        <OPTION VALUE="Comercial"> Comercial en general
                        <option value="Industria">Industria
                        <option value="Consumidor">Consumidor Final
                    </SELECT>
                </div>
            <div id="div_box">Digite su pedido en el siguiente campo en blanco (*):</div><div id="div_boxx">
                <P> 
                    <span class="trebu"><font size="2" face="Verdana, Arial, Helvetica, sans-serif">
                    <TEXTAREA NAME="_req_Pedido" COLS="50" ROWS="10" ></TEXTAREA></div>
            <div id="div_box">Cualquier observacion, comentario o sugerencia adicional hagalo en el siguiente campo en blanco:</div>
                <div id="div_boxx" >
                <TEXTAREA NAME="_req_Observacion" COLS="50" ROWS="2" ></TEXTAREA>
                </div>
            <div id="div_box">Los campos que tienen marcados el asterisco (*) son obligatorios para comunicarnos con usted o brindarles nuestro servicio.
            <hr>
            <br>CLIENTES NUEVOS SE APROBARAN PEDIDOS, LLENANDO LA SOLICITUD DE CREDITO CON SUS DOCUMENTOS CORRESPONDIENTES. PARA MAYOR INFORMACION CONTACTAR: <a href="mailto:">mail.com</a>
            </div>
                <div align="center">
                <INPUT TYPE="image" VALUE="Enviar" SRC="http://megaplast.com.ec/img/enviar.gif" width="112" height="44" BORDER="0">
                <!--<center><INPUT TYPE="submit" value="Enviar"></center> -->
                </div>
        </fieldset>
        </td>
    </tr>
</table>
</body>
</html>
Este despues de esto sera envia via Correo electronico
si me pueden ayudar tambien como hago para jalar descripciones de productos digitando el codigo


Gracias...

Última edición por jose29di; 22/08/2013 a las 17:22
  #2 (permalink)  
Antiguo 22/08/2013, 17:46
 
Fecha de Ingreso: julio-2013
Ubicación: México
Mensajes: 361
Antigüedad: 10 años, 9 meses
Puntos: 55
Respuesta: LLenar texbox con datos de MySQL

Hola
estudia
http://php.net/manual/es/book.mysqli.php

Saludos
  #3 (permalink)  
Antiguo 23/08/2013, 00:01
Avatar de j_silk_h  
Fecha de Ingreso: julio-2010
Mensajes: 54
Antigüedad: 13 años, 9 meses
Puntos: 6
Respuesta: LLenar texbox con datos de MySQL

No te compliques aun con ajax, por lo visto estas aprendiendo, te recomiendo:
1) usa un form donde los usuarios puedan tipear el codigo
2) has esto aproximadamente (usando mysql aun)

$misql = mysql_query ("select* from productos where cod = '".$mivariable."' ");
$miarray = mysql_fetch_array ($misql);

Luego en el html en un input haces algo como esto

<form method='post'>
<input type='text' value='<?php echo $miarray ['campotabla']'>
</form>

Espero te ayude algo a comprender
__________________
!Si se puede imaginar se puede programar!

Etiquetas: conexion, conexion-a-servidor, consultar, jalar, mysql
Atención: Estás leyendo un tema que no tiene actividad desde hace más de 6 MESES, te recomendamos abrir un Nuevo tema en lugar de responder al actual.
Respuesta




La zona horaria es GMT -6. Ahora son las 18:46.