FUDforum
Fast Uncompromising Discussions. FUDforum will get your users talking.

Home » Imported messages » comp.lang.php » Function Problem
Show: Today's Messages :: Polls :: Message Navigator
Return to the default flat view Create a new topic Submit Reply
Re: Function Problem [message #182549 is a reply to message #182546] Tue, 13 August 2013 23:29 Go to previous messageGo to previous message
bill is currently offline  bill
Messages: 310
Registered: October 2010
Karma:
Senior Member
On 2013-08-13 4:57 PM, Paul Herber wrote:
> On Tue, 13 Aug 2013 14:29:09 -0400, Twayne <nobody(at)spamcop(dot)net> wrote:
>
>> Hi All,

....

>>
>> 109 // FUNCTIONS USED: ------------------------------
>> 110
>> 111 function check_input($data)
>> 112 {
>> 113 $data = trim($data);
>> 114 $data = stripslashes($data);
>> 115 $data = htmlspecialchars($data);
>> 116 return $data;
>> 117 }
>> 118 ?>
>> ============== end function =========
>>
>> That code resides at the end of the php page in question so there is
>> normally nothing after it but a session_destroy() and a die(); Message
>> has been e-mailed. The error message is:
>
> Functions like this would normally go at the beginning of the page.
> Are you sure that PHP execution isn't falling through from lines above?
>
>
>

Thanks, Paul, I've been playing with just that.
First I chose a location where no use of the function had occurred
yet. No change.
Finally I moved it all the way to the top, and it started to work!!
But my joy was short-lived as when I closed/restarted my browser to kill
off all session counters etc., the error was back!
Unfortunately I did two things at once: Moved similar code on the
preceding page to the very top also (no white space of any kind)
immediately after session_start. I ran the entire form over and that
preceding page worked OK, but the original page I queried about, then
gave me a familiar PHP message:
-----------
Parse error: syntax error, unexpected $end in C:\xampp\htdocs\twa2.php
on line 112
-----------

Different place in the text, not at the end, but it IS prior to ending
PHP and starting HTML code!

I should probably tell anyone reading now to Stand Down;
much as I hate to, I think I'll back up to an archived version that
WAS working but without most of the validation rules and containing
preset inputs to make the forms quicker to test.

My thanks to you and I'll be back when this is resolved to explain
whatever I discover is the danged reason! <g>

Regards,

Twayne`
[Message index]
 
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Previous Topic: Email attachment 0bytes using php4
Next Topic: AND and OR
Goto Forum:
  

-=] Back to Top [=-
[ Syndicate this forum (XML) ] [ RSS ]

Current Time: Thu Sep 19 12:42:43 GMT 2024

Total time taken to generate the page: 0.03566 seconds