|
Posted by vinnie on 06/13/07 16:18
this is my include file that i have uploaded on the server called
DB_1.php
<?php
function connect()
{
// SERVER connection
$con=mysql_connect('host', 'My_user_ID', 'My_Pwd');
// DB selection
$sql=mysql_select_db('Database_name');
}
?>
when i point my browser to www.yyyyyy.com/insert_form.html and i
submit the form, it recalls the follwing file:
<?php
include ("DB_1.php");
// connect();
$query_table="insert into table_name values('$_POST[nome]',
'$_POST[cognome]','$_POST[indirizzo]', '$_POST[telefono]',
'$_POST[cell]','$_POST[email]')";
$insert=mysql_query($query_table) or die(mysql_error());
if (mysql_query($query_table, $con))
{
header ("Location: http://www.yyyyyy.com/thanks.html");
exit;
}
else
{
echo '<br>something went wrong<br>';
}
?>
nothing happens, and no record are added to my database. Why? What
should i change?
Navigation:
[Reply to this message]
|