Click to See Complete Forum and Search --> : [RESOLVED] Simple Mail Form Trouble


jbresette
02-29-2008, 07:28 AM
Warning: Cannot modify header information - headers already sent by (output started at .............................................line 11
......................................................................line 19



<?php
$from = $_REQUEST['name'] ;
$viewVideo = $_REQUEST['viewVideo'];
$message = 'Was the user able to view the video: ';


mail( "cbresette@vtti.vt.edu", "Driver Tips View Video Confirmation",
$message.$viewVideo,$from);
header( 'Location: thankyou.html' );
?>

Here is the form code

<form method="post" action="sendmail.php">
Username: <input name="name" type="text" /><br />
<input checked ="checked" type="radio" name="viewVideo" value="Yes"/> I could view the videos
<br />
<input type="radio" name="ViewVideo" value="No"/> I could not view the videos
<input type="submit" />
</form>

These are in two separate files. The form code is in an html file and obviously the php is in a php file. I am getting an email back back, but it doesn't include the from part. it also gives me that error and doesn't redirect it to my thank you page. Any help would be appreciated. Thanks.

MrCoder
02-29-2008, 07:33 AM
Add this right at the top of your script..

ob_start();

jbresette
02-29-2008, 07:36 AM
It is showing the username now, but is not showing the $viewVideo part that is concatenated with the $message now. It is also still giving me the same error

Warning: Cannot modify header information - headers already sent by (output..............................

MrCoder
02-29-2008, 07:37 AM
http://www.webdeveloper.com/forum/search.php?searchid=2512580