|
Posted by Spartacus on 06/13/07 18:10
vinnie wrote:
> 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?
>
Maybe the php.ini settings need to allow include files in the "current
directory" or perhaps DB_1.php is not in the same directory as your script?
Spartacus
[Back to original message]
|