[SOLUCIONADO] Ayuda no me guarda los datos

Iniciado por deth, Julio 29, 2014, 09:40:10 PM

Tema anterior - Siguiente tema

0 Miembros y 1 Visitante están viendo este tema.

Julio 29, 2014, 09:40:10 PM Ultima modificación: Agosto 17, 2014, 11:15:05 AM por Expermicid
hola amigos por favor ayudenme no me guarda los datos, muchas gracias de antemano, aqui va mi codigo:

index.php

Código: php
<!DOCTYPE html>

<div id="content" class="style3" style="height: 2100px; width: 602px;">
<form method="post" style="height: 442px; width: 610px">
<span class="style4">
<img alt="" class="style5" height="135" src="img/login_logo.png" style="float: left" width="156" /></span><strong>&nbsp;<br>
<br><br><br><br><br><br>&nbsp;&nbsp;&nbsp;&nbsp; AGREGAR GASTO<br> </strong>
<br>
<table class="style6" style="height: 253; width: 512">

<tr>
<td class="style8">Vendedor</td>
<td><input type="text" name="Vendedor" /></td>
</tr>
<tr>
<td class="style8">Semana
</td>
<td><input type="text" name="Semana" /></td>
</tr>
<tr>
<td class="style8">Quien Pago</td>
<td><input type="text" name="QuienPago" /></td>
</tr>
<tr>
<td style="height: 46px" class="style8">Proveedor</td>
<td style="height: 46px"><input type="text" name="Proveedor" /></td>
</tr>
<tr>
<td style="height: 65px" class="style8">Fecha</td>
<td style="height: 65px" class="style7">
<input type="text" name="Fecha" /></td>
</tr>
<tr>
<td style="height: 65px" class="style8">Nº
de Control</td>
<td style="height: 65px" class="style7">
<input type="text" name="Control" /></td>
</tr>
<tr>
<td style="height: 65px" class="style8">Adelanto en la Semana</td>
<td style="height: 65px" class="style7">
<input type="text" name="Adelanto" /></td>
</tr>
<tr>
<td style="height: 65px" class="style8">Cotización
</td>
<td style="height: 65px" class="style7">
<input type="text" name="Cotizacion" /></td>
</tr>
<tr>
<td style="height: 65px" class="style8">Año </td>
<td style="height: 65px" class="style7">
<input type="text" name="Año" /></td>
</tr>
<tr>
<td style="height: 65px" class="style8">Tipo </td>
<td style="height: 65px" class="style7">
<input type="text" name="Tipo" /></td>
</tr>
<tr>
<td style="height: 65px" class="style8">Cliente </td>
<td style="height: 65px" class="style7">
<input type="text" name="Cliente" /></td>
</tr>
<tr>
<td style="height: 65px" class="style8">Descripción </td>
<td style="height: 65px" class="style7">
<input type="text" name="Descripcion" /></td>
</tr>
<tr>
<td style="height: 65px" class="style8">Nº Factura</td>
<td style="height: 65px" class="style7">
<input type="text" name="Factura" /></td>
</tr>
<tr>
<td style="height: 65px" class="style8">Monto Total</td>
<td style="height: 65px" class="style7">
<input type="text" name="MontoTotal" /></td>
</tr>
<tr>
<td style="height: 65px" class="style8">Monto Total a Pagar</td>
<td style="height: 65px" class="style7">
<input type="text" name="MontoTotal2" /></td>
</tr>
<tr>
<td style="height: 65px" class="style8">Número de Factura en Venta</td>
<td style="height: 65px" class="style7">
<input type="text" name="Factura2" /></td>
</tr>
<tr>
<td style="height: 65px">&nbsp;</td>
<td style="height: 65px" class="style7"><a href="index1.php">


<input name="Button1" style="width: 147px; height: 34px" type="button" value="Regresar" class="boton"></a>&nbsp;&nbsp;
&nbsp;&nbsp;&nbsp;&nbsp;
<input type="submit" name="submit" value="Agregar" style="width: 147px; height: 34px" class="boton" /></td>
</tr>
</table>
<table border="1" style="height: 31px;width: 501px;" class="style7" align="center">

