i am able to upload this file:
<?php
require('db_connect.php');
?>
<html>
<head>
<title>add to test2</title>
</head>
<body>
<?php
if (isset($_POST['submit']))
{
$Name = $_POST['name'];
$add_member = $db_object->query($insert_in_table);
if (DB::isError($add_member))
{
die($add_member->getMessage());
}
$db_object->disconnect();
?>
<h1>Added to test1</h1>
<p>
Thank you, your information has been added to the database,
</p>
<?php
}
else
{
?>
<h1>Test1</h1>
<form action="<?php echo $_SERVER['PHP_SELF']; ?>" method="post">
<table align="center" border="1" cellspacing="0" cellpadding="3">
<tr>
<td>Name*:</td>
<td>
<input type="text" name="name" maxlength="60">
</td>
</tr>
<tr>
<td colspan="2" align="right">
<input type="submit" name="submit" value="Sign Up">
</td>
</tr>
</table>
</form>
<?php
}
?>
</body>
</html>
but is not able to upload when i add this line
$insert_in_table = "INSERT INTO test2(name) VALUES('$Name')";
like
$Name = $_POST['name'];
$insert_in_table = "INSERT INTO test2(name) VALUES('$Name')";
$add_member = $db_object->query($insert_in_table);
why is this so? any syntax error?