+ Reply to Thread
Results 1 to 4 of 4

Thread: Forms

  1. #1
    yvettenoone14 is offline x10Hosting Member yvettenoone14 is an unknown quantity at this point
    Join Date
    Feb 2011
    Posts
    2

    Forms

    Hi struggling to get a feedback form working - unsure of the code for the submit button. Just want feedback to come to my email. Can anyone help

  2. #2
    Gouri's Avatar
    Gouri is offline Community Paragon Gouri has a brilliant futureGouri has a brilliant futureGouri has a brilliant future
    Join Date
    Oct 2007
    Location
    India
    Posts
    4,502

    Re: Forms

    ***** Moved to programming help section ***************

    Quote Originally Posted by yvettenoone14 View Post
    Hi struggling to get a feedback form working - unsure of the code for the submit button. Just want feedback to come to my email. Can anyone help
    Submit the form to some php file which will send the feedback to your mail. There are many feedback forms available on internet.

    Remember to add captcha to feedback form to avoid spam.
    Last edited by Gouri; 02-08-2011 at 06:41 PM.
    If you feel my post is useful then click to give Reputation (bottom left corner of this post)

    X10 Hosting | News and Announcements | Premium Hosting | VPS Hosting | Prime Membership

    Tech Community | Gouri

  3. #3
    GtoXic is offline x10 Lieutenant GtoXic is an unknown quantity at this point
    Join Date
    Apr 2010
    Posts
    447

    Re: Forms

    <form action="http://yoursite.com/url/to/php/file.php"> <-- that will send it to a PHP file.

    Then, in the PHP file:

    <?php
    if(isset($_POST['submit'])){
    //code here
    }else{
    die("Looks like an error occured :O");
    }
    ?>
    █ x10 Lieutenant
    █ If I have helped, please click the star in the bottom left of my post.

    █ Free Hosting support volunteer 410 posts from Community Advocate (This is NOT live!)


  4. #4
    callumacrae's Avatar
    callumacrae is offline not alex mac callumacrae is just really nice
    Join Date
    Dec 2007
    Location
    Wellesbourne, England
    Posts
    5,162

    Re: Forms

    FROZENMAFIA! NO! XD

    A - use the [php] tag
    B - forms should have a method (in this example, post)
    C - use $_SERVER['REQUEST_METHOD'] instead of isset($_POST..
    D - why do you insist on not using spacing

    PHP Code:
    <?php

    if ($_SERVER['REQUEST_METHOD'] == 'POST')
    {
        
    $email 'Email sent using feedback form on yoursite.' "\n\n" 'Name: ' $_POST['name']; //etc...
        
    $youremail 'email@example.com';
        
    mail($youremail'Feedback (subject)'$email'From: ' $youremail);
    }
    else
    {
    ?>

    <form action="file.php" method="post">
    <!-- inputs here -->
    </form>

    <?php
    }
    ~Callum
    Last edited by callumacrae; 02-18-2011 at 03:49 PM.
    I can customise your phpBB board. Send me a PM.
    lynxphp - info, tutorials and scripts
    "A forum post should be like a skirt; long enough to cover the subject but short enough to keep things interesting."

+ Reply to Thread

Similar Threads

  1. forms
    By walidno1 in forum Programming Help
    Replies: 3
    Last Post: 05-26-2010, 02:26 AM
  2. forms
    By peg2win in forum Tutorials
    Replies: 2
    Last Post: 12-15-2009, 05:12 PM
  3. Forms
    By msmwilson in forum Free Hosting
    Replies: 1
    Last Post: 11-18-2009, 05:49 AM
  4. [PHP] Using it in forms!
    By War of the Lands in forum Programming Help
    Replies: 10
    Last Post: 10-23-2008, 01:52 AM
  5. CGI Forms
    By Akkarin in forum Scripts & 3rd Party Apps
    Replies: 1
    Last Post: 06-03-2005, 07:04 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