thanks, now I get the following error:
Parse error: parse error, unexpected T_VARIABLE in \\filer01\soho\rebbeca.info\www.rebbeca.info\web\content\newsite\pages\csssite\dlalbum.php on line 3
I looked up ob_Start and it looks like there should be something in brackets after the ob_Start, is this the case?
Just as an update, here is what the php file is now looking like:
<?
ob_start
$errors = 0;
$ref = $_SERVER['HTTP_REFERER'];
$email = $_POST['YPML0'];
$mobile = $_POST['YPML1'];
$location = $_POST['YPML2'];
$wherehear = $_POST['YPML3'];
$favesong = $_POST['YPML4'];
echo $errors = 0;
echo $ref;
echo $email;
echo $mobile;
echo $location;
echo $wherehear;
echo $favesong;
// User entered email on form?
if(!$email || strlen($email = trim($email)) == 0){
$errors += 1;
}
// Checks to see if email address is of valid type
$regex = "^[_+a-z0-9-]+(\.[_+a-z0-9-]+)*"
."@[a-z0-9-]+(\.[a-z0-9-]{1,})*"
."\.([a-z]{2,}){1}$";
if(!eregi($regex,$email)){
$errors += 1;
}
// User entered location?
if(!$location || strlen($location = trim($location)) == 0){
$errors += 1;
}
// User entered where they heard about rebbeca?
if(!$wherehear || strlen($wherehear = trim($wherehear)) == 0){
$errors += 1;
}
// User entered their fave song?
if(!$favesong || strlen($favesong = trim($favesong)) == 0){
$errors += 1;
}
// If any errors were returned go back to the form
if ($errors > 0) {
header("location: ".$ref);
exit();
}
// Construct email
$to = "info@rebbeca.info";
$from = "From: Rebbeca <album@rebbeca.info>\n";
$subject = "Album Downloaded!";
$body = "E-mail address: ".$_POST['YPML0']."\n";
if ($_POST['YPML1']) {
$body .= "Mobile number: ".$_POST['YPML1']."\n";
}
$body .= "Location (city / country): ".$_POST['YPML2']."\n";
$body .= "First heard about Rebbeca: ".$_POST['YPML3']."\n";
$body .= "Favourite Song: ".$_POST['YPML4']."\n";
// Send it
mail($to,$subject,$body,$from);
// Commence download
header('Content-Type: application/octet-stream');
header('Content-Disposition: attachment; filename="musicbynumbers.zip"');
@readfile("http://www.rebbeca.info/music-by-numbers/musicbynumbers.zip");
?>
Thanks