I keep getting this error and I do not know why.
Upload form
<?php
require_once 'processor/dbconfig.php';
if(isset($_POST['submit']))
{
if($_FILES['image']['name'])
{
$save_path="newimages"; // Folder where you wanna move the file.
$myname = strtolower($_FILES['image']['tmp_name']); //You are renaming the file here
move_uploaded_file($_FILES['image']['tmp_name'], $save_path.$myname); // Move the uploaded file to the desired folder
}
$hl = $_POST['headline'];
$fd = $_POST['feed'];
$st = $_POST['story'];
$tp = $_POST['type'];
if($user->send($h1,$fd,$st,$tp,$save_path,$myname))
{
echo 'Success';
$user->redirect("input.php");
}
}
?>
<form enctype="multipart/form-data" method="post">
<input type="text" name="headline">
<input type="text" name="feed">
<textarea cols="15" id="comment" name="story" placeholder="Message" rows="10"></textarea>
<input type="text" name="type">
<input type="file" name="image">
<input type="submit" name="submit">
</form>
Here is my SEND function
public function send($hl,$fd,$st,$tp,$save_path,$myname)
{
try
{
$stmt = $this->db->prepare("
INSERT INTO news(headline,feed,story,type,folder,file)
VALUES(:headline, :feed, :story, :type, :foler, :file);
");
$stmt->bindparam(":headline", $hl);
$stmt->bindparam(":feed", $fd);
$stmt->bindparam(":story", $st);
$stmt->bindparam(":type", $tp);
$stmt->bindparam(":folder", $save_path);
$stmt->bindparam(":file", $myname);
$stmt->execute();
return $stmt;
}
catch(PDOException $e)
{
echo $e->getMessage();
}
}
And finally, Here is my Error.
Warning: move_uploaded_file(newimages//var/tmp/phpyctf0k) [function.move-uploaded-file]: failed to open stream: No such file or directory in /nfs/c11/h05/mnt//domains/concept/html/input.php on line 12
Warning: move_uploaded_file() [function.move-uploaded-file]: Unable to move '/var/tmp/phpyctf0K' to 'newimages//var/tmp/phpyctf0k' in /nfs/c11/h05/mnt//domains/concept/html/input.php on line 12
SQLSTATE[HY093]: Invalid parameter number: parameter was not defined
Yes I did create a new folder named newimages as well.