Code: Select all
<input type=hidden name="dato" value="<?PHP ECHO ('F d Y'); PHP?>"></input>What am i doing wrong here<?PHP ECHO ('F d
Moderator: General Moderators
Code: Select all
<input type=hidden name="dato" value="<?PHP ECHO ('F d Y'); PHP?>"></input>What am i doing wrong here<?PHP ECHO ('F d
Code: Select all
php echo date('F d Y'); // tried this.and how would i do that.?markl999 wrote: Though doing that in a hidden field seems a bit pointless as you could just get the date on the receiving page (i.e the page in action=" ... ")
*shrug*
Code: Select all
<form action="{$_SERVER['PHP_SELF']}" method="post>Code: Select all
function process_form()
{
$dato = date('F d Y');
$query ="INSERT INTO pongo (Empresa, dato, Codigo, Paqnr,
Desde, Envio, information, comentario, peso_total, peso, Valor) VALUES ('".$_POST['Empresa']."','".$_POST['Codigo']."','".$_POST['Paqnr']."','".$_POST['Desde']."','".$_POST['Envio']."','".$_POST['Information']."','".$_POST['Comentario']."','".$_POST['Peso_Total']."','".$_POST['Peso']."','".$_POST['Valor']."', $dato)";Code: Select all
'"$dato"')"Code: Select all
$query ="INSERT INTO pongo (Empresa, dato, Codigo, Paqnr,
Desde, Envio, information, comentario, peso_total, peso, Valor) VALUES ('".$_POST['Empresa']."','".$_POST['Codigo']."','".$_POST['Paqnr']."','".$_POST['Desde']."','".$_POST['Envio']."','".$_POST['Information']."','".$_POST['Comentario']."','".$_POST['Peso_Total']."','".$_POST['Peso']."','".$_POST['Valor']."', '$dato')";
echo $query; //for debugging purposes
mysql_query($query) or die(mysql_error());which is the query line.Parse error: parse error, unexpected T_VARIABLE in on line 73
Code: Select all
"'. $dato .'"Notice: Undefined index: dato on line 73
Notice: Undefined variable: dato on line 73
INSERT INTO pongo (Empresa, dato, Codigo, Paqnr, Desde, Envio, information, comentario, peso_total, peso, Valor) VALUES ('111','','1111','11','11','1','1','1','111','1','11','')Column count doesn't match value count at row 1
Code: Select all
function process_form()
{
$dato = date('Y d F');
// are all these values going into the field PONGO or is pongo the table name? if it's the table name, instead of the table name put field names like i've done
$query ="INSERT INTO pongo (Empresa, Codigo, Paqnr, Desde, Envio, information, comentario, peso_total, peso, Valor, dato) VALUES ('".$_POST['Empresa']."','".$_POST['Codigo']."','".$_POST['Paqnr']."','".$_POST['Desde']."','".$_POST['Envio']."','".$_POST['Information']."','".$_POST['Comentario']."','".$_POST['Peso_Total']."','".$_POST['Peso']."','".$_POST['Valor']."','".$dato."')";
// echo $query; //for debugging purposes