Hello, I'm fairly new to PHP and the web classes that I took in school touched very lightly on the subject, but nothing really in depth. I have a new client who's site is incorporating some really complex PHP scripting (well at least to me anyway). He requires a script that will take an uploaded image from a form, rename it then move the file with the new name to a corresponding folder. Below I have a script that seems to work on a Mac at my school with a Linux server, but doesn't seem to work on my Windows PC at the office with a XAMPP test server nor on my clients hosting server which is a Windows server (go figure). If someone can please help me out it would be greatly appreciated and thank you in advance. If the form is required to try and troubleshoot this problem please let me know and I'll provide it to you.
//host, username, and password are missing for security purposes.
mysql_connect("$host", "$username", "$password")or die("cannot connect");
mysql_select_db("$db_name")or die("cannot select DB");
$ftype = $_FILES['fileUpload']['type'];
$file_name = $_FILES['fileUpload']['name'];
$new_file_name=$_POST['fName'].' '.$_POST['mName'].' '.$_POST['lName'].' | '.$file_name;
$insert = "INSERT INTO yearbook (fileUpload, fName, mName, lName, chapter, year1, address, city, state, zip, email, month, year2, business, title, skills, interests)
$add_yearbook = mysql_query($insert);
<div id="subHeaderText"><small>Yearbook info has been uploaded successfully...</small></div>
<div id="subHeaderText" align="right"><small><a href="index.php">Back to home...</a></small></div>
<div id="subHeaderText"><small>Yearbook info was not uploaded successfully. <u>Please double-check the file format type.</u></small></div>