//if(trim($image)=='' || strlen(trim($image)) <2 || strlen(trim($image))>10000){$bob='1'; }
if ($bob== "1")
{//1 if the submitted data was wrong redisplay form
header("Location:your_systems.php?email=$email&name=$name");
exit();
}//1
else
{//1 otherwise the submitted data was ok, save to mysql
move_uploaded_file($_FILES['imagefile']['tmp_name'],"latest.img");
$instr = fopen("latest.img","rb");
$image = addslashes(fread($instr,filesize("latest.img")));
$status = 'pending';
if (strlen($instr) < 149000)
{ //2 if the file is the right size insert it
mysql_query ("insert into your_systems (title, imgdata, date, email, status) values (
\"".$_REQUEST[whatsit]."\",
\"".$image."\",
NOW(),
\"".$email."\",
\"".$status."\")");
//BELOW IS LINE 35
header("Location:your_systems_finish.php?email=$email&name=$name&image=$image&msg=1");
exit();
}//2
else
{//2 otherwise the image is too big
header("Location:your_systems_finish.php?email=$email&name=$name&image=$image&msg=0");
exit();
}//2
}//1
Ive highlighted line 35 where the error occurrs in the above code. There is a header(location) prior to the one at line 35 but the user should only ever encounter 1 header as they are all seperated by if/ else if statments. Anybody got any ideas?
__________________ Please login or register to view this content. Registration is FREE - Latest Articles: Please login or register to view this content. Registration is FREE , Please login or register to view this content. Registration is FREE
Yes you are right. $image didn't hold a value, i deleted it from the url and now it works. I didn't know you had to put the whole url into the header, i will do that too. Thanks
You may not have spaces in vars you put in the $location beneath, so do this:
$location = ereg_replace( ' +', '%20', $location );
header("Location:$location");
This error was generated after a migration to PHP5.
« Reply to Warning: Header may not contain more than a single header, new line detected???