Re: Me trae loco esto Como pasar variables?
| From: | Sistemas | Date: | Mon, 10 Mar 2003 16:16:39 +0000 |
| Subject: | Re: Me trae loco esto Como pasar variables? | ||
| References: | 1 2 | Groups: | php.general.es |
| Request: | Send a blank email to general-es+get-33491@lists.php.net to get a copy of this message | ||
Estimado Amigos Listeros:
Este equeño programa me trae loco desde hace rato,,,,
Oigan tengo un script en php donde capturo los datos de las variables, y los
paso a otro script por medio de $_POST. Pero no me escribe nada en la
Tabla............
que creen que sera?
Aqui es mi pantalla de captura de datos:
<html>
<head>
<LINK REL=stylesheet HREF="../Stylesheets/Stylesheet.php" TYPE="text/css">
<meta http-equiv="content-type" content="text/html;charset=ISO-8859-1">
<meta name="generator" content="Adobe GoLive 6">
<title>Alta de Nueva Cuenta</title>
<style type=text/css>
table,td,tr,th
{
border-width: 0;
}
</style>
</head>
<body bgcolor="#ffffff">
<h3 align='center'> Alta de Cuentas</h3>
<form action="addcta.php" method="Post" name="AddCustomer">
<table width="581" border="0" cellspacing="2"
cellpadding="0" height="116">
<tr>
<td width="131">Numero de Cuenta:</td>
<td><input type="text" name="cuenta" size="2"></td>
</tr>
<tr>
<td width="131">Nombre:</td>
<td><input type="text" name="nombre" size="40"></td>
</tr>
<tr>
<td width="131">Fecha de Inicio:</td>
<td><input type="text" name="fechainicio" size="12"
maxlength=12></td>
</tr>
<tr>
<td valign=top width="131">
Comentarios: <td><textarea name="Comentarios" rows="6"
cols="48"></textarea>
</table><table><tr><td width=400 align=center>
<input type="submit" name="Agregar"
value="Agregar"> <input
type="reset" name="Cancelar" value="Cancelar">
</table> </form>
</body>
</html>
Aqui es donde grabo mi registro..
<?php
//Adds a Customer to the database and checks for errors.
$cuenta=$_POST['cuenta'];
$nombre=$_POST['nombre'];
$fechainicio=$_POST['fechainicio'];
$Comentarios=$_POST['Comentarios'];
$AddCustomer=$_POST['AddCustomer'];
$msg="Cuenta: $cuenta\nNombre: $nombre\nFechaInicio:
$fechainicio\nComentarios: $Comentarios\nAddCustomer: $AddCustomer\n";
include ("../settings.php");
$dbHost="$server";
$dbName="$database";
$dbUser="$username";
$dbPass="$password";
$dbTable="customers";
$sel="INSERT INTO $dbTable (FirstN, LastN, AccountNum, PhoneNum, Comments,
ID) VALUES (\$FirstN\", \"$LastN\", \"$AccountNum\",
\"$PhoneNum\",
\"$Comments\", \"$\")";
$conn = @mysql_connect($dbHost, $dbUser, $dbPass);
$dbDB = @mysql_select_db($dbName, $conn);
$result = @mysql_query($sel, $conn);
?>
<br>
<?
include ("newcta.php");
?>
Todo lo hace bien, pero al registrar el dato en la tabla no me pasa ningun
contenido.
Saludos y espero su ayuda.