コード例 #1
0
        $selectedUserLastName = $selectedUserProfileDetails["last_name"];
        $selectedUserGender = $selectedUserProfileDetails["gender"];
        $selectedUserAddress1 = $selectedUserProfileDetails["address_line1"];
        if (isset($userProfileDetails["address_line2"])) {
            $selectedUserAddress2 = $userProfileDetails["address_line2"];
        } else {
            $selectedUserAddress2 = "";
        }
        $selectedUserCountry = $selectedUserProfileDetails["country"];
        if (isset($userProfileDetails["contact_number"])) {
            $selectedUserContactNumber = $userProfileDetails["contact_number"];
        } else {
            $selectedUserContactNumber = "";
        }
        $cvFilePath = getCVPathByUsername($searchedUsername);
        $projectArray = getProjectsListByUsername($searchedUsername);
    } else {
        redirect_to("search");
    }
    if (isset($connection)) {
        mysql_close($connection);
    }
} else {
    redirect_to("search");
}
?>

<head>
    <title>Be Linked! View user</title>
        <link rel="stylesheet" href="css/layout.css" type="text/css">
        <link rel="stylesheet" href="css/style.css" type="text/css"> 
     if (getProjectDetailsByUsernameAndTitle($username, $projectTitle) == null) {
         $uploadedFileName = $_FILES["projectFile"]["name"];
         $fileExt = end(explode(".", $uploadedFileName));
         if (isset($fileExt) && ($fileExt == "rar" || $fileExt == "zip")) {
             if ($_FILES["projectFile"]["error"] > 0) {
                 $error = "Return Code: " . $_FILES["projectFile"]["error"] . "<br />";
             } else {
                 $fileName = $projectTitle . "." . $fileExt;
                 $directoryPath = "user_projects/" . $username;
                 $finalFilePath = $directoryPath . "/" . $fileName;
                 if (!file_exists($directoryPath)) {
                     mkdir($directoryPath, 0777, true);
                 }
                 move_uploaded_file($_FILES["projectFile"]["tmp_name"], $finalFilePath);
                 manageProject($username, $finalFilePath, $description, $projectTitle);
                 $projectArray = getProjectsListByUsername($username);
             }
         } else {
             $error = "Only .rar and .zip file types are allowed";
         }
     } else {
         $error = "A file with the same project title already exists. Try different project title";
     }
 } else {
     $description = "";
 }
 if (isset($_GET['filePathToDelete'])) {
     $filePathToDelete = $_GET['filePathToDelete'];
     unlink($filePathToDelete);
     deleteProject($filePathToDelete);
     redirect_to("../userProject");