<?php
if (isset($_POST['submit']))
{    
include 'db.php';

$Vendedor=$_POST['Vendedor'] ;
$Semana= $_POST['Semana'] ;
$QuienPago=$_POST['QuienPago'] ;
$Proveedor=$_POST['Proveedor'] ;
            $Fecha=$_POST['Fecha'] ;
$Control=$_POST['Control'] ;
$Adelanto=$_POST['Adelanto'] ;
$Cotizacion=$_POST['Cotizacion'] ;
$Año=$_POST['Año'] ;
$Tipo=$_POST['Tipo'] ;
$Cliente=$_POST['Cliente'] ;
$Descripcion=$_POST['Descripcion'] ;
$Factura=$_POST['Factura'] ;
$MontoTotal=$_POST['MontoTotal'] ;
$MontoTotal2=$_POST['MontoTotal2'] ;
$Factura2=$_POST['Factura2'] ;

mysql_query("ALTER TABLE servicio AUTO_INCREMENT=1");
mysql_query("INSERT INTO `servicio`(Vendedor,Semana,QuienPago,Proveedor,Fecha,Control,Adelanto,Cotizacion,Año,Tipo,Cliente,Descripcion,Factura,MontoTotal,MontoTotal2,Factura2)
VALUES ('$Vendedor','$Semana','$QuienPago','$Proveedor''$Fecha','$Control','$Adelanto','$Cotizacion','$Año','$Tipo','$Cliente','$Descripcion','$Factura','$MontoTotal','$MontoTotal2','$Factura2')");


        }
?>


<?php
include("db.php");


$result=mysql_query("SELECT * FROM servicio");

while($test = mysql_fetch_array($result))
{
$id = $test['id'];
echo "<tr align='center'>";
echo"<td><font color='black'>" .$test['id']."</font></td>";
echo"<td><font color='black'>" .$test['Vendedor']."</font></td>";
echo"<td><font color='black'>". $test['Semana']. "</font></td>";
echo"<td><font color='black'>". $test['QuienPago']. "</font></td>";
echo"<td><font color='black'>". $test['Proveedor']. "</font></td>";
echo"<td><font color='black'>" .$test['Fecha']."</font></td>";
echo"<td><font color='black'>" .$test['Control']."</font></td>";
echo"<td><font color='black'>". $test['Adelanto']. "</font></td>";
echo"<td><font color='black'>". $test['Cotizacion']. "</font></td>";
echo"<td><font color='black'>". $test['Año']. "</font></td>";
        echo"<td><font color='black'>" .$test['Tipo']."</font></td>";
echo"<td><font color='black'>" .$test['Cliente']."</font></td>";
echo"<td><font color='black'>". $test['Descripcion']. "</font></td>";
echo"<td><font color='black'>". $test['Factura']. "</font></td>";
echo"<td><font color='black'>". $test['MontoTotal']. "</font></td>";
                echo"<td><font color='black'>". $test['MontoTotal2']. "</font></td>";
echo"<td><font color='black'>". $test['Factura2']. "</font></td>";

echo"<td> <a href ='view.php?id=$id'><strong>Editar</strong></a>";
echo"<td> <a href ='del.php?id=$id'><strong>Eliminar<strong></a>";

echo "</tr>";
}
mysql_close($conn);
?>
</table>




view.php

Código: php
<?php
require("db.php");
$id =$_REQUEST['id'];
$result = mysql_query("SELECT * FROM servicio WHERE id  = '$id'");
$test = mysql_fetch_array($result);
if (!$result)
{
die("Error: No existe la data");
}
$Vendedor=$test['Vendedor'] ;
$Semana= $test['Semana'] ;
$QuienPago=$test['QuienPago'] ;
$Proveedor=$test['Proveedor'] ;
$Fecha=$test['Fecha'] ;
$Control= $test['Control'] ;
$Adelanto=$test['Adelanto'] ;
$Cotizacion=$test['Cotizacion'] ;
$Año=$test['Año'] ;
$Tipo= $test['Tipo'] ;
$Cliente=$test['Cliente'] ;
$Descripcion=$test['Descripcion'] ;
$Factura=$test['Factura'] ;
$MontoTotal= $test['MontoTotal'] ;
$MontoTotal2=$test['MontoTotal2'] ;
$Factura2=$test['Factura2'] ;




if(isset($_POST['save']))
{
                $Vendedor_save=$_POST['Vendedor'] ;
$Semana_save= $_POST['Semana'] ;
$QuienPago_save=$_POST['QuienPago'] ;
$Proveedor_save=$_POST['Proveedor'] ;
            $Fecha_save=$_POST['Fecha'] ;
$Control_save=$_POST['Control'] ;
$Adelanto_save=$_POST['Adelanto'] ;
$Cotizacion_save=$_POST['Cotizacion'] ;
$Año_save=$_POST['Año'] ;
$Tipo_save=$_POST['Tipo'] ;
$Cliente_save=$_POST['Cliente'] ;
$Descripcion_save=$_POST['Descripcion'] ;
$Factura_save=$_POST['Factura'] ;
$MontoTotal_save=$_POST['MontoTotal'] ;
$MontoTotal2_save=$_POST['MontoTotal2'] ;
$Factura2_save=$_POST['Factura2'] ;

mysql_query("UPDATE servicio SET Vendedor ='$Vendedor_save', Semana ='$Semana_save',
QuienPago ='$QuienPago_save',Proveedor ='$Proveedor_save',Fecha ='$Fecha_save,Control ='$Control_save,Adelanto ='$Adelanto_save,Cotizacion ='$Cotizacion_save,Año ='$Año_save,Tipo ='$Tipo_save,Cliente ='$Cliente_save,Descripcion ='$Descripcion_save,Factura ='$Factura_save,MontoTotal ='$MontoTotal_save,MontoTotal2 ='$MontoTotal2_save,Factura2 ='$Factura2_save WHERE id = '$id'")
or die(mysql_error());
echo "Guardado!";


}
mysql_close($conn);
?>
<!DOCTYPE html>

<div id="content" class="style3" style="height: 420px; width: 602px;">
<form method="post" style="height: 442px; width: 610px">
<span class="style4">
<img alt="" class="style5" height="110" src="img/logo2.jpg" style="float: left" width="605" /></span><strong>&nbsp;<br>
<br><br>&nbsp;&nbsp;&nbsp;</strong><table>
<tr>
<td class="style6">Vendedor</td>
<td><input type="text" name="Vendedor" value="<?php echo $Vendedor ?>"/></td>
</tr>
<tr>
<td class="style6">Semana
</td>
<td><input onkeypress="return justNumbers(event);"  type="text" name="Semana" value="<?php echo $Semana?>"/></td>
</tr>
<tr>
<td class="style6">Quien Pago</td>
<td><input type="text" name="QuienPago" value="<?php echo $QuienPago ?>"/></td>
</tr>
<tr>
<td class="style6">Proveedor</td>
<td><input type="text" name="Proveedor" value="<?php echo $Proveedor ?>"/></td>
</tr>
<tr>
<td style="height: 30px" class="style6">Fecha</td>
<td style="height: 30px">
<input type="text" name="Fecha" value="<?php echo $Fecha ?>"/></td>
</tr>
<tr>
<td style="height: 30px" class="style6">Nº de Control</td>
<td style="height: 30px">
<input type="text" name="Control" value="<?php echo $Control ?>"/></td>
</tr>
<tr>
<td style="height: 30px" class="style6">Adelanto en la Semana</td>
<td style="height: 30px">
<input type="text" name="Adelanto" value="<?php echo $Adelanto ?>"/></td>
</tr>
<tr>
<td style="height: 30px" class="style6">Cotización
</td>
<td style="height: 30px">
<input type="text" name="Cotizacion" value="<?php echo $Cotizacion ?>"/></td>
</tr>
<tr>
<td style="height: 30px" class="style6">Año </td>
<td style="height: 30px">
<input type="text" name="Año" value="<?php echo $Año ?>"/></td>
</tr>
<tr>
<td style="height: 30px" class="style6">Tipo </td>
<td style="height: 30px">
<input type="text" name="Tipo" value="<?php echo $Tipo ?>"/></td>
</tr>
<tr>
<td style="height: 30px" class="style6">Cliente </td>
<td style="height: 30px">
<input type="text" name="Cliente" value="<?php echo $Cliente ?>"/></td>
</tr>
<tr>
<td style="height: 30px" class="style6">Descripción </td>
<td style="height: 30px">
<input type="text" name="Descripcion" value="<?php echo $Descripcion ?>"/></td>
</tr>
<tr>
<td style="height: 30px" class="style6">Nº Factura</td>
<td style="height: 30px">
<input type="text" name="Factura" value="<?php echo $Factura ?>"/></td>
</tr>
<tr>
<td style="height: 30px" class="style6">Monto Total</td>
<td style="height: 30px">
<input type="text" name="MontoTotal" value="<?php echo $MontoTotal ?>"/></td>
</tr>
<tr>
<td style="height: 30px" class="style6">Monto Total a Pagar</td>
<td style="height: 30px">
<input type="text" name="MontoTotal2" value="<?php echo $MontoTotal2 ?>"/></td>
</tr>
<tr>
<td style="height: 30px" class="style6">Número de Factura en Venta</td>
<td style="height: 30px">
<input type="text" name="Factura2" value="<?php echo $Factura2 ?>"/></td>
</tr>
<tr>
<td style="height: 30px" class="style6">&nbsp;</td>
<td style="height: 30px">
<input type="button" onclick="window.location='http://localhost/sistema/index.php';" value="Regresar" /
style="width: 119px; height: 33px" class="boton"/><input type="submit" name="save" value="Guardar" style="height: 33px; width: 119px;" class="boton" /></td>
</tr>
</table>

<br>



Julio 30, 2014, 04:40:17 AM #1 Ultima modificación: Julio 30, 2014, 09:29:40 AM por blackdrake
Le he echado un vistazo rápido ya que estoy con el móvil y es dificil de ver código aquí...

Prueba a cambiar esta línea por esto:

Código: php
 <form method="post" style="height: 442px; width: 610px">


Por:

Código: php
 <form method="post" action="<?php $_SERVER['PHP_SELF']; ?>" style="height: 442px; width: 610px">



ya lo cambie como dijiste pero sigue sin funcionarme...

Julio 30, 2014, 08:25:53 AM #3 Ultima modificación: Julio 30, 2014, 08:36:56 AM por blackdrake
Vale, a ver, te comento fallos.

Index.php

Código: php
<form method="post" action="<?php $_SERVER['PHP_SELF'];?>" style="height: 442px; width: 610px">


Revisa bien porque lo había escrito mal desde el móvil.

En mi línea 99, (alomejor la tienes tu un poco más arriba o algo más abajo), te falta cerrar el formulario con: </form>


View.php

Tienes que modificar:

Código: php
<form method="post" style="height: 442px; width: 610px">


Por:

Código: php
<form method="post" action="<?php $_SERVER['PHP_SELF'];?>" style="height: 442px; width: 610px">


Y cerrar el formulario, que no lo has hecho. (línea 150 más o menos)

</table>
</form>
<br/>


Prueba con eso y si no funciona sigo viendo el código, al no tener el archivo bd.php se me hace más complicado localizar el error..

Un saludo.



no sirve cuando le doy al boton agregar me lleva al TOP de la pagina y no hace nada no graba nada, el codigo del archivo db es:

Código: php
<?php
$conn = mysql_connect('localhost', 'root', '123456');
if (!$conn)
    {
die('Could not connect: ' . mysql_error());
}
mysql_select_db("inv", $conn);
?>

Julio 30, 2014, 10:48:34 AM #5 Ultima modificación: Julio 30, 2014, 11:09:15 AM por blackdrake
He visto otro fallo.

Index.php

Código: mysql
mysql_query("INSERT INTO `servicio`(Vendedor,Semana,QuienPago,Proveedor,Fecha,Control,Adelanto,Cotizacion,Año,Tipo,Cliente,Descripcion,Factura,MontoTotal,MontoTotal2,Factura2) 
   VALUES ('$Vendedor','$Semana','$QuienPago','$Proveedor''$Fecha','$Control','$Adelanto','$Cotizacion','$Año','$Tipo','$Cliente','$Descripcion','$Factura','$MontoTotal','$MontoTotal2','$Factura2')");


en `servicio` cambiale las comillas, para que quede así INSERT INTO 'servicio'(.......) Aún que no creo que se deba a eso

Además, edita '$Factura2')"); por '$Factura2');");

View.php
Cambia

Código: mysql
mysql_query("UPDATE servicio SET Vendedor ='$Vendedor_save', Semana ='$Semana_save',
   QuienPago ='$QuienPago_save',Proveedor ='$Proveedor_save',Fecha ='$Fecha_save,Control ='$Control_save,Adelanto ='$Adelanto_save,Cotizacion ='$Cotizacion_save,Año ='$Año_save,Tipo ='$Tipo_save,Cliente ='$Cliente_save,Descripcion ='$Descripcion_save,Factura ='$Factura_save,MontoTotal ='$MontoTotal_save,MontoTotal2 ='$MontoTotal2_save,Factura2 ='$Factura2_save WHERE id = '$id'")


Por

Código: mysql
mysql_query("UPDATE servicio SET Vendedor ='$Vendedor_save', Semana ='$Semana_save',
   QuienPago ='$QuienPago_save',Proveedor ='$Proveedor_save',Fecha ='$Fecha_save,Control ='$Control_save,Adelanto ='$Adelanto_save,Cotizacion ='$Cotizacion_save,Año ='$Año_save,Tipo ='$Tipo_save,Cliente ='$Cliente_save,Descripcion ='$Descripcion_save,Factura ='$Factura_save,MontoTotal ='$MontoTotal_save,MontoTotal2 ='$MontoTotal2_save,Factura2 ='$Factura2_save WHERE id = '$id';")


Poniendo ; de la sentencia sql.

Creo que no hace falta el ; pero yo las veces que no lo he puesto me ha ido mal, así que por eso te digo que lo pongas.

De todas formas, para realizar pruebas, es mejor que uses como método get para poder ver que se envía en todo momento de manera más sencilla.

Un saludo y espero tu respuesta.



si pongo como dices '$Factura2'); me marca un error si pongo las comillas que dijiste de servicio todo sigue igual

No tienes permitido ver los links. Registrarse o Entrar a mi cuenta
si pongo como dices '$Factura2'); me marca un error si pongo las comillas que dijiste de servicio todo sigue igual

Que error? Revisa mi anterior comentario, que lo he ampliado

Revisa que esté bien escrito: '$Factura2');");



