PHP programming forum. Ask questions or help people concerning PHP code. Don't understand a function? Need help implementing a class? Don't understand a class? Here is where to ask. Remember to do your homework!
<?php
include('database.php');
$uploaddir = 'uploads/';
move_uploaded_file ($_FILES['uploadFile'] ['tmp_name'],
"../uploads/{$_FILES['uploadFile'] ['name']}")
//print("File (Probably) uploaded, it will now be Added to the database.");
$uploadfile = $uploaddir . basename($_FILES['uploadFile']['name']); // THIS LINE <<<
//Insert into db
$sql = "INSERT INTO ez_downloads (name,timestamp,description,submit_by,filename) VALUES ('test','2','Test-download','bob123','$uploadedfile')";
$result = mysql_query($sql) or print("Can't upload and store file, please ask an admin for help.<br />" . $sql . "<br />" . mysql_error());
?>
and [syntax="..."] tags where appropriate when posting code. Your post has been edited to reflect how we'd like it posted. Please read: [url=http://forums.devnetwork.net/viewtopic.php?t=21171]Posting Code in the Forums[/url] to learn how to do it too.[/color]
<?php
include('database.php');
$uploaddir = 'uploads/';
move_uploaded_file($_FILES['uploadFile']['tmp_name'], "../uploads/{$_FILES['uploadFile']['name']}");
//print("File (Probably) uploaded, it will now be Added to the database.");
$uploadfile = $uploaddir . $_FILES['uploadFile']['name'];
//Insert into db
$sql = "INSERT INTO ez_downloads (name,timestamp,description,submit_by,filename) VALUES ('test','2','Test-download','bob123','$uploadedfile')";
$result = mysql_query($sql) or print("Can't upload and store file, please ask an admin for help.<br />" . $sql . "<br />" . mysql_error());
?>
and [syntax="..."] tags where appropriate when posting code. Your post has been edited to reflect how we'd like it posted. Please read: [url=http://forums.devnetwork.net/viewtopic.php?t=21171]Posting Code in the Forums[/url] to learn how to do it too.[/color]
//print("File (Probably) uploaded, it will now be Added to the database.");
$uploadfile = $uploaddir . $_FILES['uploadFile']['name'];
//Insert into db
$sql = "INSERT INTO ez_downloads (name,timestamp,description,submit_by,filename) VALUES ('test','2','Test-download','bob123','$uploadedfile')";
$result = mysql_query($sql) or print("Can't upload and store file, please ask an admin for help.<br />" . $sql . "<br />" . mysql_error());
?>
No syntax errors detected in /home/volker/phpdn/test.php