It appears you have not yet registered with DEVPPL. To register please click here... (it's fast, easy and free!)

Forum

Log In Sponsors
Board index Programming PHP and MySQL Forum

Making a form

Moderator: Malcolm

Making a form

Postby YinYang on Fri Nov 03, 2006 2:48 am

Hi can you guys help me out...

Im looking for a form script, what I need it to do is have a user put in there email adress, a second box where they put a comment, then the comment is sent to my email.

if you could code this for me it would be great, at the moment I am learning PHP, so I would probably learn a bit from this. thank you for the help.
YinYang
 
Posts: 15
Joined: Sun Jun 11, 2006 1:43 am

Postby The Poot on Sat Nov 04, 2006 11:16 pm

I hope this helps:

I have requested the same thing from this site before and this is what we came up with...

<fieldset>
<legend>Feedback</legend>
<form method="post">
<label for="fusername">Username:</label>
<br>
<input name="fusername" class="input-field" id="fusername" type="text">
<br>
<label for="feedback">Feedback:</label>
<br>
<textarea name="feedback" class="textarea" id="feedback" type="text" rows="5" cols="70"></textarea>
<input name="submit1" value="Submit" class="submit-button" id="submit1" type="submit">
<?php if(isset($_POST['submit1']))
{ $to = "YOU@YOUREMAIL.COM";
$fusername = $_POST['fusername'];
$feedback = $_POST['feedback'];
mail($to, $fusername, $feedback);
echo "Your mail has been sent!";
} ?>
</form>
</fieldset>

Basically this code will create a <fieldset> and a button called "submit1" which when pressed will send you and email; without the client's email client (outlook, thunderbird or whatever) opening, it will just go straight to you at YOU@YOUREMAIL.COM.

I hope this is what you are looking for

My original post is here:

http://www.devppl.com/forum/sending-form-via-email-with-php-vt2803.html?highlight=
The Poot
 
Posts: 15
Joined: Fri Sep 02, 2005 10:31 pm

Postby YinYang on Fri Nov 17, 2006 1:35 am

Thank you. I find this more easy to read then a lot of replys from other forums I posted on. This helped A LOT!

I have definitely learned
YinYang
 
Posts: 15
Joined: Sun Jun 11, 2006 1:43 am


Who is online

Users browsing this forum: No registered users and 0 guests