The forums have permanently moved to forum.kirupa.com. This forum will be kept around in read-only mode for archival purposes. To learn how to continue using your existing account on the new forums, check out this thread.

Results 1 to 5 of 5

Thread: PHP contact form

  1. #1

    PHP contact form

    Dear All,

    im trying to build a contact form to send the user data to my mail as this topic ( http://www.kirupa.com/web/php_contact_form.htm )

    any way i tried many times and many forms from many site and by flash and by html and noo wayy its never send

    by the way , my server is support php 5.1.6 ( http://www.mkayyali.com/php/info.php ) and i tried to give a chmod access to my php and html files by make it 777 and also no way , i need to know what is the problem

    link to my contact page ( as kirupa topic ) : ( http://www.mkayyali.com/contact.html )


    Thanks a lot

  2. #2
    1,839
    posts
    Registered User
    lets see your php code?

  3. #3
    here we are


    <?php
    if(isset($_POST['submit'])) {
    $to = "you@you.com";
    $subject = "Form Tutorial";
    $name_field = $_POST['name'];
    $email_field = $_POST['email'];
    $message = $_POST['message'];

    $body = "From: $name_field\n E-Mail: $email_field\n Message:\n $message";

    echo "Data has been submitted to $to!";
    mail($to, $subject, $body);
    } else {
    echo "blarg!";
    }
    ?>

  4. #4
    Quote Originally Posted by kayyali View Post
    here we are


    <?php
    if(isset($_POST['submit'])) {
    $to = "you@you.com";
    $subject = "Form Tutorial";
    $name_field = $_POST['name'];
    $email_field = $_POST['email'];
    $message = $_POST['message'];

    $body = "From: $name_field\n E-Mail: $email_field\n Message:\n $message";

    echo "Data has been submitted to $to!";
    mail($to, $subject, $body);
    } else {
    echo "blarg!";
    }
    ?>
    did you change this to your email?

    Code:
    $to = "you@you.com";

  5. #5
    1,839
    posts
    Registered User
    yeah he did cause it echos the right email in the script for the "info subbmitted..." thing

    really not sure why its not working it looks right to me ive done lots of mail scripts...

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Posting Permissions

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

Home About kirupa.com Meet the Moderators Advertise

 Link to Us

 Credits

Copyright 1999 - 2012