View Full Version : Making a form
New2This
09-10-2002, 09:07 PM
this may be the wrong place to post this... if it is admin feel free to correct....
i have a shopping cart and its working good but i just can figure out how to make it write to a text on my server instead of send me a e-mail everytime a order is made....
any ideas?
Dynasty
09-10-2002, 11:59 PM
Well it depends what scripting language you were using, if I was using php I'd probably do something like this..
<?php
if ( isset($text) )
{
$filename = "text.txt";
if (file_exists($filename))
{
$fp = fopen( $filename, 'a' )
or die ('Unable to open file' .$filename);
$text .= "\n";
fputs( $fp, $text );
fclose($fp);
}
else
{
die( $filename ." doesn't exist");
}
echo "Added $text";
}
else
{
?>
<form action="<? echo $PHP_SELF; ?>" method="POST">
<input type="text" name="text">
<input type="submit" value="Submit">
</form>
<?
}
?>
Hope that is useful.
czenglish
09-11-2002, 12:08 PM
I want just such a e-mail form - one that sends me e-mail with fields filled out, and not my server. Maybe I'm too lazy (or dumb) to learn and want to get on with business without spending too much money (i.e. paying for cgi scripts from server). It should be an order form just so I get customer's information. Any leads gratefully received.
Waves
09-19-2002, 08:33 PM
here is a mailto form that is inserted in a table. (One from my site)
<FORM METHOD="POST" ACTION="mailto:blahblah@here.com?subject=Application" ENCTYPE="text/plain">
<table border=1 bgcolor=006699>
<tr>
<td>Please enter your name:</td>
<td><INPUT NAME="Name" size="30"></td>
</tr>
<tr>
<td>E-mail address (required for response):</td>
<td><INPUT Name="Email" size="30"></td>
</tr>
<tr>
<td>From 1-10 Rate your skill level:</td>
<td><INPUT NAME="Skill_Level" size="30"></td>
</tr>
</table>
<p>
<H4>A description:</H4>
<TEXTAREA NAME="Comment" ROWS=6 COLS=60></TEXTAREA>
<P>
<BR>
<INPUT TYPE=submit VALUE="Send it!">
<INPUT TYPE=reset VALUE="Start over">
<p>
<B>Thanks for your application. </B>
</FORM>
czenglish
09-20-2002, 12:37 AM
Oh, was it really that simple? Thanks a lot, I always assume this stuff needs complicated algorithms and things. I'll give something similar a try. Thanks again.
New2This
09-20-2002, 09:18 AM
now when i click submit it tries to send the e-mail from my hotmail account .... what can i be doing wrong?
czenglish
09-20-2002, 09:25 AM
You probably need to change the e-mail settings in the browser itself. Mine is set to use Outlook. In IE it's Internet Options > Programs > E-mail > choose Outlook or whatever you use and then you should be able to choose which account to send it from.
New2This
09-20-2002, 09:28 AM
i knew that...lol... see i dont want an email i just want the information sent to my e-mail address or even saved on the server to a dat file.....
czenglish
09-20-2002, 09:53 AM
Yeah right, better wait for Dynasty's reply:smack:
I had a book which write about this.The place you host must supports online e-mailing like stmp or pop.
P.S. it's an asp.net book.
New2This
09-20-2002, 09:51 PM
DING DING DING!!!!!!!! "Bob tell him what he`s won"... lol.... exactly too bad we had to waste all that bandwidth to get that figured out
Dynasty
09-21-2002, 10:27 AM
My answer covers putting the text into a file on the server. Just change the form to have whatever you wanted, and remember that whatever you put in the name="" bit is the variable name for the text file.
vBulletin® v3.7.2, Copyright ©2000-2008, Jelsoft Enterprises Ltd.