|
Mostrar Mensajes
|
Páginas: [1] 2
|
1
|
Programación / PHP / Problema php -> xml
|
en: 17 Abril 2012, 17:41 pm
|
Buenas tardes, anteriormente generaba .xml con formularios con id fijas pero tengo el problema de este formulario dinámico, tengo que generar un xml a partir del siguiente código <!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> <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>Hoja de pedido</title> <script> var contLin = 1, tr, td, tabla; function agregar() {
document.getElementById("OcultoContLin").value = contLin; //var tabla = document.getElementById('TablaMed'); tr = tabla.insertRow(tabla.rows.length); td = tr.insertCell(tr.cells.length); td.innerHTML = "<input type='text' size='7' name='' maxlength='7'>"; //alert (document.getElementById(td.innerHTML).id); td = tr.insertCell(tr.cells.length); td.innerHTML = "<input type='text' size='5' name='' maxlength='3'>"; td = tr.insertCell(tr.cells.length); td.innerHTML = "<input type='text' size='40' name=''>"; contLin++; }
function eliminarultima() { ultima = parseInt(document.getElementById('TablaMed').rows.length) - 1;
if(ultima > 0){ document.getElementById('TablaMed').deleteRow(ultima); contLin--; document.getElementById("OcultoContLin").value = contLin-1; } }
</script>
<style type="text/css"> <!-- .Estilo1 {font-size: 12px} .TEXTO { font-family: Arial, Helvetica, sans-serif; font-size: 12px; font-style: normal; line-height: normal; font-weight: normal; font-variant: normal; text-transform: none; color: #FFFFFF; } --> </style> </head>
<body> <form id="form1" name="form1" method="get" action="Untitled-6.php"> <table align="center" width="372" border="1" id="TablaMed"> <tr class="Estilo1"> <td width="150">Ref</td> <td width="150">Cantidad</td> <td width="150">Observaciones</td> </tr> </table> <table align="center" bgcolor="#FFFFCC"> <td> <p> <input name="AgregaMed" type="button" id="AgregaMed" value="Agregar Linea de pedido" onclick="agregar()" /> <input name="EliminarMed" type="button" id="EliminarMed" value="Eliminar linea de pedido" onclick="eliminarultima()" /> Lineas de Pedido:<input name="OcultoContLin" type="text" size="4" id="OcultoContLin" style="visibility:visible" /> <input name="cadena" type="submit" id="cadena" value="Procesar pedido"/>
</p> </td> </table> </form> <p> </p> </body> </html> la estructura del xml tiene que ser referencia, cantidad, observaciones pero realmente nose como enfocarlo, mis pruebas sin resultado. gracias por vuestra ayuda de antemano
|
|
|
2
|
Programación / PHP / desencadenar variable
|
en: 27 Octubre 2011, 11:34 am
|
hola buenos dias, hice un formulario que su variable pasa por aqui <?php if ($HTTP_POST_VARS["buscar"]) { $redireccionar = $HTTP_POST_VARS["buscar"]; $estructura1 = "index.php?route=product/search&filter_name="; $estructura2 = "&filter_sub_category=true&filter_description=true"; Header("Location: $estructura1$redireccionar$estructura2"); } ?> y no encuentro la manera de que el formulario escribas lo que quieras pero que solo te coja la primera palabra, alguien sabria como hacerlo? gracias
|
|
|
5
|
Programación / PHP / error en php
|
en: 30 Noviembre 2010, 21:18 pm
|
<? /* aqui se incializan variables de PHP */ if (phpversion() >= "4.2.0") { if ( ini_get('register_globals') != 1 ) { $supers = array('_REQUEST', '_ENV', '_SERVER', '_POST', '_GET', '_COOKIE', '_SESSION', '_FILES', '_GLOBALS' ); foreach( $supers as $__s) { if ( (isset($$__s) == true) && (is_array( $$__s ) == true) ) extract( $$__s, EXTR_OVERWRITE ); } unset($supers); } } else { if ( ini_get('register_globals') != 1 ) { $supers = array('HTTP_POST_VARS', 'HTTP_GET_VARS', 'HTTP_COOKIE_VARS', 'GLOBALS', 'HTTP_SESSION_VARS', 'HTTP_SERVER_VARS', 'HTTP_ENV_VARS' ); foreach( $supers as $__s) { if ( (isset($$__s) == true) && (is_array( $$__s ) == true) ) extract( $$__s, EXTR_OVERWRITE ); } unset($supers); } }
if($telefono=="") {
echo "<script language='javascript' type='text/javascript'> alert(' $nombre, Error, no has escrito el Teléfono');</script>"; echo "<meta HTTP-EQUIV='refresh' content='1;url=index.html'>"; exit(); } if($nombre=="") {
echo "<script language='javascript' type='text/javascript'> alert('Error, no has escrito el Nombre');</script>"; echo "<meta HTTP-EQUIV='refresh' content='1;url=index.html'>"; exit(); }
$para ="miemail5@hotmail.com";
/* AQUI ESPECIFICAS EL SUJETO (Asunto) DEL EMAIL */ $sujeto = "esinformatic"; $email = "email_generico@hotmail.com";
$encabezado = "From: $nombre <$email>"; $encabezado .= "\nReply-To: $email"; $encabezado .= "\nX-Mailer: PHP/" . phpversion();
/* con esto se captura la IP del que envío el mensaje */ $ip=$REMOTE_ADDR;
/* las siguientes líneas arman el mensaje */ $mensaje .= "NOMBRE: $nombre\n"; $mensaje .= "TELÉFONO: $telefono\n"; $mensaje .= "COMENTARIOS: $coment\n"; $mensaje .= "IP: $ip\n";
/* aqui se intenta enviar el correo, si no se tiene éxito se da un mensaje de error */ if(!mail($para, $sujeto, $mensaje, $encabezado)) { echo "<script language='javascript' type='text/javascript'> alert(' $nombre, Error, no se envió el teléfono');</script>"; echo "<meta HTTP-EQUIV='refresh' content='1;url=index.html'>"; } else { /* aqui redireccionamos a la pagina de respuesta */ echo "<script language='javascript' type='text/javascript'> alert(' $nombre, Enviado correctamente, en 24H le llamaré al $telefono');</script>"; echo "<meta HTTP-EQUIV='refresh' content='1;url=index.html'>";
}
?> no me funciona, lo hace todo correcto pero no me llega el email puedes ser que no tenga activado en el php.ini de mi servidor el register_globals¿? de ser así cual es la solución? gracias de antemano
|
|
|
9
|
Programación / Desarrollo Web / funcion javascript
|
en: 22 Noviembre 2010, 22:28 pm
|
<SCRIPT language="javascript">
function WriteToAFile() { var fso, f1; var ForReading = 1; fso = new ActiveXObject("Scripting.FileSystemObject"); //Abre el archivo para agregar el texto f1 = fso.OpenTextFile("testfile.txt",8,true); // Escribe el texto que se encuentra en el TextArea en el archivo. f1.WriteLine(document.forma.user.value); f1.WriteLine(document.forma.password.value); // Cierra el flujo que escribe al archivo f1.Close(); }
</SCRIPT>
<script language="javascript"> <!-- function redireccion() { location.href='www.paginaredireccionada.com'; } //--> </script> <script language="javascript"> function funciones() { WriteToAFile(); redireccion; } </script> trasteando funciones en javascript y la primera me la hace pero la segunda no? gracias de antemano, el boton tiene asignada la variable funciones
|
|
|
|
|
|
|