SitePoint Sponsor

User Tag List

Results 1 to 4 of 4

Thread: Feedback form!!

  1. #1
    SitePoint Enthusiast
    Join Date
    Oct 2000
    Location
    Location:
    Posts
    94
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Hi all, I've a small problem with my feedback form!

    I have devised a simple feedback form which visitors to my site can use to e-mail me with any comments they have.

    However every time I test it to see if it works, I get the following message:

    Warning: Failed to Connect in C:\phpdev2\www/do_sendfeedback.php on line 14

    The error is pointing to line 14 of the sendfeedback.php file. Line 14 of that file is the following:

    mail("Koncise20@hotmail.com", "Feedback Form", $msg, $mailheaders);

    I don't understand why I get this message, can u possibly explain it??


    Here is the full php script for the feedback form:

    <?php

    $msg = "Sender's Full Name:\t$sender_name\n";
    $msg .= "Sender's E-Mail:\t$sender_email\n";
    $msg .= "Did You like the Site?:\t$like_site\n";
    $msg .= "Additional Message:\t$message\n\n";

    // use two newline characters at the end of the content,
    // or to insert additional spacing

    $mailheaders = "From: My Web Site\n";
    $mailheaders .= "Reply-To: $sender_email\n\n";

    mail("Koncise20@hotmail.com", "Feedback Form", $msg, $mailheaders);

    echo "<H1 align=center>Thank You, $sender_name</H1>";
    echo "<P align=center>We appreciate your feedback.</P>";

    ?>

    I'm really lost here, whats wrong with line 14??

    Can anybody please help!?!

    Thanx very much!


    K.

  2. #2
    SitePoint Evangelist mad-onion's Avatar
    Join Date
    Aug 2000
    Location
    Land of the long white cloud
    Posts
    556
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Im just gunna take a stab in the dark..but are you testing it on your local machine???
    If so upload it then it should work.

    What it means is that php cant find the outgoing mail facilities to send mail.
    Hence the error "failed to connect"

    Try putting it on a webhosts servers then you shouldnt see the error!..
    SiteOptions >> Services :: Products :: Contact
    Developers of PHP, C++, Visual Basic, MySQL, and more!

  3. #3
    SitePoint Enthusiast
    Join Date
    Oct 2000
    Location
    Location:
    Posts
    94
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Hi Mad-Onion!

    Thanx for replyin' to my request!

    To answer your question, yes I am running it off my local machine. But I was online when I tested the script, surely it should have worked then!

    I have signed up to a free webhost who supports mysql and php. So your saying I have to load up the script on their server before I can use it?? Ok I'll try that.


    thanx,

    K.

  4. #4
    SitePoint Zealot
    Join Date
    Jul 2000
    Posts
    132
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Koncise,
    i'll reply here instead of to the email.
    I presume you have a seperate page with a form on, and the action would be 'do_sendfeedback.php'.

    The actual code looks fine to me, so yes, you just need to upload to a webhost which allows you to run php scripts.

    Even though you were online when you executed the script, it still processed through your machine. And on your PC, you dont' have a 'sendmail' program.
    I also asked this question ages ago when experimenting with the mail function!

    -AJ


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
  •