The Daily Click ::. Forums ::. General Chat ::. HTML Question?
 

Post Reply  Post Oekaki 
 

Posted By Message

Crystal Clear (H.E.S)

Possibly Insane

Registered
  06/10/2002
Points
  2548
1st October, 2003 at 23:15:41 -

Okay i wanna make a form where the User can fill out a form e.g like a Game Submitting Form:
--------------------------
Title: (Text Box Here)
Description: (Text Box Here)
--------------------------
when they click a Button "Submit".
i want to have the Information sent to my e-mail. lets say its "gamer@yomail.com".
The Subject for the E-mail would be the "Title" and the Body of the E-mail would have the "Description".
does anyone know how to do this?

Image Edited by the Author.

 
HES homepage:
http://www.distinctiv-efair.com/heretic/studios
Crystal Clear Productions: http://www.distinctiv-efair.com/heretic/crystalclear

ShadowCaster

Possibly Insane

Registered
  02/01/2002
Points
  2203
2nd October, 2003 at 02:14:54 -

In pure HTML you cant, unless you want to hard-code it. In this case you would put something like this:

<A HREF="mailto:gamer@yomail.com?subject=I clicked the button&body=I was able to click the secret button!">Secret Button</A>

If you want to use an actual language then that is a lot more intuative. If your using PHP you might create a script like this:

<;?
mail("gamer@yomail.com", $_REQUEST["title"], $_REQUEST["description"], "Content-Type: text/plain\r\nFrom: " . $_REQUEST["email"]);
?>

Obviously that doesnt have any checking (i.e. the user could get away without typing a title or a description). That's up to you to work out. Also I included two additional headers "Content-Type" which specifies that the message will be ordinary text. You can also use text/html if you want to be able to use HTML tags. The other header is "From" and allows you to specify an email address that the message is originating from. For example, if the user enters an email address in your form, you can click "Reply To" in your email client to respond quickly.

Anyway, message again if you need any more help

Mike

 
"Now I guess we're... 'Path-E-Tech Management'" -Dilbert

Crystal Clear (H.E.S)

Possibly Insane

Registered
  06/10/2002
Points
  2548
2nd October, 2003 at 05:20:52 -

Thanks ShadowCaster, i cant seem to get it to work? anyway ill mail you.

 
HES homepage:
http://www.distinctiv-efair.com/heretic/studios
Crystal Clear Productions: http://www.distinctiv-efair.com/heretic/crystalclear

The Chris Street

Administrator
Unspeakably Lazy Admin

Registered
  14/05/2002
Points
  48487

Game of the Week WinnerClickzine StaffAcoders MemberKlikCast StarVIP MemberPicture Me This Round 35 Winner!Second GOTW AwardYou've Been Circy'd!Picture Me This Round 38 Winner!GOTM December Third Place!!
I am an April FoolKliktober Special Award Tag
2nd October, 2003 at 05:37:03 -

Actually, I believe there is a way. One of my very early websites contained such a form...but I can't remember how I did it.

 
n/a

DeadmanDines

Best Article Writer

Registered
  27/04/2006
Points
  4758
2nd October, 2003 at 06:57:46 -

Circy is indeed correct. It adds the email to your outbox, and sends it the next time you open Outlook. Again, it was so long ago that I forget how I did it. I found the script on a website somewhere.

 
191 / 9999 * 7 + 191 * 7

Pete Nattress

Cheesy Bits img src/uploads/sccheesegif

Registered
  23/09/2002
Points
  4811
2nd October, 2003 at 12:02:23 -

alternitively, go to www.cutanpastescripts.com and use their free form processing script .

 
www.thenatflap.co.uk

ShadowCaster

Possibly Insane

Registered
  02/01/2002
Points
  2203
2nd October, 2003 at 16:50:23 -

It isnt possible using Pure HTML like I said, but it is possible using Javascript.

I replied to the message I got from CC, but in case anyone else is wondering the same question I'll post my reply here as well...

Hi,
The code needs to be placed in its own file. Create a new text document and name it "submit.php" or whatever you like.

In your HTML document create a FORM tag around your text boxes which links to the script, for example:

<FORM METHOD="post" ACTION="./submit.php">
Title: <INPUT TYPE="text" NAME="title" SIZE=30>
Email: <INPUT TYPE="text" NAME="email" SIZE=30>
Description: <TEXTAREA NAME="description" ROWS=7 COLS=25></TEXTAREA>
</FORM>

Now open up your php file in notepad and add the line:

<?
mail("my@address.com", $_REQUEST["title"], $_REQUEST["description"], "Content-Type: text/plain\r\nFrom: " . $_REQUEST["email"]);
?>

If you try to run it on your computer it wont work, that is because you probably dont have the PHP interpreter installed on your system. You'll need to upload it to your host and run it from there.

If your host doesnt support PHP I recommend using Perl, because it is quite easy to do with that. If your server doesnt support Perl, then you can use ASP, though with ASP it takes a few more lines of code.

Mike

 
"Now I guess we're... 'Path-E-Tech Management'" -Dilbert
   

Post Reply



 



Advertisement

Worth A Click