Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > comp.lang.php > #9544 > unrolled thread

PHP Contact Form, mt-rand(), problem Validating 1 input

Started byTwayne <nobody@spamcop.net>
First post2013-05-23 12:43 -0400
Last post2013-05-25 09:56 +0200
Articles 10 — 4 participants

Back to article view | Back to comp.lang.php


Contents

  PHP Contact Form, mt-rand(), problem Validating 1 input Twayne <nobody@spamcop.net> - 2013-05-23 12:43 -0400
    Re: PHP Contact Form, mt-rand(), problem Validating 1 input Thomas 'PointedEars' Lahn <PointedEars@web.de> - 2013-05-23 18:47 +0200
      Re: PHP Contact Form, mt-rand(), problem Validating 1 input Twayne <nobody@spamcop.net> - 2013-05-23 16:25 -0400
        Re: PHP Contact Form, mt-rand(), problem Validating 1 input Thomas 'PointedEars' Lahn <PointedEars@web.de> - 2013-05-23 22:32 +0200
        Re: PHP Contact Form, mt-rand(), problem Validating 1 input Scott Johnson <noonehome@chalupasworld.com> - 2013-05-23 15:37 -0700
          Re: PHP Contact Form, mt-rand(), problem Validating 1 input Doug Miller <doug_at_milmac_dot_com@example.com> - 2013-05-23 23:01 +0000
            Re: PHP Contact Form, mt-rand(), problem Validating 1 input Twayne <nobody@spamcop.net> - 2013-05-24 11:24 -0400
          Re: PHP Contact Form, mt-rand(), problem Validating 1 input Twayne <nobody@spamcop.net> - 2013-05-24 11:21 -0400
            Re: PHP Contact Form, mt-rand(), problem Validating 1 input Scott Johnson <noonehome@chalupasworld.com> - 2013-05-24 15:31 -0700
              Re: PHP Contact Form, mt-rand(), problem Validating 1 input Thomas 'PointedEars' Lahn <PointedEars@web.de> - 2013-05-25 09:56 +0200

#9544 — PHP Contact Form, mt-rand(), problem Validating 1 input

FromTwayne <nobody@spamcop.net>
Date2013-05-23 12:43 -0400
SubjectPHP Contact Form, mt-rand(), problem Validating 1 input
Message-ID<knlgvf$t8s$1@speranza.aioe.org>
Hi, Newviw here;

Win 7 Home Premium, XAMPP 1.7.3, PHP 5.3,

Two pages:  Form.php, check.php (& thanks.html).
    They work fine; sends e-mail, formatted, and readable.


Form.php:
$d=($a.$b.$c);
    echo "Your code is : " .$d." Enter it in the box below, including 
dashes : <br />";

<form action="Check.php" method="post">
  <b>Your Code: </b><input type="text" name="code" size="10 
maxlength="14" /><br /><br /> ...

BUT:  When I begin to add some security, things quit working.

1st, I add to form.php an mt-rand() build of a random code assigned to $d.

$d=($a.$b.$c);
    echo "Your code is : " .$d." Enter it in the box below, including 
dashes : <br />";

Works OK.

Check.php:
Now, when I try to validate the 'code' in check.php, things stop working.

$code = check_input($_POST['code'], "Enter Your Code");
stops everything in its tracks.

Any comments, advice, leads much appreiated.

TIA.

