Results 1 to 6 of 6

Thread: The Script doesnt function please help

  1. #1
    Join Date
    Feb 2006
    Posts
    78
    Thanks
    2
    Thanked 0 Times in 0 Posts

    Angry The Script doesnt function please help

    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
    Last edited by Sikky; 03-05-2007 at 07:08 AM.

  2. #2
    Join Date
    Aug 2005
    Location
    Other Side of My Monitor
    Posts
    3,494
    Thanks
    5
    Thanked 105 Times in 104 Posts
    Blog Entries
    1

    Default

    Your host is using a mailer script for this (not really needed), but you need to set your variables.

    this link 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.
    {CWoT - Riddle } {Freelance Copywriter} {Learn to Write}
    Follow Me on Twitter: @InkingHubris
    PHP Code:
    $result mysql_query("SELECT finger FROM hand WHERE id=3");
    echo 
    $result

  3. #3
    Join Date
    Feb 2006
    Posts
    78
    Thanks
    2
    Thanked 0 Times in 0 Posts

    Default

    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

  4. #4
    Join Date
    Sep 2006
    Location
    St. George, UT
    Posts
    2,769
    Thanks
    3
    Thanked 157 Times in 155 Posts

    Default

    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.
    "Computer games don't affect kids; I mean if Pac-Man affected us as kids, we'd all be running around in darkened rooms, munching magic pills and listening to repetitive electronic music." - Kristian Wilson, Nintendo, Inc, 1989
    TheUnlimitedHost | The Testing Site | Southern Utah Web Hosting and Design

  5. #5
    Join Date
    Feb 2006
    Posts
    78
    Thanks
    2
    Thanked 0 Times in 0 Posts

    Default

    Thanks but I dont have any .ini my website is being hosted in America and I live in Switzerland

  6. #6
    Join Date
    Sep 2006
    Location
    St. George, UT
    Posts
    2,769
    Thanks
    3
    Thanked 157 Times in 155 Posts

    Default

    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.
    "Computer games don't affect kids; I mean if Pac-Man affected us as kids, we'd all be running around in darkened rooms, munching magic pills and listening to repetitive electronic music." - Kristian Wilson, Nintendo, Inc, 1989
    TheUnlimitedHost | The Testing Site | Southern Utah Web Hosting and Design

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •