No input file error

design

#1

When I try to run this script it is returning a “No file specified” error. The script has run fine in the past.

[code]<?php

/*
This file scans the tmp directory for mp3 files that have been uploaded to the server,
but have not yet been entered into the database then processes the file, enters the data
into the database, and moves the file from the tmp folder to the sermons folder.
*/
echo “Welcome!”;
ini_set (‘display errors’, 1);
error_reporting (E_ALL);

//Get the necessary files for retrieving id3 data and create a new instance for the data
require_once(’…/getid3/getid3/getid3.php’);
$getID3 = new getID3;
echo “ID3 initiated”;

//Connect to the database
mysql_connect (’’, '’, ‘*’); //or die (“Could not connect to the server.” . mysql error());
mysql_select_db (‘flcc’) or die (“Unable to select the database” . mysql_error());

//Begin retrieving info from the files
$dir = ‘tmp’;
$result = scandir ($dir);
echo “$dir scanned”;
foreach ($result as $file)
{
//Determine that the file is an mp3
if (substr(strrchr($file, “.”), 1) == “mp3”)
{
//Set variables for SQL entry
print “File is ok \n”;
//The path of the current file
$path_to_file = “$dir/$file”;

//Analyze the file info
$fileinfo = $getID3->analyze($path_to_file);

//Set the Title of the sermon from the “title” field
$title = addslashes($fileinfo[‘id3v2’][‘comments’][‘title’][0]);

//Who Gave the message?
$author = $fileinfo[‘id3v2’][‘comments’][‘artist’][0];

//Determine file size and convert to MB
$size = $fileinfo[‘filesize’];
$size /= 1048576;
$size = round($size, 1);

//The comments field contains the date the message was given
$comments = $fileinfo[‘id3v2’][‘comments’][‘comment’][0];

//Set the location of the file
$path = addslashes(“sermons/$file”);

//Format the query for entry into the database
$query = “INSERT INTO sermon_index (sermon_id, path, title, author, date_entered, date_given, size)
VALUES (0, ‘$path’,’$title’, ‘$author’, NOW(), ‘$comments’, ‘$size’)”;

//Submit the query
if (mysql_query ($query))
{
print “entered $title into the database\n”;
}
else
{
mysql_error();
}

//Prepare to move the file from “tmp” to “sermons” folder
$newname = “sermons/$file”;

//Move the file to the Sermons folder
rename ("$path_to_file", “$newname”) or die (“Could not move file”);
}
}

//close the mysql connection
mysql_close();
?>
[/code]


#2

While I can’t confirm it’s system-wide, because PHP works under another account of mine, I did file a ticket a few hours ago with the same problem. None of my php-based scripts work under my primary account.

For reference, that’s what my error.log displays.
Definitely a very odd situation either way… looking forward to see what support has to say about it :slight_smile:


#3

Well, the whole site is run on PHP, and the main pages are working alright. It’s just this script as far as I know.