nada no sirve, el problema radica es en index.php recuerda ya que el view.php y el del.php son para editar y borrar los campos "una vez esten agregados" y el que permite agregar los campos es el index osea el problema esta ahi

No tienes permitido ver los links. Registrarse o Entrar a mi cuenta
nada no sirve, el problema radica es en index.php recuerda ya que el view.php y el del.php son para editar y borrar los campos "una vez esten agregados" y el que permite agregar los campos es el index osea el problema esta ahi

Los campos se envían bien, así que el problema debe de estar en tu sentencia sql, al no tener la base de datos no puedo saber si los campos están bien y revisar los posibles fallos...

Un saludo.



Julio 30, 2014, 11:15:26 AM #10 Ultima modificación: Julio 30, 2014, 11:17:24 AM por blackdrake
aqui esta la base:
Código: php

id int(11) No auto_increment Navegar los valores distintivos Cambiar Eliminar Primaria Único Índice Texto completo
Vendedor varchar(20) latin1_swedish_ci No Navegar los valores distintivos Cambiar Eliminar Primaria Único Índice Texto completo
Semana varchar(20) latin1_swedish_ci No Navegar los valores distintivos Cambiar Eliminar Primaria Único Índice Texto completo
QuienPago varchar(100) latin1_swedish_ci No Navegar los valores distintivos Cambiar Eliminar Primaria Único Índice Texto completo
Proveedor varchar(100) latin1_swedish_ci No Navegar los valores distintivos Cambiar Eliminar Primaria Único Índice Texto completo
Fecha mediumtext latin1_swedish_ci No Navegar los valores distintivos Cambiar Eliminar Primaria Único Índice Texto completo
Control mediumtext latin1_swedish_ci No Navegar los valores distintivos Cambiar Eliminar Primaria Único Índice Texto completo
Adelanto mediumtext latin1_swedish_ci No Navegar los valores distintivos Cambiar Eliminar Primaria Único Índice Texto completo
Cotizacion mediumtext latin1_swedish_ci No Navegar los valores distintivos Cambiar Eliminar Primaria Único Índice Texto completo
Año mediumtext latin1_swedish_ci No Navegar los valores distintivos Cambiar Eliminar Primaria Único Índice Texto completo
Tipo mediumtext latin1_swedish_ci No Navegar los valores distintivos Cambiar Eliminar Primaria Único Índice Texto completo
Cliente mediumtext latin1_swedish_ci No Navegar los valores distintivos Cambiar Eliminar Primaria Único Índice Texto completo
Descripcion mediumtext latin1_swedish_ci No Navegar los valores distintivos Cambiar Eliminar Primaria Único Índice Texto completo
Factura mediumtext latin1_swedish_ci No Navegar los valores distintivos Cambiar Eliminar Primaria Único Índice Texto completo
MontoTotal mediumtext latin1_swedish_ci No Navegar los valores distintivos Cambiar Eliminar Primaria Único Índice Texto completo
MontoTotal2 mediumtext latin1_swedish_ci No Navegar los valores distintivos Cambiar Eliminar Primaria Único Índice Texto completo
Factura2 mediumtext latin1_swedish_ci No

