Forum     

Go Back   Digit Technology Discussion Forum > Software > Programming
Register FAQ Calendar Mark Forums Read

Programming The destination for developers - C, C++, Java, Python and the lot


Closed Thread
 
LinkBack Thread Tools Display Modes
Old 18-03-2009, 05:36 PM   #1 (permalink)
In The Zone
 
bharat_r's Avatar
 
Join Date: Mar 2004
Location: Chennai
Posts: 470
Default Getting data from a from and sending it though email


I want to design a webpage which would get data from a form and send the collected data to my mail id.

I used the following html codes to get the data:

Code:
<html>
<head><Title></Title></head>
<form method="post" action="contact.php">
Email: <input name="email" type="text"><br>
Message:<br>
<textarea name="message" rows="15" cols="40"></textarea><br>
<input name="send" type="submit">
</form> 
</html>
And used the following php script
Code:
<?php
$to = "bharatkrishna.r@gmail.com";
$subject = "Contact Us";
$email = $_REQUEST['email'] ;
$message = $_REQUEST['message'] ;
$headers = "From: $email";
$sent = mail($to, $subject, $message, $headers) ;
if($sent)
{print "Your mail was sent successfully"; }
else
{print "We encountered an error sending your mail"; }
?>
But I'm not getting what I enter in the form to my mail.

How do I do it. Please Help.
bharat_r is offline  
Advertisements. Register and be a member of the community to get rid of them.
Advertisement

Old 18-03-2009, 09:36 PM   #2 (permalink)
String Phreak
 
mediator's Avatar
 
Join Date: Mar 2005
Location: In ur Evil Mind!
Posts: 2,457
Default Re: Getting data from a from and sending it though email

AFAIR, u need to configure ur local sendmail server for that or perhaps u may test it on some site of urs say wwwdotbharat_rdotcom coz sites r usually configured with a mail server.
__________________
Bad Bad server.....No candy for u!
mediator is offline  
Old 21-03-2009, 06:42 PM   #3 (permalink)
In The Zone
 
bharat_r's Avatar
 
Join Date: Mar 2004
Location: Chennai
Posts: 470
Default Re: Getting data from a from and sending it though email

I dont have a site. I just use googlepages and geocities to host my web pages...

So it can't be done by me eh?
bharat_r is offline  
Old 21-03-2009, 06:59 PM   #4 (permalink)
Sami Hyypiä, LFC legend
 
Liverpool_fan's Avatar
 
Join Date: Jun 2007
Location: Нью-Дели
Posts: 2,138
Default Re: Getting data from a from and sending it though email

IIRC & AFAIK PHP is server sided scripting, so you need sever side scripting. So you need a proper webhost.
__________________
Experience true education in Computer Science - http://www.udacity.com | http://www.coursera.org

Spoiler:
Read before asking / messaging any moderator for any query: FAQ + answers for new members

Read all the sticky threads before asking any type of query. Most basic questions are answered in those.
Don't use forum for chatting. Visit http://webchat.freenode.net/?channels=krow, enter nick and connect.
Liverpool_fan is offline  
Closed Thread

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


 
Latest Threads
- by Sujeet
- by gforz
- by soumya

Advertisement




All times are GMT +5.5. The time now is 03:09 PM.


Powered by vBulletin® Version 3.8.7
Copyright ©2000 - 2012, vBulletin Solutions, Inc.

Search Engine Optimization by vBSEO 3.3.2