Twayne`




[toc] | [next] | [standalone]


#9545

FromThomas 'PointedEars' Lahn <PointedEars@web.de>
Date2013-05-23 18:47 +0200
Message-ID<8915447.D8rZLtVrR9@PointedEars.de>
In reply to#9544
Twayne wrote:
^^^^^^

> Hi, Newviw here;
> […] mt-rand() […]
> […] things stop working.
> Any comments, advice, leads much appreiated.

<http://www.catb.org/~esr/faqs/smart-questions.html>


PointedEars
-- 
Prototype.js was written by people who don't know javascript for people
who don't know javascript. People who don't know javascript are not
the best source of advice on designing systems that use javascript.
  -- Richard Cornford, cljs, <f806at$ail$1$8300dec7@news.demon.co.uk>

[toc] | [prev] | [next] | [standalone]


#9547

FromTwayne <nobody@spamcop.net>
Date2013-05-23 16:25 -0400
Message-ID<knltv4$fo8$1@speranza.aioe.org>
In reply to#9545
On 5/23/2013 12:47 PM, Thomas 'PointedEars' Lahn wrote:
> Twayne wrote:
> ^^^^^^
>
>> Hi, Newviw here;
>> […] mt-rand() […]
>> […] things stop working.
>> Any comments, advice, leads much appreiated.
>
> <http://www.catb.org/~esr/faqs/smart-questions.html>
>
>
> PointedEars
>
http://edhelper.com/language/Reading_Skills.htm

[toc] | [prev] | [next] | [standalone]


#9548

FromThomas 'PointedEars' Lahn <PointedEars@web.de>
Date2013-05-23 22:32 +0200
Message-ID<1928585.di2j9RD3mc@PointedEars.de>
In reply to#9547
Twayne wrote:

> On 5/23/2013 12:47 PM, Thomas 'PointedEars' Lahn wrote:
>> Twayne wrote:
>> ^^^^^^
>>
>>> Hi, Newviw here;
>>> […] mt-rand() […]
>>> […] things stop working.
>>> Any comments, advice, leads much appreiated.
>>
>> <http://www.catb.org/~esr/faqs/smart-questions.html>
>
> http://edhelper.com/language/Reading_Skills.htm

*PLONK*

[toc] | [prev] | [next] | [standalone]


#9555

FromScott Johnson <noonehome@chalupasworld.com>
Date2013-05-23 15:37 -0700
Message-ID<knm5fj$pb8$1@dont-email.me>
In reply to#9547
On 5/23/2013 1:25 PM, Twayne wrote:
> On 5/23/2013 12:47 PM, Thomas 'PointedEars' Lahn wrote:
>> Twayne wrote:
>> ^^^^^^
>>
>>> Hi, Newviw here;
>>> […] mt-rand() […]
>>> […] things stop working.
>>> Any comments, advice, leads much appreiated.
>>
>> <http://www.catb.org/~esr/faqs/smart-questions.html>
>>
>>
>> PointedEars
>>
> http://edhelper.com/language/Reading_Skills.htm

WOW, not a good way to get help.  PE was correct.

Supply the code to the failing function and someone may be able to help.

But I would first check the attitude at the door.

Scotty

[toc] | [prev] | [next] | [standalone]


#9557

FromDoug Miller <doug_at_milmac_dot_com@example.com>
Date2013-05-23 23:01 +0000
Message-ID<XnsA1C9C235B34CAdougmilmaccom@78.46.70.116>
In reply to#9555
Scott Johnson <noonehome@chalupasworld.com> wrote in news:knm5fj$pb8$1@dont-
email.me:

> On 5/23/2013 1:25 PM, Twayne wrote:
>> On 5/23/2013 12:47 PM, Thomas 'PointedEars' Lahn wrote:
>>> Twayne wrote:
>>> ^^^^^^
>>>
>>>> Hi, Newviw here;
>>>> […] mt-rand() […]
>>>> […] things stop working.
>>>> Any comments, advice, leads much appreiated.
>>>
>>> <http://www.catb.org/~esr/faqs/smart-questions.html>
>>>
>>>
>>> PointedEars
>>>
>> http://edhelper.com/language/Reading_Skills.htm
> 
> WOW, not a good way to get help.  PE was correct.
> 
> Supply the code to the failing function and someone may be able to help.
> 
> But I would first check the attitude at the door.

Consider the source, Scott.

Twayne is a nym-shifting numbskull from way back. Over in alt.home.repair, many of us 
have had him killfiled for ten or fifteen years. Every year or so, he nymshifts to evade the 
filters; he'd probably do it more often if it didn't take him so long to figure out that nobody's 
reading his posts. He's just recently showed up in some of the computer software NGs, and 
this is at least the second nym of his that I've had to KF since that happened.

[toc] | [prev] | [next] | [standalone]


#9598

FromTwayne <nobody@spamcop.net>
Date2013-05-24 11:24 -0400
Message-ID<kno0mj$1s3$3@speranza.aioe.org>
In reply to#9557
On 5/23/2013 7:01 PM, Doug Miller wrote:
> Scott Johnson <noonehome@chalupasworld.com> wrote in news:knm5fj$pb8$1@dont-
> email.me:
>
>> On 5/23/2013 1:25 PM, Twayne wrote:
>>> On 5/23/2013 12:47 PM, Thomas 'PointedEars' Lahn wrote:
>>>> Twayne wrote:
>>>> ^^^^^^
>>>>

>
> Consider the source, Scott.
>
> Twayne is a nym-shifting numbskull from way back. Over in alt.home.repair, many of us
> have had him killfiled for ten or fifteen years. Every year or so, he nymshifts to evade the
> filters; he'd probably do it more often if it didn't take him so long to figure out that nobody's
> reading his posts. He's just recently showed up in some of the computer software NGs, and
> this is at least the second nym of his that I've had to KF since that happened.
>

Lots of numbskulls in this group.

[toc] | [prev] | [next] | [standalone]


#9596

FromTwayne <nobody@spamcop.net>
Date2013-05-24 11:21 -0400
Message-ID<kno0h2$1s3$1@speranza.aioe.org>
In reply to#9555
On 5/23/2013 6:37 PM, Scott Johnson wrote:
> On 5/23/2013 1:25 PM, Twayne wrote:
>> On 5/23/2013 12:47 PM, Thomas 'PointedEars' Lahn wrote:
>>> Twayne wrote:
>>> ^^^^^^
>>>
>>>> Hi, Newviw here;
>>>> […] mt-rand() […]
>>>> […] things stop working.
>>>> Any comments, advice, leads much appreiated.
>>>
>>> <http://www.catb.org/~esr/faqs/smart-questions.html>
>>>
>>>
>>> PointedEars
>>>
>> http://edhelper.com/language/Reading_Skills.htm
>
> WOW, not a good way to get help.  PE was correct.
>
> Supply the code to the failing function and someone may be able to help.
>
> But I would first check the attitude at the door.
>
> Scotty

I did, Scottie. I posted relevant code and also offered to  provide full 
code if it was necessary. Our "friend" simply decided to remove same in 
his response.  Not good treatment of an admitted newbie.

Twayne`

