hey
i'm working on the tutorials at the moment but i'm having some problems with passing data from forms to PHP scripts in different files.
ie.
<form action="SQLDB.php" method ="POST">
<input type = "text" name = "add" maxlength="50"><br>
<input type = "submit" value = "add"><br>
</form>
SQLDB.php :
<?php
//make our connection details
$connection = mysql_connect("Hostname" , "user" , "password")
or die ("Cannot make the connection");
//connect to sampledb with our connection details
$db = mysql_selectdb("data1" , $connection)
or die ("Cannot connect to the database");
//if the text field wasnt blank enter data
if(isset($sent))
{
//insert the text box data into the sample table
$sql_query = "INSERT into sample VALUES ('','$POST[add]')";
$result = mysql_query($sql_query);
//display the entered link
echo "You entered the following info " . $POST[add];
}
//if it was blank display a message
else
{
echo ("you didnt enter any data");
}
?>
i have slightly modified it to see if it was a simple problems to get around but i still haven't had any luck...
The problem is that the code returns a negative answer to the sent check and says that no data was sent.
I will say that i have recently installed apache and the PHP files. PHP works generally, i have been able to view Mysql data through PHP and display it on the screen. just cant add...
If anyone can help it would be greatly appreciated.
Cheers From TheKid