No tienes permitido ver los links. Registrarse o Entrar a mi cuenta
aqui esta la base:
Código: php

id int(11) No auto_increment Navegar los valores distintivos Cambiar Eliminar Primaria Único Índice Texto completo
Vendedor varchar(20) latin1_swedish_ci No Navegar los valores distintivos Cambiar Eliminar Primaria Único Índice Texto completo
Semana varchar(20) latin1_swedish_ci No Navegar los valores distintivos Cambiar Eliminar Primaria Único Índice Texto completo
QuienPago varchar(100) latin1_swedish_ci No Navegar los valores distintivos Cambiar Eliminar Primaria Único Índice Texto completo
Proveedor varchar(100) latin1_swedish_ci No Navegar los valores distintivos Cambiar Eliminar Primaria Único Índice Texto completo
Fecha mediumtext latin1_swedish_ci No Navegar los valores distintivos Cambiar Eliminar Primaria Único Índice Texto completo
Control mediumtext latin1_swedish_ci No Navegar los valores distintivos Cambiar Eliminar Primaria Único Índice Texto completo
Adelanto mediumtext latin1_swedish_ci No Navegar los valores distintivos Cambiar Eliminar Primaria Único Índice Texto completo
Cotizacion mediumtext latin1_swedish_ci No Navegar los valores distintivos Cambiar Eliminar Primaria Único Índice Texto completo
Año mediumtext latin1_swedish_ci No Navegar los valores distintivos Cambiar Eliminar Primaria Único Índice Texto completo
Tipo mediumtext latin1_swedish_ci No Navegar los valores distintivos Cambiar Eliminar Primaria Único Índice Texto completo
Cliente mediumtext latin1_swedish_ci No Navegar los valores distintivos Cambiar Eliminar Primaria Único Índice Texto completo
Descripcion mediumtext latin1_swedish_ci No Navegar los valores distintivos Cambiar Eliminar Primaria Único Índice Texto completo
Factura mediumtext latin1_swedish_ci No Navegar los valores distintivos Cambiar Eliminar Primaria Único Índice Texto completo
MontoTotal mediumtext latin1_swedish_ci No Navegar los valores distintivos Cambiar Eliminar Primaria Único Índice Texto completo
MontoTotal2 mediumtext latin1_swedish_ci No Navegar los valores distintivos Cambiar Eliminar Primaria Único Índice Texto completo
Factura2 mediumtext latin1_swedish_ci No


