View previous topic :: View next topic |
Author |
Message |
RawLIMIT -
Joined: 23 Oct 2003 Posts: 4
|
Posted: Thu Jan 29, 2004 7:33 am Post subject: HELP!!! Easiest way to do HTML Forms |
|
|
I need to do a simple form wiht name: and email: and i want to save to a txt file.... What is the easiest way to do this.... Im good with HTML but thats about it..... |
|
Back to top |
|
 |
Anonymoose -
Joined: 09 Sep 2003 Posts: 2192
|
Posted: Thu Jan 29, 2004 9:21 am Post subject: |
|
|
Well, the ultimate simplest way is to do a form with the submit action as a mailto - if the user has an email client properly configured, it will send off a mail when they click submit. You can make it attach the form entries as a text file. However, you will be excluding anyone who doesn't have an email account set up...
Probably the best way to do it would be set up perl or PHP on your server and use an existing script. What exactly are you wanting to do, just create a simple subscription mailing list ? |
|
Back to top |
|
 |
RawLIMIT -
Joined: 23 Oct 2003 Posts: 4
|
Posted: Thu Jan 29, 2004 9:41 am Post subject: |
|
|
Im going to be setting up a multiplayer game competition, so I just wanted to have a sign up form with there Player Name, Email address and maybe some other info, and then have it saved to a master list, in a text file...If you know any tutorials or can help in any way, would be greatly appreciated |
|
Back to top |
|
 |
Anonymoose -
Joined: 09 Sep 2003 Posts: 2192
|
|
Back to top |
|
 |
RawLIMIT -
Joined: 23 Oct 2003 Posts: 4
|
Posted: Thu Jan 29, 2004 10:06 am Post subject: |
|
|
Sounds like exactly what i need, now where do i put each of the files....sorry not big on PHP....
Thanks for the help |
|
Back to top |
|
 |
RawLIMIT -
Joined: 23 Oct 2003 Posts: 4
|
Posted: Thu Jan 29, 2004 10:35 am Post subject: |
|
|
GOT IT!, THANKS FOR THE HELP! |
|
Back to top |
|
 |
Karasu Kami -
Joined: 22 Sep 2003 Posts: 712 Location: Colorado
|
|
Back to top |
|
 |
Anonymoose -
Joined: 09 Sep 2003 Posts: 2192
|
Posted: Fri Jan 30, 2004 1:37 am Post subject: |
|
|
What do you want it to do ? There are others here a lot more advanced than me in PHP, but I know enough to get by - I hope :D |
|
Back to top |
|
 |
TRUSTAbyss -
Joined: 29 Oct 2003 Posts: 3752 Location: USA, GA
|
Posted: Fri Jan 30, 2004 1:44 am Post subject: |
|
|
I know PHP , but I can't help you with customizing this script , instead im
posting my PHP script that I wrote using a little PHP skills I learned. Actually
I have 2 books on PHP and MySQL , im a PHP Freak. I should know more later!
PHP Code: post.php
------------
.Name
.E-mail
.Comments
Code: | <title>Your Title</title>
<body bgcolor="white">
<?php
$filename ="data.html";
$handle= fopen($filename,'a');
$string = "<hr>
<font color=\"blue\" font size=\"4\">
Name: <font color=\"red\" font size=\"3\">
$_POST[name] <br><br> <font color=\"blue\" font size=\"4\">
E-mail: <a href=\"mailto:$_POST[email]?subject=Your Subject &body=To: $_POST[name]\"><font color=\"skyblue\" font size=\"3\">$_POST[email]</a>
<br><br> <font color=\"blue\" font size=\"4\">
Comments: <font color=\"black\" font size=\"3\">
$_POST[comments] <br> <br><hr>\n <br><br>";
fputs($handle, $string);
fclose($handle);
echo "<font color=\"white\" font size=\"4\">Hey <font color=\"skyblue\">$_POST[name] <font color=\"black\" font size=\"4\">, thank you for contacting me , your profile was saved and it will be reviewed.";
?>
|
HTML Form: form.html
-------------
Code: |
<form action="post.php" method="post">
Name: <input type="text" name="name"><br>
E-mail: <input type="email" name="email"><br>
<textarea maxlength=3 name="comments" maxlength="10" rows="5" cols="25" title="Type some information here"></textarea><br>
<input type="submit" value="Submit"><input type="reset" value="Reset"></form>
|
-------------------------------------------------------------------------------------
You can change colors if you want , don't remove any \ between the = signs and " , this is very important or you will get an Error 200 , my book showed me this tip. Enjoy the script ! 8) |
|
Back to top |
|
 |
|