Current location: Hot Scripts Forums » Programming Languages » PHP » convert html form to txt attachment?


convert html form to txt attachment?

Reply
  #1 (permalink)  
Old 01-04-06, 01:53 PM
brooklynguy brooklynguy is offline
New Member
 
Join Date: Dec 2005
Posts: 3
Thanks: 0
Thanked 0 Times in 0 Posts
convert html form to txt attachment? --- this was meant for script request

**sorry, after i posted this, i noticed the message regarding script requests. i have posted the message there --- but i'm not sure of how to delete this**

i need to convert the input of a form into a txt attachment. the submit button will send the form input to a specified email address (with the input sent as a text attachment).

does this make sense? does anyone have any suggestions, can you point me in a good direction that might help?

thanks so much and happy new year!
--robbie--

Last edited by brooklynguy; 01-04-06 at 02:11 PM. Reason: belongs in script request
Reply With Quote
  #2 (permalink)  
Old 01-05-06, 05:41 AM
olaf's Avatar
olaf olaf is offline
Newbie Coder
 
Join Date: Sep 2004
Location: The Netherlands
Posts: 47
Thanks: 0
Thanked 0 Times in 0 Posts
This is not really a script request, try this php function:
http://www.php.net/strip_tags
Reply With Quote
  #3 (permalink)  
Old 01-05-06, 11:52 AM
johndapunk johndapunk is offline
Newbie Coder
 
Join Date: Jan 2006
Posts: 43
Thanks: 0
Thanked 0 Times in 0 Posts
I have already answered your part about the "automaticly sending an email" to a person. Well, here is that code, if it helps you.
Code:
<html>
<head>
</head>
<body>
<form action="answer.php" method="post">
Name: <input type="text" name="name"><br>
Age: <input type="text" name="age"><br>
Email: <input type="text" name="email"><br>
<input type="submit" value="submit">
</form>
</body></html>
Code:
<?php
	$to = "johndapunk@gmail.com"; 
	$useremail = $_POST['email'];
	$name = $_POST['name'];
	$age = $_POST['age'];
	$subject= "subject here";
			
			$message="
			$name has done something.
			
			<table border=1 bgcolor=black>
			<tr bgcolor=76A5D5>
			<th width=125><font color=white>Age</font>
			
			<tr>
			<td><font color=white>".$age."
			
			</table>
			Thanks
			
			";
			
			$headers = "FROM: '$name' <$useremail>\r\n";
			$headers .= "MIME-Version: 1.0\r\n";
			$headers .= "Content-type: text/html; charset=iso-8859-1\r\n";

			mail($to, $subject, $message, $headers);

echo ("Should be successful.");
?>
For you, you would have to change a view variables, but that should be what your looking for. BTW, if you didn't already know, you must have a SMTP mail server that functions with your web server, if not, the mail() function will not work.

As you your .txt file thingy, I'll research that a lil.
Reply With Quote
Reply

Bookmarks


Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
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 Off
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On

Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
PHP Form to Excel then send as email attachment Moloch PHP 14 01-26-11 03:43 AM
formmail problem gscraper Perl 12 08-27-04 03:06 AM
Protecting hidden field on HTML Form with PHP imlek Script Requests 2 08-22-04 11:01 PM
html form lguzman HTML/XHTML/XML 1 06-10-04 02:34 PM
how do i re-fill the html form??? gaurav_sting PHP 1 12-21-03 12:13 PM


All times are GMT -5. The time now is 06:26 AM.
vBulletin® Copyright ©2000 - 2012, Jelsoft Enterprises Ltd.