Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > HTML > Form selector

Reply
Thread Tools

Form selector

 
 
Paul Watt
Guest
Posts: n/a
 
      04-28-2006
Hi Guys,
I'm building a email form in a XHTML Strict page. I want to have a drop down
selector box with 3 options in it (x,y,z for example). If x is selected I
want x to be in the subject line of the email. How can I do this? Can it be
done without Javascript?

Cheers ans TIA,

--

Paul Watt
http://www.paulwatt.info


 
Reply With Quote
 
 
 
 
William Tasso
Guest
Posts: n/a
 
      04-28-2006
Fleeing from the madness of the jungle
Paul Watt <> stumbled into
news:alt.html,alt.www.webmaster
and said:

> Hi Guys,
> I'm building a email form in a XHTML Strict page. I want to have a drop
> down
> selector box with 3 options in it (x,y,z for example). If x is selected I
> want x to be in the subject line of the email. How can I do this? Can it
> be
> done without Javascript?


yes - the script that processes the form makes all the decisions about
what data to use.

--
William Tasso

http://williamtasso.com/words/what-is-usenet.asp
 
Reply With Quote
 
 
 
 
Martin Jay
Guest
Posts: n/a
 
      04-28-2006
In message <>, Paul Watt
<> writes
>I'm building a email form in a XHTML Strict page. I want to have a drop down
>selector box with 3 options in it (x,y,z for example). If x is selected I
>want x to be in the subject line of the email. How can I do this? Can it be
>done without Javascript?


Do you want to send the email using a mailto link, such as:

<a href="private.php?do=newpm&u=?subject=Email subject"> ?

Selecting the subject from a drop down menu without using a script isn't
possible.

Another thing to bear in mind is that not everyone has a default email
client set up on the computer they're using, so this sort of link may
fail.
--
Martin Jay
 
Reply With Quote
 
Paul Watt
Guest
Posts: n/a
 
      04-28-2006

"Martin Jay" <> wrote in message
news:...
> In message <>, Paul Watt
> <> writes
>>I'm building a email form in a XHTML Strict page. I want to have a drop
>>down
>>selector box with 3 options in it (x,y,z for example). If x is selected I
>>want x to be in the subject line of the email. How can I do this? Can it
>>be
>>done without Javascript?

>
> Do you want to send the email using a mailto link, such as:
>
> <a href="private.php?do=newpm&u=?subject=Email subject"> ?
>
> Selecting the subject from a drop down menu without using a script isn't
> possible.
>
> Another thing to bear in mind is that not everyone has a default email
> client set up on the computer they're using, so this sort of link may
> fail.


I wasn't going to use a mailto link, proberbly a cgi or php processor


 
Reply With Quote
 
Martin Jay
Guest
Posts: n/a
 
      04-28-2006
In message <>, Paul Watt
<> writes
>"Martin Jay" <> wrote in message
>news:...
>> In message <>, Paul Watt
>> <> writes
>>>I'm building a email form in a XHTML Strict page. I want to have a drop
>>>down
>>>selector box with 3 options in it (x,y,z for example). If x is selected I
>>>want x to be in the subject line of the email. How can I do this? Can it
>>>be
>>>done without Javascript?


>> Do you want to send the email using a mailto link, such as:
>>
>> <a href="private.php?do=newpm&u=?subject=Email subject"> ?
>>
>> Selecting the subject from a drop down menu without using a script isn't
>> possible.
>>
>> Another thing to bear in mind is that not everyone has a default email
>> client set up on the computer they're using, so this sort of link may
>> fail.


>I wasn't going to use a mailto link, proberbly a cgi or php processor


Okay, that's good.

So in your HTML you'll have something like the:

<select name="subject">
<option value="Subject 1" SELECTED>Subject 1</option>
<option value="Subject 2">Subject 2</option>
<option value="Subject 3">Subject 3</option>
</select>

Just POST that off to your PHP script and then use the mail command:

$subject = $_POST['subject'];

/* It's probably a good idea to include this so you don't end up with \'
and \" in the subject */

$subject = stripslashes($subject);

mail($to, $subject, $message);
--
Martin Jay
 
Reply With Quote
 
Jerry Stuckle
Guest
Posts: n/a
 
      04-28-2006