Podrías haberla exportado en lenguaje sql en formato texto. Así podría subirla más rápido a mi servidor...

Ahora le echo un vistazo, si puedes exportarla en sql mejor :D



no es la base de datos porque si relleno los campos desde el phpmyadmin quedan grabados perfectamente y los muestra el index.php pero cuando voy agregar nuevos datos desde el index.php no quedan grabados

como dato les digo que no se aconseja a usar php_self

No tienes permitido ver los links. Registrarse o Entrar a mi cuenta

No tienes permitido ver los links. Registrarse o Entrar a mi cuenta
no es la base de datos porque si relleno los campos desde el phpmyadmin quedan grabados perfectamente y los muestra el index.php pero cuando voy agregar nuevos datos desde el index.php no quedan grabados

El error está en la consulta sql (INSERT INTO) y no en la base de datos ¬¬.

Dicho esto, modifica la línea en la que insertas por: 

Código: sql
mysql_query("INSERT INTO servicio (Vendedor) 
   VALUES ('$Vendedor');");


Te debería de funcionar, si te funciona, solo te queda añadir el resto de los campos, como te dije, estaba mal escrita.

Saludos y espero de nuevo tu respuesta.

No tienes permitido ver los links. Registrarse o Entrar a mi cuenta
como dato les digo que no se aconseja a usar php_self

No tienes permitido ver los links. Registrarse o Entrar a mi cuenta

T_T, gracias por avisar, sinceramente nunca había oido hablar de ese tipo de xss...

Un saludo.



no sirve coloco como dices

Código: php
		 mysql_query("INSERT INTO servicio(Vendedor,Semana,QuienPago,Proveedor,Fecha,Control,Adelanto,Cotizacion,Año,Tipo,Cliente,Descripcion,Factura,MontoTotal,MontoTotal2,Factura2) 
VALUES (('$Vendedor'),('$Semana'),('$QuienPago'),('$Proveedor')('$Fecha'),('$Control'),('$Adelanto'),('$Cotizacion'),('$Año'),('$Tipo'),('$Cliente'),('$Descripcion'),('$Factura'),('$MontoTotal'),('$MontoTotal2'),('$Factura2');");

No tienes permitido ver los links. Registrarse o Entrar a mi cuenta
no sirve coloco como dices

Código: php
		 mysql_query("INSERT INTO servicio(Vendedor,Semana,QuienPago,Proveedor,Fecha,Control,Adelanto,Cotizacion,Año,Tipo,Cliente,Descripcion,Factura,MontoTotal,MontoTotal2,Factura2) 
VALUES (('$Vendedor'),('$Semana'),('$QuienPago'),('$Proveedor')('$Fecha'),('$Control'),('$Adelanto'),('$Cotizacion'),('$Año'),('$Tipo'),('$Cliente'),('$Descripcion'),('$Factura'),('$MontoTotal'),('$MontoTotal2'),('$Factura2');");


Prueba como te he pasado, con un solo campo...

Elimina toda tu sentencia y pon esta:

Código: sql
mysql_query("INSERT INTO servicio (Vendedor) 
   VALUES ('$Vendedor');");


Y funciona porque a mi me ha ido...

Un saludo.



si funciono, el problema ahora es porque no funciona con los demas campos?

No tienes permitido ver los links. Registrarse o Entrar a mi cuenta
si funciono, el problema ahora es porque no funciona con los demas campos?

Ahora ves probando añadiendo de uno en uno, y sabrás donde está el error, seguramente escribas algo mal que no vemos o cualquier cosa :S

Un saludo.



la cosa pasa cuando agrego las demas cosas despues de "proveedor" osea solo me agarra esos 4 campos cuando agrego fecha de ahi en adelante no guarda nada