This is the full script and the form is flash based.
galTitle = $_POST['galTitle'];
$tempID = $_POST['tempID'];
$galDate = date("Y-m-d");
//-------------------------//
$query = mysql_query("INSERT INTO gallery (gal_title, gal_date)VALUES('$galTitle','$galDate')");
$result = $query;
if (!$result) {
fail("Couldn't add gallery to database");
}
$moveID = mysql_insert_id();
//----------------------------------//
if($result){
if ($handle = opendir("../media/gallery/")) {
$i=0;
while (false !== ($file = readdir($handle))) {
if ($file != "." && $file != "..") {
echo substr_count($file, $tempID.'__thumb.jpg');
if(substr_count($file, $tempID.'__thumb.jpg')==1){
rename($file, "../media/gallery/".$moveID.'_thumb.jpg')
}else{
$i++;
}
}
}
closedir($handle);
}
}
echo "&retval=1&";
This does nothing and returns nothing.
If i remove the read dir then the data inputs to the database.
I thought i might be an error in the code but no errors are appearing in the output
galTitle = $_POST['galTitle'];
$tempID = $_POST['tempID'];
$galDate = date("Y-m-d");
//-------------------------//
$query = mysql_query("INSERT INTO gallery (gal_title, gal_date)VALUES('$galTitle','$galDate')");
$result = $query;
if (!$result) {
fail("Couldn't add gallery to database");
}
$moveID = mysql_insert_id();
//----------------------------------//
echo "&retval=1&";