Martin Jay wrote:
> In message <>, Paul Watt
> <> writes
>
>>"Martin Jay" <> wrote in message
>>news:...
>>
>>>In message <>, Paul Watt
>>><> writes
>>>
>>>>I'm building a email form in a XHTML Strict page. I want to have a drop
>>>>down
>>>>selector box with 3 options in it (x,y,z for example). If x is selected I
>>>>want x to be in the subject line of the email. How can I do this? Can it
>>>>be
>>>>done without Javascript?

>
>
>>>Do you want to send the email using a mailto link, such as:
>>>
>>><a href="private.php?do=newpm&u=?subject=Email subject"> ?
>>>
>>>Selecting the subject from a drop down menu without using a script isn't
>>>possible.
>>>
>>>Another thing to bear in mind is that not everyone has a default email
>>>client set up on the computer they're using, so this sort of link may
>>>fail.

>
>
>>I wasn't going to use a mailto link, proberbly a cgi or php processor

>
>
> Okay, that's good.
>
> So in your HTML you'll have something like the:
>
> <select name="subject">
> <option value="Subject 1" SELECTED>Subject 1</option>
> <option value="Subject 2">Subject 2</option>
> <option value="Subject 3">Subject 3</option>
> </select>
>
> Just POST that off to your PHP script and then use the mail command:
>
> $subject = $_POST['subject'];
>
> /* It's probably a good idea to include this so you don't end up with \'
> and \" in the subject */
>
> $subject = stripslashes($subject);
>
> mail($to, $subject, $message);


Do this and you will be ripe for becoming a spam relay. At a minimum you need to
ensure there are no newline characters in the input.

--
==================
Remove the "x" from my email address
Jerry Stuckle
JDS Computer Training Corp.

==================
 
Reply With Quote
 
Martin Jay
Guest
Posts: n/a
 
      04-28-2006
In message <XMednXc->, Jerry Stuckle
<> writes
>Martin Jay wrote:
>> Okay, that's good.
>> So in your HTML you'll have something like the:
>> <select name="subject">
>> <option value="Subject 1" SELECTED>Subject 1</option>
>> <option value="Subject 2">Subject 2</option>
>> <option value="Subject 3">Subject 3</option>
>> </select>
>> Just POST that off to your PHP script and then use the mail command:
>> $subject = $_POST['subject'];
>> /* It's probably a good idea to include this so you don't end up
>>with \'
>> and \" in the subject */
>> $subject = stripslashes($subject);
>> mail($to, $subject, $message);


>Do this and you will be ripe for becoming a spam relay. At a minimum
>you need to ensure there are no newline characters in the input.


Please explain why.
--
Martin Jay
 
Reply With Quote
 
Jerry Stuckle
Guest
Posts: n/a
 
      04-28-2006
Martin Jay wrote:
> In message <XMednXc->, Jerry Stuckle
> <> writes
>
>> Martin Jay wrote:
>>
>>> Okay, that's good.
>>> So in your HTML you'll have something like the:
>>> <select name="subject">
>>> <option value="Subject 1" SELECTED>Subject 1</option>
>>> <option value="Subject 2">Subject 2</option>
>>> <option value="Subject 3">Subject 3</option>
>>> </select>
>>> Just POST that off to your PHP script and then use the mail command:
>>> $subject = $_POST['subject'];
>>> /* It's probably a good idea to include this so you don't end up
>>> with \'
>>> and \" in the subject */
>>> $subject = stripslashes($subject);
>>> mail($to, $subject, $message);

>
>
>> Do this and you will be ripe for becoming a spam relay. At a minimum
>> you need to ensure there are no newline characters in the input.

>
>
> Please explain why.



Google "Email injection" for a lot more info. But basically - the user could
enter something like:

This is a spammer subject
bcc: ,

And so on. Quit easy to do - and used by a lot of spammers. Unsecured scripts
are used by a lot of spammers. Try another search on

spam formmail

And see what pops up.




--
==================
Remove the "x" from my email address
Jerry Stuckle
JDS Computer Training Corp.

==================
 
Reply With Quote
 
Martin Jay
Guest
Posts: n/a
 
      04-28-2006
In message <ve-dnQNo9JQ->, Jerry Stuckle
<> writes
>Martin Jay wrote:
>> In message <XMednXc->, Jerry
>>Stuckle <> writes
>>
>>> Martin Jay wrote:
>>>
>>>> Okay, that's good.
>>>> So in your HTML you'll have something like the:
>>>> <select name="subject">
>>>> <option value="Subject 1" SELECTED>Subject 1</option>
>>>> <option value="Subject 2">Subject 2</option>
>>>> <option value="Subject 3">Subject 3</option>
>>>> </select>
>>>> Just POST that off to your PHP script and then use the mail command:
>>>> $subject = $_POST['subject'];
>>>> /* It's probably a good idea to include this so you don't end up
>>>>with \'
>>>> and \" in the subject */
>>>> $subject = stripslashes($subject);
>>>> mail($to, $subject, $message);


