Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

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

6 views
Skip to first unread message

Twayne

unread,
May 23, 2013, 12:43:25 PM5/23/13
to
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`





Thomas 'PointedEars' Lahn

unread,
May 23, 2013, 12:47:34 PM5/23/13
to
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$8300...@news.demon.co.uk>

Twayne

unread,
May 23, 2013, 4:25:10 PM5/23/13
to
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

Thomas 'PointedEars' Lahn

unread,
May 23, 2013, 4:32:14 PM5/23/13
to
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*

Scott Johnson

unread,
May 23, 2013, 6:37:21 PM5/23/13
to
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

Doug Miller

unread,
May 23, 2013, 7:01:30 PM5/23/13
to
Scott Johnson <noon...@chalupasworld.com> wrote in news:knm5fj$pb8$1@dont-
email.me:
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.

Twayne

unread,
May 24, 2013, 11:21:05 AM5/24/13
to
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`

Twayne

unread,
May 24, 2013, 11:24:05 AM5/24/13
to
On 5/23/2013 7:01 PM, Doug Miller wrote:
> Scott Johnson <noon...@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.

Scott Johnson

unread,
May 24, 2013, 6:31:03 PM5/24/13
to
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:

************************
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

Thomas 'PointedEars' Lahn

unread,
May 25, 2013, 3:56:06 AM5/25/13
to
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$8300...@news.demon.co.uk> (2004)
0 new messages