actually, i'm a newbie in php...i'd like to ask you guys.....how to display back all the data from the database for these coding....here's the coding....
($_POST ['action'] == 'pointofcontact'){
$projectid = $_POST['projectid'];
$poc = '';
//echo "Pastikan pilihan anda betul!!<br><br>";
for ($i=1; $i <= 3; $i++){
$poc = 'poc' . $i;
$poc2 = $_POST[$poc];
if (!empty($poc2)){
$query = "insert into projectcontact set resourcesid = '$poc2', projectid = '$projectid'";
$result = mysql_query($query);
$projectid = $_POST['projectid'];
}
//echo $poc2."<br>";
}
if ($result){
header ('Location: createproject.php?action=projectmanager&projectid='. $projectid);
}
and number 2 is this :-
else if ($_POST ['action'] == 'uploaddownload'){
$projectid = $_POST['projectid'];
$docname = $_POST['docname'];
$remarks = $_POST ['remarks'];
$query = "insert into user_upload set docname= '$docname' , remarks = '$remarks' '";
$result = mysql_query ($query);
if ((($_FILES["file"]["type"] == "image/gif")
|| ($_FILES["file"]["type"] == "image/jpeg")
|| ($_FILES["file"]["type"] == "image/pjpeg"))
&& ($_FILES["file"]["size"] < 20000))
{
if ($_FILES["file"]["error"] > 0)
{
echo "Return Code: " . $_FILES["file"]["error"] . "<br />"; // $_FILES["file"]["error"] - the error code resulting from the file upload
}
else
{
echo "Upload: " . $_FILES["file"]["name"] . "<br />"; // $_FILES["file"]["name"] - the name of the uploaded file
echo "Type: " . $_FILES["file"]["type"] . "<br />"; // $_FILES["file"]["type"] - the type of the uploaded file
echo "Size: " . ($_FILES["file"]["size"] / 1024) . " Kb<br />";//$_FILES["file"]["size"] - the size in bytes of the uploaded file
echo "Temp file: " . $_FILES["file"]["tmp_name"] . "<br />";// $_FILES["file"]["tmp_name"] - the name of the temporary copy of the file stored on the server
if (file_exists("upload/" . $_FILES["file"]["name"]))
{
echo $_FILES["file"]["name"] . " already exists. ";
}
else
{
move_uploaded_file($_FILES["file"]["tmp_name"],
"upload/" . $_FILES["file"]["name"]);
echo "Stored in: " . "upload/" . $_FILES["file"]["name"];
}
}
}
else
{
echo "Invalid file";
}
}
i wantto display these two element....thanks in advance.....