>>> Do this and you will be ripe for becoming a spam relay. At a minimum
>>>you need to ensure there are no newline characters in the input.

>> Please explain why.


>Google "Email injection" for a lot more info. But basically - the user
>could enter something like:
>
> This is a spammer subject
> bcc: ,
>
>And so on. Quit easy to do - and used by a lot of spammers. Unsecured
>scripts are used by a lot of spammers. Try another search on
>
> spam formmail
>
>And see what pops up.


I (think) I understand the principle, but I cannot replicate it.

The 'hack' seems to rely on email being routed by the 'to,' 'cc,' and
'bcc' fields in its header, which is isn't. Well, not until it reaches
its destination, maybe.

I emailed Paul an example script earlier. I've also uploaded it to:
<http://www.spam-free.org.uk/pages/email_test.php>.

I would be interested to see how the spamming technique you mention can
be used with it. I have changed the form method from POST to GET to
make it easier to 'hack.'
--
Martin Jay
 
Reply With Quote
 
Jerry Stuckle
Guest
Posts: n/a
 
      04-28-2006
Martin Jay wrote:
> In message <ve-dnQNo9JQ->, Jerry Stuckle
> <> writes
>
>> Martin Jay wrote:
>>
>>> In message <XMednXc->, Jerry
>>> Stuckle <> writes
>>>
>>>> Martin Jay wrote:
>>>>
>>>>> Okay, that's good.
>>>>> So in your HTML you'll have something like the:
>>>>> <select name="subject">
>>>>> <option value="Subject 1" SELECTED>Subject 1</option>
>>>>> <option value="Subject 2">Subject 2</option>
>>>>> <option value="Subject 3">Subject 3</option>
>>>>> </select>
>>>>> Just POST that off to your PHP script and then use the mail command:
>>>>> $subject = $_POST['subject'];
>>>>> /* It's probably a good idea to include this so you don't end up
>>>>> with \'
>>>>> and \" in the subject */
>>>>> $subject = stripslashes($subject);
>>>>> mail($to, $subject, $message);

>
>
>>>> Do this and you will be ripe for becoming a spam relay. At a minimum
>>>> you need to ensure there are no newline characters in the input.
>>>
>>> Please explain why.

>
>
>> Google "Email injection" for a lot more info. But basically - the
>> user could enter something like:
>>
>> This is a spammer subject
>> bcc: ,
>>
>> And so on. Quit easy to do - and used by a lot of spammers.
>> Unsecured scripts are used by a lot of spammers. Try another search on
>>
>> spam formmail
>>
>> And see what pops up.

>
>
> I (think) I understand the principle, but I cannot replicate it.
>
> The 'hack' seems to rely on email being routed by the 'to,' 'cc,' and
> 'bcc' fields in its header, which is isn't. Well, not until it reaches
> its destination, maybe.
>
> I emailed Paul an example script earlier. I've also uploaded it to:
> <http://www.spam-free.org.uk/pages/email_test.php>.
>
> I would be interested to see how the spamming technique you mention can
> be used with it. I have changed the form method from POST to GET to
> make it easier to 'hack.'


Either way. I just make a local copy of your form, edit it to add the headers I
want, and post it back to you. For instance, I place in the subject field:

This is spam
bcc:

And off it goes. The more fields I add, the more I'm sending.

Not hard at all.


--
==================
Remove the "x" from my email address
Jerry Stuckle
JDS Computer Training Corp.

==================
 
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
Person Selector Control Johnny Holland ASP .Net 0 03-30-2005 04:03 PM
warning message for case statements where the selector signal is of type std_logic_vector profpenguin@shaw.ca VHDL 6 02-11-2005 05:38 AM
Multi list box selector and post back question Brian Henry ASP .Net 3 08-18-2004 11:31 PM
Data grid with current page combo box selector Brian Henry ASP .Net 2 07-22-2004 11:13 AM
Color selector Chris ASP .Net 1 12-10-2003 02:42 PM



Advertisments
 



1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57