Jump to content

The PHP Headache


MsUndaStood

Recommended Posts

Hello All,

 

I have the most trouble with php, I don't understand it and it makes my head hurt. I finally got my php form to work via smtp on my server @ http://www.25-8media.com/index-2.html. Then I was required to transfer the site over another server, now it gives me this error on the new server:

 

Warning: mail() [function.mail]: Bad parameters to mail() function, mail not sent. in /home/content/l/i/n/lindbergh771/html/contact.php on line 87

 

Warning: Cannot modify header information - headers already sent by (output started at /home/content/l/i/n/lindbergh771/html/contact.php:87) in /home/content/l/i/n/lindbergh771/html/contact.php on line 95

 

The smtp and the ports are the same on both servers the only difference is the email address, which is the only thing that I changed in the entire php document. I attached a copy of the php to this document. I just don't understand why it would stop working with a simple transfer is this beyond me, I am so fustrated!

 

If anyone could help it would be greatly appreciated!

 

[attachment deleted by admin]

Link to comment
https://forums.phpfreaks.com/topic/185969-the-php-headache/
Share on other sites

Ok I just fixed that part of the code and went back to the site which is http://welcometo771.com/index-2.html and refilled out the form with the new php and it still gives me the same error message. =(

 

Ok, looking at your code now you have a bunch of \rn chars within your arguments, these should be \r\n

 

[attachment deleted by admin]

Link to comment
https://forums.phpfreaks.com/topic/185969-the-php-headache/#findComment-982027
Share on other sites

Can you post the relevant code here like everybody else? I'm not overly fond of downloading scripts.

 

No Problem!

 

<?php

 

$to = '[email protected]' ;

 

$subject = "Application Request" ;

 

$formurl = "http://welcometo771.com/index-2.html" ;

 

$errorurl = "http://welcometo771.com/error.html" ;

 

$thankyouurl = "http://welcometo771/index-7.html" ;

 

// -------------------- END OF CONFIGURABLE SECTION ---------------

 

$name = $_POST['name'] ;

 

$email = $_POST['email'] ;

 

$phone = $_POST['phone'] ;

 

$lease=$_POST['lease'] ;

 

$occupants=$_POST['occupants'] ;

 

$year=$_POST['year'] ;

 

$day=$_POST['day'] ;

 

$month=$_POST['month'] ;

 

 

 

$date = $day.'/'.$month.'/'.$year;

 

 

 

$http_referrer = getenv( "HTTP_REFERER" );

 

if (!isset($_POST['email'])) {

 

header( "Location: $formurl" );

 

exit ;

 

}

 

if (empty($name) || empty($email) || empty($phone) || empty($lease) || empty($occupants) || empty($year) || empty($day) || empty($month)) {

 

  header( "Location: $errorurl" );

 

  exit ;

 

}

 

$name = strtok( $name, "\r\n" );

 

$email = strtok( $email, "\r\n" );

 

$phone = strtok( $phone, "\r\n" );

 

$lease = strtok( $lease, "\r\n" );

 

$occupants = strtok( $occupants, "\r\n" );

 

$year = strtok( $year, "\r\n" );

 

$day = strtok( $day, "\r\n" );

 

$month = strtok( $month, "\r\n" );

 

if (get_magic_quotes_gpc()) {

 

$comments = stripslashes( $comments );

 

}

 

$message ="---------- Yoursite.com message ----------\n\n" . "\nSent by : " . $name . "\nEmail : " . $email . "\nSubject : " . $subject ."\nDate : ".$date."\nLength :".$length."\nOccupants : ".$occupants."\n\n\nMessage : " . $comments;

 

ini_set("smtp","smtpout.secureserver.net");

 

ini_set("port","25");

 

ini_set("sendmail_from","[email protected]");

 

 

 

mail($to, $subject, "From: \"$name\" <$email>\r\nReply-To: \"$name\" <$email>\r\nX-Mailer: chfeedback.php 2.04\r\nName : $name\r\nMove in Date : $date\r\nPhone : $phone\r\nLength Lease : $lease\r\nOccupants : $occupants\r\nComments : $comments",$message);

 

 

 

mail($email,"Thanks","From : 771 Lindbergh","Thanks for interest");

 

 

 

header( "Location: $thankyouurl" );

 

 

 

 

 

exit ;

 

?>

 

 

 

 

 

 

Link to comment
https://forums.phpfreaks.com/topic/185969-the-php-headache/#findComment-982034
Share on other sites

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.