PHP Form Help

Discussion in 'PHP' started by rain7, May 14, 2009.

  1. #1
    I want to create PHP form. like Feed bacn form or contact us form.
    Please tell me how can I create? I dont know about programming. I am just designer. but I hope any one will give me any idea then I will create.

    I am new use here. I hope you will help me.

    I am waiting for your positive response.
     
    rain7, May 14, 2009 IP
  2. Caden Grant

    Caden Grant Active Member

    Messages:
    294
    Likes Received:
    0
    Best Answers:
    0
    Trophy Points:
    51
    #2
    Here's one I use - it's really simple but gets the job done. Hope it helps.


    contact.php
    
    <form method="post" action="mail.php">
    <label>Name:</label>
    <input type="text" name="name" /><br />
    <label>Subject:</label>
    <input type="text" name="subject" /><br />
    <label>Email:</label>
    <input type="text" name="email" /><br />
    <label>Message:</label>
    <textarea name="message"></textarea><br />
    <label>&nbsp;</label>
    <button type="submit" value="Submit">Submit</button>
    </form>
    
    Code (markup):
    mail.php
    
    <?php
    $name = $_POST['name'];
    $email = $_POST['email'];
    $message = $_POST['message'];
    $subject = $_POST['subject'];
    
    //Create the Email
    $to = 'your@emailhere.com';
    $subject = "Subject: $subject";
    $message = "From: {$theEmail}\nTime: ".date('Y-m-d')."\nName: {$name}\nMessage: {$message}";
    
    mail($to, $subject, $message);
    
    if (!mail) {
    echo "There was an error. Please try again later";
    } else {
    echo "We have received your message.";
    }
    ?>
    
    Code (markup):
     
    Caden Grant, May 14, 2009 IP
  3. bartolay13

    bartolay13 Active Member

    Messages:
    735
    Likes Received:
    14
    Best Answers:
    1
    Trophy Points:
    98
  4. rain7

    rain7 Peon

    Messages:
    18
    Likes Received:
    0
    Best Answers:
    0
    Trophy Points:
    0
    #4
    Thank you Sir for help me.
    Now I hopw I will solve my problem.
    But sir please tell me one thing that this is small form. I want to create long form.
    personal.infinitedesigner.com/form-sample.html
    I created this form and now I want to use Php in this form. So please give me more idea. I will very thank full to you.
    But plese dont write full code for this form. Becasue I want to do this work, I dont want to copy past your code. So when you will give me idea I will try to make form.


     
    rain7, May 15, 2009 IP