Web Hosting Deals Holiday Logo Design Webcam Chat Website Header Templates Register domain Search Engine Optimisation Web Hosting
Go Back   Talk Mania Forum > Tutorials > PHP / Perl / Java / JavaScript / CGI Tutorials

PHP / Perl / Java / JavaScript / CGI Tutorials PHP / Perl / Java / JavaScript / CGI Tutorials Please do not use this Forum to advertise your site or to link to tutorials.

 Image
Buy Sell Downloads

Reply
 
Submit Tools LinkBack Thread Tools Display Modes
  #1 (permalink)  
Old 08-17-2008, 10:31 PM
Junior Member
 
Join Date: Jun 2008
Posts: 10
narkoman is on a distinguished road
php| making mail form for html

hello peaple...
i want to know how to make a php form that will work for html...
i mean like this...

name:
email:
description:

and then two buttons send and reset...

and it will send it to my email...

please tell me where to write the codes that you will give(if you will)..
what in the .html and what in the .php

thank you very much!!!!!

Reply With Quote
  #2 (permalink)  
Old 08-19-2008, 05:09 PM
Junior Member
 
Join Date: Aug 2008
Posts: 26
Insane~Mcs is on a distinguished road
im not sure if you can do it in html have a look at pscode.com the have some good code snipents
Reply With Quote
  #3 (permalink)  
Old 08-19-2008, 08:32 PM
Junior Member
 
Join Date: Jun 2008
Posts: 10
narkoman is on a distinguished road
thanks....

i dont mean to do that in html language i mean to do it in php...for html site..
Reply With Quote
  #4 (permalink)  
Old 08-19-2008, 08:54 PM
Junior Member
 
Join Date: Aug 2008
Posts: 25
brumaluco is on a distinguished road
You can find in a Scripts.com
Reply With Quote
  #5 (permalink)  
Old 08-21-2008, 02:06 PM
Suicide Sam's Avatar
Junior Member
 
Join Date: Aug 2007
Posts: 26
Blog Entries: 7
Suicide Sam is on a distinguished road
You can make a normal html form with as action a php file, in the php file it sends than an emaik.

file.html

HTML Code:
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>Untitled Document</title>
</head>

<body>

<form action="sendmail.php" method="post" name="form1" target="_self" id="form1">

<input name="yourform" type="text" value="form" size="18" />
<!-- Other form elements come here -->

	<input name="submit" type="submit" value="Submit" /> <input name="reset" type="reset" value="Reset" />

</form>
</body>
</html>

your php file, which has to be the same name as the action: sendmail.php can look like this

PHP Code:
<?php
$address 
'mail_acount_to receive@host.com';
$success 'succes.php';

if( isset(
$_POST) )
{
    
$headers "From: Mail <email_sender@host.com>";
    
$send_to $email;
    
$content '';
    
    foreach( 
$_POST as $name => $value )
    {
        
$content .= "$name: $value\n";
    }
    
    
mail($address,'Email !',$content,$headers);
    
header("Location: $success");
}
?>
if your mail has been sended you visitors wil come to succes.php
all values from your form are sended in the mail.

Hope this helped :/
ps. it s not possible to send mails with html, you will need another language for it, php is the perfect solution.
Reply With Quote
  #6 (permalink)  
Old 08-23-2008, 07:49 PM
Junior Member
 
Join Date: Aug 2008
Posts: 3
sameh_ammar is on a distinguished road
thank for you very good
Reply With Quote
  #7 (permalink)  
Old 08-29-2008, 06:24 PM
Junior Member
 
Join Date: Aug 2008
Posts: 5
y5cafe is on a distinguished road
Quote:
Originally Posted by Suicide Sam View Post
You can make a normal html form with as action a php file, in the php file it sends than an emaik.

file.html

HTML Code:
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>Untitled Document</title>
</head>

<body>

<form action="sendmail.php" method="post" name="form1" target="_self" id="form1">

<input name="yourform" type="text" value="form" size="18" />
<!-- Other form elements come here -->

	<input name="submit" type="submit" value="Submit" /> <input name="reset" type="reset" value="Reset" />

</form>
</body>
</html>

your php file, which has to be the same name as the action: sendmail.php can look like this

PHP Code:
<?php
$address 
'mail_acount_to receive@host.com';
$success 'succes.php';

if( isset(
$_POST) )
{
    
$headers "From: Mail <email_sender@host.com>";
    
$send_to $email;
    
$content '';
    
    foreach( 
$_POST as $name => $value )
    {
        
$content .= "$name: $value\n";
    }
    
    
mail($address,'Email !',$content,$headers);
    
header("Location: $success");
}
?>
if your mail has been sended you visitors wil come to succes.php
all values from your form are sended in the mail.

Hope this helped :/
ps. it s not possible to send mails with html, you will need another language for it, php is the perfect solution.
Thank u very much
Reply With Quote
  #8 (permalink)  
Old 08-29-2008, 06:25 PM
Junior Member
 
Join Date: Aug 2008
Posts: 26
Insane~Mcs is on a distinguished road
i tought he ment without usinga include -.- meh thanks i could use this
Reply With Quote
  #9 (permalink)  
Old 08-30-2008, 12:50 AM
Junior Member
 
Join Date: Apr 2008
Posts: 13
roelofroos is on a distinguished road
You can send a huge amount of things trough the PHP function mail, but it's not globally supported so check it first!
Reply With Quote
  #10 (permalink)  
Old 09-06-2008, 03:19 PM
Junior Member
 
Join Date: Jul 2008
Posts: 27
theastrodude is on a distinguished road
just to point out, you need an webmail server to actually send the mail.

Reply With Quote
Reply

Bookmarks

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On
Forum Jump


All times are GMT +2. The time now is 02:02 AM.


Fake ID

Powered by vBulletin® Version 3.7.1
Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
SEO by vBSEO 3.2.0 RC8
Forums Copyright © Talk-Mania.com