Hi/

Bit new to PHP. I am adding a PHP send file to my FTP but I don't seem to be able to get it to work. Can anyone help?
In dreamweaver I am indicating method of POST with action of sendmail.php and application/x-www-form-urlencoded. I getting line 91 problems.

$headersep = (!isset( $uself ) || ($uself == 0)) ? "\r\n" : "\n" ;
$name = $_POST ;
$email = $_POST ;
$comments = $_POST ;
$http_referrer = getenv( "HTTP_REFERER" );
if (!isset($_POST)) {
header( "Location: $formurl" );
exit ;
}
//added line below to conform with Streamline rules
if (!ini_set("sendmail_from",$_post)){
header( "Location: $errorurl" );
exit ;
}
if (empty($name) || empty($email) || empty($comments)) {
header( "Location: $errorurl" );
exit ;
}
if ( ereg( "[\r\n]", $name ) || ereg( "[\r\n]", $email ) ) {
header( "Location: $errorurl" );
exit ;
}
if (get_magic_quotes_gpc()) {
$comments = stripslashes( $comments );
}
$messageproper =
"This message was sent from:\n" .
"$http_referrer\n" .
"------------------------------------------------------------\n" .
"Name of sender: $name\n" .
"Email of sender: $email\n" .
"------------------------- COMMENTS -------------------------\n\n" .
$comments .
"\n\n------------------------------------------------------------\n" ;
mail($mailto, $subject, $messageproper,
"From: \"$name\" <$email>" . $headersep . "Reply-To: \"$name\" <$email>" . $headersep . "X-Mailer: chfeedback.php 2.07" );
header( "Location: $thankyouurl" );
exit ;
?>

Recommended Answers

All 2 Replies

I don't know. Where's line 91, and how is your code indented?

What's the exact error?

Use [ code ] tags to seperate code from text, that way you don't have to worry about descriptions and things getting in the way.

Many thanks for responding. I have added all the code to a html page added to my site at www.cleanit4me.co.uk/phpcode.html. the red text is row 81. If you run the submit in the site you will see the line fault information which is "Warning: Cannot modify header information - headers already sent by (output started at /home/fhlinux181/c/cleanit4me.co.uk/user/htdocs/chfeedback.php:1) in /home/fhlinux181/c/cleanit4me.co.uk/user/htdocs/chfeedback.php on line 81"

Any help would be welcome.
Many thanks

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.