Everybody! This is important. In a few days, these forums will be moving over to using the totally sweet Discourse platform. To ensure this migration happens smoothly with no loss of content, these forums are currently in a read-only mode. I do apologize for the inconvenience.

There is never a good time to turn the forums off for an extended period of time, but I promise the new forums will be a billion times better. I'm pretty sure of it.

See you all on the other side in a few days, and if you have any (non-technical) questions, please e-mail me at kirupa@kirupa.com. For technical questions, try to find a tutorial that corresponds to what you are looking for and post in the comments section of that page.


Results 1 to 3 of 3

Thread: Contact Form

  1. #1

    Afrostyle Contact Form

    Hi i am making a website and i'd like a contact form on there
    i have all off the forms layed out on my page and i took
    this from a tutorial i found and edited it, im no programmer,
    but could somebody please take a look at this for me please.

    also id like to add a upload and browse button to my site
    if anybody can help with that too id appreciate it alot.

    thanks, heres the code;


    $headers = "MIME-Version: 1.0\r\n";
    $headers .= "Content-type: text/html; charset=iso-8859-1\r\n";
    echo"no email address found";
    $senderName = $_POST['senderName'];
    $senderSurName = $_POST['senderSurName'];
    $senderEmail = $_POST['senderEmail'];
    $senderMsg = nl2br($_POST['senderMsg']);
    $senderSex = $_POST['senderSex'];
    $senderPhne = $_POST['SenderPhne'];
    $senderRpl = $_POST['senderRpl'];
    $sitename = "BC Fit Future";
    $to = "benchibnall_pt@hotmail.com";
    $ToName = "Ben Chibnall";
    $date = date("m/d/Y H:i:s");
    $ToSubject = "Email From $senderName via $sitename";
    $comments = $msgPost;
    $EmailBody = "A visitor to $sitename has left the following information<br />
    Sent By: $senderName
    <br /><br />
    Message Sent:
    <br />$senderMsg<br /><br />
    Sex: $senderSex<br /><br />
    Require reply: $senderRpl
    <br />
    <br />
    <br />$senderPhone<br />;
    $senderPhne = $_POST['senderPhne'];"
    $EmailFooter = "<br />Sent: $date<br /><br />";
    $Message = $EmailBody.$EmailFooter;
    $ok = mail($to, $ToSubject, $Message, $headers . "From:$senderName <".$to.">");
    echo "retval=1";
    echo "retval=0";


  2. #2
    Not clear what exactly is the error that you are getting. Are you not getting the email on form submission?

    I would suggest updating this way:
    PHP Code:
    $headers .= "$to\r\n";

    $ok mail($to$ToSubject$Message$headers); 
    The following links might be help:
    Email form with file attachment in PHP

    PHP email contact form

  3. #3
    hi im not getting a error but its not actually sending the e-mail,
    i will check out the links u gave me thanks for your help,
    so do you think this php looks ok?

Thread Information

Users Browsing this Thread

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

Tags for this Thread

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


Copyright 1999 - 2012