The problem I am having is uploading mp3's. A friend of mine fixed this once and said that the problem was that the code said it could only upload wav files. Now it's not working again and I think for some reason it went back to the old version. Now when I try to upload an mp3 it says you must upload an mp3. You can go to
and look for youself. Anyways here is the code. Thank you to whoever can help.
<?
$f = $_FILES['song'];
$pp = $_REQUEST;
if (($f['type'] == "application/octet-stream" || $f['type'] == "audio/mpeg") && strpos($f['name'], '.mp3')) {
if ($f['error'] == false) {
$name = str_replace(array(' ', '"', "'", ',', '.', '/', '\\', '?', "\t", "\n"), '_', $f['name']) . '.mp3';
$result = move_uploaded_file($f['tmp_name'], "./music/$name");
if (!$result) {
$message = "<li>An error occurred while moving your song into the music folder. This is probably an error with our systems. Please try your submission again later.";
}
} else {
$message = '<li>The following error occurred while uploading: ' . $f['error'];
}
} else {
$message = "<li>You must upload an MP3 song!";
}
if ($message) {
$message = "<ul>$message</ul>";
$url = "step3.php?";
foreach($pp as $key => $value) {
$url .= "$key=$value&";
}
$url .= "message3=$message";
header("Location: $url");
} else {
$valid = "fnamelnameaddresszipcitystateagreeemailbandartworktitle";
foreach ($pp as $key => $value) {
if (strpos($valid, $key) !== false) {
$$key = stripslashes($value);
}
}
$now = date ("g:i m/d/y");
require('db.php');
$result = mysql_query("insert into data (fname, lname, bandname, email, address, city, state, zip, title, songfile, imgfile, date)
values ('$fname', '$lname', '$band', '$email', '$address', '$city', '$state', '$zip', '$title', '$name', '$artwork', '$now')");
if (!$result) {
echo "Failed inserting information to database!";
}
mail ('Jacob <jsattleen@gmail.com>', 'Missle Records Song Submission', "Hey Jacob! Another band named '$band' submitted a song to the site! Click the link below
to see details on this submission!\r\n\r\nhttp://www.qsic.net/uploadform/review.php?p=23n8nd339djdj93dj", "From: Missle Records <nobody@qsic.net>");
}
?>
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN"
"http://www.w3.org/TR/html4/strict.dtd">
<html>
<head>
<title>Your Title Here</title>
<style type="text/css">
body {
background-color: #999;
font: 12pt Arial;
}
div#cFloat {
margin: 25px auto;
padding: 10px;
border: 1px Solid #666;
color: #333;
background-color: #ccc;
font: inherit;
text-align: center;
width: 500px;
}
i {
font-size: 80%;
}
a {
color: #a04;
text-decoration: none;
}
a:hover, a:active {
text-decoration: underline;
}
</style>
</head>
<body>
<div id="cFloat">
Submit Your Music to Missle Records: <i>(finished)</i><br><br>
<b>Thanks for your submission!</b><br>
We will review your submission and contact you shortly!<br>
<br>
<a href="/">Main</a>
</div>
</body>
</html>