+ Reply to Thread
Results 1 to 5 of 5

Thread: Need Help on a Form

  1. #1
    secretply is offline x10Hosting Member secretply is an unknown quantity at this point
    Join Date
    Sep 2008
    Posts
    50

    Need Help on a Form

    I currently have a form that I have coded in and now need some further help to finish the form. I have here the code that I created for use in my form:

    Code:
    <form action="sendmistakes.php" method="post"><div class="div17">First Name: <input name="firstname" tabindex="1" size="5" /> Last Name: <input name="lastname" tabindex="2" size="5" /><br /><br />Select Mistake: <select tabindex="3" name="selectmistake"><option value="brokenimages">Broken Images</option><option value="brokenlinks">Broken Links</option><option value="grammarerrors">Grammar Errors</option><option value="spellingerrors">Spelling Errors</option><option value="other">Other</option></select><br /><br />Explain Mistake:<br /><textarea tabindex="4" class="textarea1" name="explainmistake" cols="30" rows="5"></textarea><br /><br /><input tabindex="5" type="submit" value="Submit Form" /> <input tabindex="6" type="reset" value="Reset Form" /></div></form>
    I currently have nothing coded for sendmistakes.php because I don't know how to finish it off. What I'm trying to do is finish the form when the viewer clicks "Submit Form" to send me an email with the information inputted then a little message that appears (in the same page) to show the user that the form has been submitted correctly, preferably before the beginning of the form. I have never coded in PHP before and I can somewhat understand it but not fully. The person who can help me finish it off and can make it work will receive 175 credits, MINIMUM. I might donate a bit more but 175 credits guaranteed. Thank you.

  2. #2
    Scoochi2's Avatar
    Scoochi2 is offline x10 Sophmore Scoochi2 is an unknown quantity at this point
    Join Date
    Aug 2008
    Location
    Southport!
    Posts
    185

    Re: Need Help on a Form

    There are two quick links I can give you here.

    http://www.tele-pro.co.uk/scripts/contact_form/
    This first one will create the PHP form for you (and does other languages as well, you choose), and you just have to upload it to your hosting.

    http://www.emailmeform.com/
    This second one will submit your form data to their website, and they will email you. However, you have to sign up for this service, although it is free.


    Both of those should be ok for you. However, I would recommend trying the first and studying the code to see what it is doing and how it works. Especially if you are wanting to learn more about PHP or wish to use it in the future.
    If anyone can see it, my post was meant for anyone who reads it. Don't take it personally or think I'm being condescending... :nuts:

  3. #3
    secretply is offline x10Hosting Member secretply is an unknown quantity at this point
    Join Date
    Sep 2008
    Posts
    50

    Re: Need Help on a Form

    I don't prefer those automatic form generators because you can't design them and customize the layout to your need.

  4. #4
    falconeye3000 is offline x10Hosting Member falconeye3000 is an unknown quantity at this point
    Join Date
    Apr 2009
    Posts
    2

    Re: Need Help on a Form

    well i dont speak english very well so you try read jejejeje

    you need declarate in the sendmistakes.php the variables someting like this can work:

    // Configuration Settings
    $SendFrom = "info info@yourdomain.com"; // email sender
    $SendTo = youremailhere@yourdomain.com;
    $SubjectLine = "subjet in the mail"; // you can chage this
    $ThanksURL = "thanks.htm"; //confirmation page
    //dont modify
    // Build Message Body from Web Form Input
    foreach ($_POST as $Field=>$Value)
    $MsgBody .= "$Field: $Value\n";
    $MsgBody .= "\n" . @gethostbyaddr($_SERVER["REMOTE_ADDR"]) . "\n" .
    $_SERVER["HTTP_USER_AGENT"];
    $MsgBody = htmlspecialchars($MsgBody, ENT_NOQUOTES); //make content safe
    // Send E-Mail and Direct Browser to Confirmation Page
    mail($SendTo, $SubjectLine, $MsgBody, "From: $SendFrom");
    header("Location: $ThanksURL");
    ?>

    good luck from mexico jejeje

  5. #5
    freecrm's Avatar
    freecrm is offline x10 Elder freecrm is an unknown quantity at this point
    Join Date
    May 2008
    Location
    UK
    Posts
    629

    Re: Need Help on a Form

    You could try this approach..

    Your first page don't need altering.

    In your sendmistakes.php file, you just need to set your headers and then insert the values from the post.

    You could do with capturing their e-mail address in your form.

    i.e.

    PHP Code:
    $toemail="youremail@address.com";

    $headers  'MIME-Version: 1.0' "\r\n";
    $headers .= 'Content-type: text/html; charset=iso-8859-1' "\r\n";
    $headers .= "Content-Transfer-Encoding: 7bit\r\n"
    $headers .= 'From: <'.$_POST['fromemail'].'>' "\r\n";
    $headers .= 'Reply-To: '.$_POST['fromemail']."\r\n";
    $headers .= 'X-Mailers: PHP /'.phpversion() . "\r\n";
    $subject 'Posted mistakes';
    $message '

    mistake:'
    .$_POST['mistake'].'<br/>

    explanation:'
    .$_POST['whateverfield'].'<br/>

    etc. etc.....


    '
    ;

    if (@
    mail($toemail,stripslashes($subject),stripslashes($message),stripslashes($headers)))
    {
        echo 
    "Mail to:".$toemail." confirmed.</br>";
    }
    else
    {
        echo 
    "Mail to".$toemail." failed.  Please try again.</br>";


+ Reply to Thread

Similar Threads

  1. [5$]Get the Flash contact us Form
    By agroup in forum Ads & Offers
    Replies: 3
    Last Post: 12-18-2008, 09:30 AM
  2. Addon Domain PHP Form Error
    By rockee in forum Free Hosting
    Replies: 2
    Last Post: 04-02-2008, 06:53 PM
  3. Design a free form
    By gateway in forum Off Topic
    Replies: 1
    Last Post: 10-19-2007, 05:49 PM
  4. My php Form tutorial
    By WinGate in forum Tutorials
    Replies: 0
    Last Post: 08-20-2007, 08:14 PM
  5. A simple Visual Basic Login Form
    By Zenax in forum Tutorials
    Replies: 0
    Last Post: 03-13-2007, 08:59 AM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
x10hosting free hosting for the masses
dedicated servers