[toc] | [prev] | [next] | [standalone]


#9617

FromScott Johnson <noonehome@chalupasworld.com>
Date2013-05-24 15:31 -0700
Message-ID<knopfn$nma$1@dont-email.me>
In reply to#9596
On 5/24/2013 8:21 AM, Twayne wrote:
> On 5/23/2013 6:37 PM, Scott Johnson wrote:
>> On 5/23/2013 1:25 PM, Twayne wrote:
<snip>
>>
>> WOW, not a good way to get help.  PE was correct.
>>
>> Supply the code to the failing function and someone may be able to help.
>>
>> But I would first check the attitude at the door.
>>
>> Scotty
>
> I did, Scottie. I posted relevant code and also offered to  provide full
> code if it was necessary. Our "friend" simply decided to remove same in
> his response.  Not good treatment of an admitted newbie.
>
> Twayne`

OK here is your Original Post:

************************
Hi, Newviw here;

Win 7 Home Premium, XAMPP 1.7.3, PHP 5.3,

Two pages:  Form.php, check.php (& thanks.html).
    They work fine; sends e-mail, formatted, and readable.


Form.php:
$d=($a.$b.$c);
    echo "Your code is : " .$d." Enter it in the box below, including 
dashes : <br />";

<form action="Check.php" method="post">
  <b>Your Code: </b><input type="text" name="code" size="10 
maxlength="14" /><br /><br /> ...

BUT:  When I begin to add some security, things quit working.

1st, I add to form.php an mt-rand() build of a random code assigned to $d.

$d=($a.$b.$c);
    echo "Your code is : " .$d." Enter it in the box below, including 
dashes : <br />";

Works OK.

Check.php:
Now, when I try to validate the 'code' in check.php, things stop working.

$code = check_input($_POST['code'], "Enter Your Code");
stops everything in its tracks.

Any comments, advice, leads much appreiated.

TIA.

Twayne`
**********************

1. where is the relevant code of check_input(), the function that you 
said is failing?

2. Where did you say that you will provide full code?

3. Best advice here, IMHO, if you don't like a reply then just ignore 
it.  If you bite back then you lose.

It is not that people do not want to help, but their time is very 
valuable to them and like to get to the straight skinny.  This is 
probably why PE pointed you to how to ask good questions in here.

Will await the code.

Scotty

[toc] | [prev] | [next] | [standalone]


#9642

FromThomas 'PointedEars' Lahn <PointedEars@web.de>
Date2013-05-25 09:56 +0200
Message-ID<1418229.jmzx4tfF8Y@PointedEars.de>
In reply to#9617
Scott Johnson wrote:

> OK here is your Original Post:

Thanks, but no, thanks.

> […]
> It is not that people do not want to help, but their time is very
> valuable to them and like to get to the straight skinny.  This is
> probably why PE pointed you to how to ask good questions in here.

It is one reason why I did that.  The underlying reason is that a person who 
would even invest the time to post something *readable* does not deserve to 
read as answer anything else except advice how to do just that.

Good answers, which require a corresponding amount of free time by the 
person writing them, are to be deserved by posting smart questions, i. e. by 
investing a considerable amount of free time for trying to answer them by 
oneself, and then put them in proper words if that did not work, before they 
are posted.  Who thinks they could save all their free time by just posting 
questions to others should not be surprised if the latter people are not 
willing to invest any of their free time for the answer that the questioner 
meant to save.  Quid pro quo.
 
> Will await the code.

As others pointed out later, apparently “Twayne” is anything but a newbie.  
Please do not feed the troll, then.


PointedEars
-- 
Danny Goodman's books are out of date and teach practices that are
positively harmful for cross-browser scripting.
  -- Richard Cornford, cljs, <cife6q$253$1$8300dec7@news.demon.co.uk> (2004)

[toc] | [prev] | [standalone]


Back to top | Article view | comp.lang.php


csiph-web