Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > HTML > name attribute in input tag

Reply
Thread Tools

name attribute in input tag

 
 
eggie
Guest
Posts: n/a
 
      09-08-2003
I was wondering is it possible to use the name attribute e.g. <input name =
"name" type = "text" etc.
in forms to let the user fill in an email address in a text field and the
form be sent to that address.

I tried <form action = "mailto:name" more in hope than expectation but
didn't get anywhere?

Is there a solution to this?


 
Reply With Quote
 
 
 
 
eggie
Guest
Posts: n/a
 
      09-08-2003
mm
"eggie" <(E-Mail Removed)> wrote in message
news:AJ37b.18904$(E-Mail Removed)...
> I was wondering is it possible to use the name attribute e.g. <input name

=
> "name" type = "text" etc.
> in forms to let the user fill in an email address in a text field and the
> form be sent to that address.
>
> I tried <form action = "mailto:name" more in hope than expectation but
> didn't get anywhere?
>
> Is there a solution to this?
>
>



 
Reply With Quote
 
 
 
 
Adrienne
Guest
Posts: n/a
 
      09-08-2003
Gazing into my crystal ball I observed "eggie" <(E-Mail Removed)>
writing in news:iQ37b.19062$(E-Mail Removed):

> mm
> "eggie" <(E-Mail Removed)> wrote in message
> news:AJ37b.18904$(E-Mail Removed)...
>> I was wondering is it possible to use the name attribute e.g. <input
>> name = "name" type = "text" etc.
>> in forms to let the user fill in an email address in a text field and
>> the form be sent to that address.
>>
>> I tried <form action = "mailto:name" more in hope than expectation but
>> didn't get anywhere?
>>
>> Is there a solution to this?
>>
>>

>
>
>


<form id="mailing" action="mailingscript" method="post">
<fieldset>
<legend>Your mailing information</legend>
<label for="yourname">Name: </label><input type="text" name="yourname"
id="yourname" value="">
<label for="email">Email: </label><input type="text" name="email"
id="email" value="">
<input type="submit" value="Submit">
</fieldset>
</form>

Upon submission of the form, name value pairs are posted to the processing
script. As you saw in your example, using mailto for action does not work
very well.

Check with your host to find out what the mailing script name is, and what
parameters it requires. If your host does not provide a form processing
script, you could use something like http://www.response-o-matic.com .

--
Adrienne Boswell
Please respond to the group so others can share
http://www.arbpen.com
 
Reply With Quote
 
Toby A Inkster
Guest
Posts: n/a
 
      09-08-2003
eggie wrote:

> I was wondering is it possible to use the name attribute e.g. <input name =
> "name" type = "text" etc.
> in forms to let the user fill in an email address in a text field and the
> form be sent to that address.


Yes, but not in a way like you described.

You would need a server-side script to do this. For example with PHP...

form.html should contain:

<form action="handler.php" method="POST">
<p>
<input type="text" name="email"> E-mail (From)<br>
<input type="text" name="email2"> E-mail (To)<br>
<input type="text" name="subject"> Subject<br>
<input type="text" name="msg"> Short Message
</p>
<p>
<input type="submit">
</p>
</form>

and handler.php would consist of:

<?php
// specify a page to redirect to afterwards.
$redirect = 'http://www.example.org/thanks.html';

$hdrs = 'From: ' . $_POST['email'] . "\r\n"
. 'X-Originating-IP: ' . getenv('REMOTE_ADDR') . "\r\n"
. 'X-Mailer: PHP/' . phpversion();
$to = $_POST['email2'];
$subj = $_POST['subject'];
$msg = $_POST['msg'];

mail($to,$subj,$msg,$hdrs);
header("Location: $redirect");
?>

--
Toby A Inkster BSc (Hons) ARCS
Contact Me - http://www.goddamn.co.uk/tobyink/?id=132

 
Reply With Quote
 
Owen Jacobson
Guest
Posts: n/a
 
      09-08-2003
Toby A Inkster wrote:

> eggie wrote:


> <input type="text" name="email2"> E-mail (To)<br>


But this is an incredibly poor idea, as it will take no time at all
before your mail script is misused to send spam out to the masses.
 
Reply With Quote
 
eggie
Guest
Posts: n/a
 
      09-09-2003
THANKS TO ALL WHO REPLIED



"eggie" <(E-Mail Removed)> wrote in message
news:AJ37b.18904$(E-Mail Removed)...
> I was wondering is it possible to use the name attribute e.g. <input name

=
> "name" type = "text" etc.
> in forms to let the user fill in an email address in a text field and the
> form be sent to that address.
>
> I tried <form action = "mailto:name" more in hope than expectation but
> didn't get anywhere?
>
> Is there a solution to this?
>
>



 
Reply With Quote
 
 
 
Reply

Thread Tools

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 Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Regarding autogeneration of name attribute of input tag(Asp.net bu Sumit Rawat India ASP .Net 1 10-11-2008 05:54 PM
input attribute for the input tag? David Wright HTML 1 12-20-2006 06:00 AM
how do u invoke Tag b's Tag Handler from within Tag a's tag Handler? shruds Java 1 01-27-2006 03:00 AM
Read form "name" attribute when it contains form field with name "name" Pavils Jurjans Javascript 3 03-18-2005 01:39 PM
Re: Urgent! how to get object name, method name and attribute name based on the strings? ding feng C++ 2 06-25-2003 01:18 PM



Advertisments