Log in

View Full Version : The Script doesnt function please help



Sikky
03-03-2007, 12:15 AM
Please here is my script and it doesnt function

<?
$email = $_REQUEST['email'] ;
$message= $_REQUEST['message'];

if (!isset($_REQUEST['email'])) {
header( "Location: http://www.eyes4u.ch/feedback.html" );
}
elseif (empty($email) || empty ($message)) {

header( "Expires: Mon, 19 Feb 2007 01:00:00 GMT" );
header( "Last-Modified: " . gmdate("D, d M Y H:i:s") . " GMT" );
header( "Cache-Control: no-cache, must-revalidate" );
header( "Pragma: no-cache" );


?>

<html>
<head><title>Error</title></head>

<body>
<h1>Error</h1>
<p>
Oops, It looks as if you forgot to enter your email or message. Please press the
back button on your browser and try again.<br />
Thank you

</p></body></html>

<?
}
else {
mail( "info[at]eyes4u[dot]ch", "Feedback Form Results",
$message, "From: $email" );
header( "Location: http://www.eyes4u.ch/thanks.html" );
}
?>


Here is the error I get

Warning: mail() [function.mail]: Failed to connect to mailserver at "localhost" port 25, verify your "SMTP" and "smtp_port" setting in php.ini or use ini_set() in C:\sites\premium4\emory\webroot\sendmail.php on line 34

Warning: Cannot modify header information - headers already sent by (output started at C:\sites\premium4\emory\webroot\sendmail.php:34) in C:\sites\premium4\emory\webroot\sendmail.php on line 35

My hosting which is Brinkster says I can get the answer here but I cant find it
http://kb.brinkster.com/Kb.asp?kb=108154

Here the link to my homepage
http://www.eyes4u.ch/feedback.html

Thank you for your help

BLiZZaRD
03-03-2007, 12:22 AM
Your host is using a mailer script for this (not really needed), but you need to set your variables.

this link (http://kb.brinkster.com/Kb.asp?kb=107593) is the one your host wants you to look at/use.

"localhost" is NOT your mail server in your case it will be mail.eyes4u.ch

Also using multiple headers like you are can confuse the php page. Try to make the if/else statements either all the way at the top (first) or nested properly.

Sikky
03-03-2007, 04:05 PM
I changed the mail server to mail.eyes4u.ch but I still get this error

Warning: mail() [function.mail]: Failed to connect to mailserver at "localhost" port 25, verify your "SMTP" and "smtp_port" setting in php.ini or use ini_set() in C:\sites\premium4\emory\webroot\sendmail.php on line 34

Warning: Cannot modify header information - headers already sent by (output started at C:\sites\premium4\emory\webroot\sendmail.php:34) in C:\sites\premium4\emory\webroot\sendmail.php on line 35

thetestingsite
03-03-2007, 04:47 PM
Warning: mail() [function.mail]: Failed to connect to mailserver at "localhost" port 25, verify your "SMTP" and "smtp_port" setting in php.ini or use ini_set() in C:\sites\premium4\emory\webroot\sendmail.php on line 34


You will have to change the information in your php.ini file to point to your mail server. Currently (according to the above error), it is set to localhost on port 25 (which is the SMTP port). If you don't run your server, then you may have to talk to your host about changing this.

I also believe there is a function (ini_set or something like that) that would allow you to change the ini settings from the script and just for that script. Will have to do some research on that though.

Anyways, hope this helps.

Sikky
03-03-2007, 10:43 PM
Thanks but I dont have any .ini my website is being hosted in America and I live in Switzerland

thetestingsite
03-03-2007, 10:46 PM
And as I said in my previous post,



If you don't run your server, then you may have to talk to your host about changing this.


Hope this helps.