#1
  1. No Profile Picture
    Junior Member
    Devshed Newbie (0 - 499 posts)

    Join Date
    May 2000
    Posts
    5
    Rep Power
    0
    I am new to scripting! can anybody tell me how to get a simple php script and an example of the form that works with this script.
    Thanks very much in advance, Manfred from Breda, the Netherlands, Europe

    ------------------
  2. #2
  3. .Net Developer
    Devshed Novice (500 - 999 posts)

    Join Date
    Feb 2000
    Location
    London
    Posts
    987
    Rep Power
    15
    here i'm writing a small example.
    edit it for your requirment


    form.htm

    <form method="post" action="formmail.php3">
    Name : <input type="text" name="name"><br>
    Email : <input type="text" name="email"><br>
    <input type="submit" name="submit" value="submit"><br>
    </form>

    formail.php3

    <?php

    if($submit){
    $message="Form Informations : n";
    $message.="Name :$namen";
    $message.="Email :$emailn";

    mail("your@email.com","Feedback form",
    $message,
    "From : $emailn Reply-to: $email");

    echo "Your feedback form has been successfully processedn";
    }
    ?>

    check it out php manual for an another example.

    ------------------
    SR -
    shiju.dreamcenter.net

    "The fear of the LORD is the beginning of knowledge..."
  4. #3
  5. No Profile Picture
    Junior Member
    Devshed Newbie (0 - 499 posts)

    Join Date
    May 2000
    Posts
    5
    Rep Power
    0
    Dear Shiju, Thanks very much for your coding! Wonderfull. I tried it out and it worked!

    I tried to implement a little line in the script to check e-mail content in the email-field. This works allright, but not completely as it should work. The script returnstwo messages underneath wich don't make sence. Example: it say's "your E-mail is not correct" The same time it prints" Your feedback form has been successfully processed. Ther is a mistake in the script, I did something wrong! Do you know what is wrong?
    Next question: If I want the script to email content of te textareafield, what coding do I use in the script? Many thanks in advance!

    <html>
    <head>
    <title>message form</title>
    </head>

    <body text="black" link="blue" vlink="purple">
    <div align="left">
    <form method="post" action="formail.php3">
    Name : <input type="text" name="name" size="24"><br>
    Email : <input type="text" name="email" size="24"><br>
    Remarks: <textarea name="vragen" cols="40" rows="8"></textarea><br>
    <input type="submit" name="submit" value="submit"><br>
    </form>
    </div>
    </body>

    </html>

    <?php
    $back=0;
    IF ($email=="") :
    PRINT "<b>You did'nt fill in your E-mail-adress</b><BR><BR>";
    $back="1";
    ELSEIF (eregi("^[_.0-9a-z-]+@([0-9a-z][0-9a-z-]+.)+[a-z]{2,3}$",$email)==""):
    PRINT "<b>Your E-mail adres is not correct!</b><BR><BR>";
    $back="1";
    ELSE: PRINT Click back to start over.<br><br>";
    IF ($back==0 ):

    if($submit){
    $message="Form Informations : n";
    $message.="Name :$namen";
    $message.="Email :$emailn";

    mail("user@email.com","Feedback form",
    $message,
    "From : $emailn Reply-to: $email");

    echo "Your feedback form has been successfully processed.n";
    }
    ?>

Similar Threads

  1. help me with my mailing list please...
    By INE-Kpro... in forum HTML Programming
    Replies: 5
    Last Post: February 25th, 2004, 07:29 AM
  2. sending a online form to email
    By gintom in forum PHP Development
    Replies: 6
    Last Post: February 16th, 2004, 10:38 AM
  3. simple mail form
    By toolman in forum PHP Development
    Replies: 1
    Last Post: February 10th, 2004, 01:38 PM
  4. automatic mailto from HTML email
    By RSC in forum HTML Programming
    Replies: 1
    Last Post: January 25th, 2004, 10:46 PM
  5. email reciepent, using a form
    By brandonsnoodles in forum HTML Programming
    Replies: 0
    Last Post: January 17th, 2004, 04:58 PM

IMN logo majestic logo threadwatch logo seochat tools logo