PHP - como puedo aguardar esto

 
Vista:

como puedo aguardar esto

Publicado por samuel (3 intervenciones) el 03/12/2008 02:40:24
hola perdon por las molestias, pero es que como apenas comienzo con php y mysql tengo problemas y son los siguientes tengo un codigo que me genera unos campos de texto para agregar acciones pero al momento de guardar lo que tengo en esos campos no me aguarada nada quisiera saber si me pueden ayudar los codigos son los siguientes:

este codigo es el que me genera los campos para guardar.
<head>

<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>Acciones</title>
<script language="javascript" type="text/javascript">
var indiceFilaFormulario = 1;
function addCampo(){

newFila = document.getElementById("formCampos").insertRow(-1);
newFila.id = indiceFilaFormulario;
newCelda = newFila.insertCell(-1);

newCelda.innerHTML = "<td><label>" +indiceFilaFormulario+ "</label></td>";
newCelda = newFila.insertCell(-1);

newCelda.innerHTML = "<td><input type = 'checkbox' name = 'status["+indiceFilaFormulario+"]' size='5' maxlength='5' class='mayus'></td>";
newCelda = newFila.insertCell(-1);

newCelda.innerHTML = "<td><input type = 'text' name = 'identificador["+indiceFilaFormulario+"]' size='10' maxlength='10' class='mayus'></td>";
newCelda = newFila.insertCell(-1);

newCelda.innerHTML = "<td><textarea name = 'accion["+indiceFilaFormulario+"]' cols='40' rows='5' class='mayus'></textarea></td>";
newCelda = newFila.insertCell(-1);

newCelda.innerHTML = "<td><input type = 'text' name = 'responsable["+indiceFilaFormulario+"]' size='10' maxlength='10' ></td>";
newCelda = newFila.insertCell(-1);

newCelda.innerHTML = "<td><input type = 'text' name = 'fecha_programada["+indiceFilaFormulario+"]' size='10' maxlength='10'></td>";
newCelda = newFila.insertCell(-1);

newCelda.innerHTML = "<td><input type = 'text' name = 'fecha_realizada["+indiceFilaFormulario+"]' size='10' maxlength='10'></td>";
newCelda = newFila.insertCell(-1);

newCelda.innerHTML = "<th><input type = 'button' value='Eliminar' onclick='delCampo(this)' ></th>";
indiceFilaFormulario++;
incr++;
}

function delCampo(obj){

var oTr = obj;
while (oTr.nodeName.toLowerCase()!='tr'){
oTr = oTr.parentNode;
}
var root = oTr.parentNode;
root.removeChild(oTr);
indiceFilaFormulario--;
}

</script>

<style type="text/css">
<!--
body {
background-image: url(imagenes%20para%20proyecto/fondotec.jpg);
}
-->
</style><form id="accion" name="accion" method="post" action="" >
<table width="852" height="400"border="1" align="center" bordercolor="#000000">
<!--DWLayoutTable-->

<tr>
<td width="842" height="32"><div align="center"><span class="Estilo7">ACCIONES:</span></div></td>
</tr>
<tr>
<td width="50" height="386" align="left" valign="top">

<label></label> <label></label> <label></label> <label></label> <label></label>
<table width="842" border="0" id="formCampos">
<tr>
<th width="40" height="40" scope="col"><div align="center">No</div></th>
<th width="20" scope="col"><div align="center">Status</div></th>
<th width="20" scope="col"><div align="center">Identificador</div></th>
<th width="358" scope="col"><div align="center">Acción</div></th>
<th width="92" scope="col">Responsable</th>
<th width="38" scope="col"><div align="center">Fecha Programada </div></th>
<th width="38" scope="col"><div align="center">Fecha realizada </div></th>
<th width="67" scope="col"><div align="center">Eliminar</div></th>
</tr>
</table>
<br />
<label>
<input type="button" onclick="addCampo()" value="Agregar Acción" />
<br />
<object classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000" codebase="http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=5,0,0,0" width="100" height="22">
<param name="movie" value="button6.swf" />
<param name="quality" value="high" />
<embed src="button6.swf" quality="high" pluginspage="http://www.macromedia.com/shockwave/download/index.cgi?P1_Prod_Version=ShockwaveFlash" type="application/x-shockwave-flash" width="100" height="22" ></embed>
</object>
</label></td>
</tr>
<tr>
<td height="2"></td>
</tr>
</table>
</form>
<p align="center"><a href="AccionPreventiva.php">Accion Preventiva</a></p>
</body>
</html>

y este otro es el que utilizo para guardar en la base de datos en mysql:

<body>
<?php
$conexion=mysql_connect("localhost","root","")
or die("Problemas en la conexion");
mysql_select_db("accion_preventiva",$conexion) or
die("Problemas en la seleccion de la base de datos");

$sql="insert into acciones(numero,status,identificador,accion,responsable,fecha_programada,fecha_realizada) values('$_REQUEST[numero]','$_REQUEST[status]','$_REQUEST[identificador]','$_REQUEST[accion]','$_REQUEST[responsable]','$_REQUEST[fecha_programada]','$_REQUEST[fecha_realizada]')";

$insertar=mysql_query($sql);


//si consultas se ejecutan exitosamente, muestro mensaje
if ($sql== true){
echo "se agregaron satisfactoriamente" . mysql_error();
}
?>
</body>
</html>

no se se me aya explicado correctamente pero de antemano gracias por su paciensia
Valora esta pregunta
Me gusta: Está pregunta es útil y esta claraNo me gusta: Está pregunta no esta clara o no es útil
0
Responder