the following code isn't working for me...it isn't updating the database, and it isn't renaming the file locally...any idea why?
firstfile.php
<?
$filename = "title.txt";
$fd = fopen ($filename, "r");
$title = fread ($fd, filesize ($filename));
echo "";
echo "<title>$title</title>";
echo "<body>";
?>
<head>
<title>Untitled Document</title>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
</head>
<body bgcolor="#FFFFFF" text="#000000">
<form name="form1" method="post" action="rename.php">
<p> </p>
<p>Old filename (ex: filename.html)
<input type="text" name="oldfile">
<br>
New filename (ex: newfile.html)
<input type="text" name="newfile">
<br>
<input type="submit" name="Submit" value="Change Filename">
</p>
</form>
</body>
rename.php
<?
$linkID = mysql_connect("host", "user", "pass");
mysql_select_db("db", $linkID);
$result = mysql_query("UPDATE filemanager SET userfile = \"$newfile\" WHERE userfile = \"$oldfile\" AND title = \"$title\"", $linkID);
rename("$oldfile", "$newfile");
if ($result == TRUE)
{
print "The filename was changed succesfully.<p>";
}
else
{
print "The filename could not be changed, contact admin<p>";
}
?>