hello,
I have problem with my code
I want to retrieve data from the html form and store them to the database
my problem i think is with .php file
<?php
require('config.php');
mysql_select_db("application") or die("cannot select db");
// post from the form upload.html
$Pname = $_POST['Pname'];
$Dname = $_POST['Dname'];
$SysReq = $_POST['SysReq'];
//$Category = $_POST['Category'];
$Desc = $_POST['Desc'];
//$GLOBALS['$Pname'];//, $Dname , $SysReq , $Category , $Desc
// TO INSERT A NEW PROJECT
//$sql = "INSERT INTO app (Pname , Dname , SysReq , Desc) VALUES('$Pname', '$Dname', '$SysReq', '$Desc')";
//$sql = "INSERT INTO app (id, Pname , Dname , SysReq , Category, Desc)VALUES (2, 'fati', 'fati', 'fati', 'fati' , 'fati')";
$sql = "INSERT INTO \'application\'.\'app\' (\'id\', \'Pname\', \'Dname\', \'SysReq\', \'Category\', \'Desc\') VALUES (\'\', \'fati\', \'fati\', \'fati\', \'fati\', \'fati\');";
mysql_query($sql);
//mysql_query("INSERT INTO app (id, Pname , Dname , SysReq , Category, Desc)VALUES (2, 'fati', 'fati', 'fati', 'fati' , 'fati')");
mysql_close($con);
//if (!$result)
//echo "unsuccessfull insert";
// THE FOLLOWING CODE UPDATES THE DB
/*function EditApp(){
$sqlSELECT = "SELECT Pname, Dname FROM app WHERE Pname =='$Pname' && Dname == '$Dname' ";
$sqlSELECT = mysql_query($sql);
mysql_fetch_array($sql);
if(mysql_fetch_array($sql))
{
$sql = "INSERT INTO APP (name , username, pswrd, email) VALUES ('$Pname' , '$Dname' , '$SysReq' , '$Category' , '$Desc')";
$insert=mysql_query($sql);
}
}
*/
?>
this is the html file
<table><form name="Add" method="post" action="AddApp.php">
<tr >
<td>
</td>
</tr>
<tr>
<td>
<label> Project's Name </label>
</td>
<td>
<input type="text" name="Pname" />
</td>
</tr>
<tr>
<td>
<label> Developer's Name</label>
</td>
<td>
<input type="text" name="Dname"/>
</td>
</tr>
<tr>
<td>
<label> system requirements</label>
</td>
<td>
<textarea name="SysReq"></textarea>
</td>
</tr>
<tr>
<td>
<label> Category </label>
</td>
<td>
<input type="radio" name="Category" value="App" /> Application <br />
<input type="radio" name="Category" value="Game" /> Game <br />
<input type="radio" name="Category" value="Edu" /> Edutainment <br />
</td>
</tr>
<tr>
<td>
<label> Description </label>
</td>
<td>
<textarea name="Desc"></textarea>
</td>
<tr>
<td>
</td>
<td>
<input type="submit" value="Submit" />
</td>
</tr></form>
<tr>
<td>
<label> screen shots </label>
</td>
</tr>
<form enctype="multipart/form-data" action="uploader.php" method="POST">
<input type="hidden" name="MAX_FILE_SIZE" value="100000" />
<tr>
<td>
Choose a file to upload:
</td>
<td>
<input name="uploadedfile" type="file" /><br />
</td>
</tr>
<tr>
<td>
<input align="right" type="submit" value="Upload File" />
</td>
</tr>
</form>
</table>
please help
thank you