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 #182547 is a reply to message #182546] Tue, 13 August 2013 21:26 Go to previous messageGo to previous message
Jerry Stuckle is currently offline  Jerry Stuckle
Messages: 2598
Registered: September 2010
Karma:
Senior Member
On 8/13/2013 4:57 PM, Paul Herber wrote:
> On Tue, 13 Aug 2013 14:29:09 -0400, Twayne <nobody(at)spamcop(dot)net> wrote:
>
>> Hi All,
>> Seems like I'm getting to be a regular fixture here but ... I'm baaack!
>>
>> Using win 7, XAMPP, PHP 5.3 & NoteTab, a semi-ide as my text editor:
>>
>> I've created a Function that works on other pages but after working for
>> some time, no longer functions. I don't think the Function is the
>> obvious problem; see below it for more details. The function is:
>>
>> 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?
>
>
>

Code will never "fall into" a function. The code in the function will
only be executed when the function is called. However, you are correct
in that most programmers put functions at the top of the page. Maybe a
leftover from early C, or maybe because people just want to get it out
of the way :)

And Twayne doesn't want my help, so I'll stop here.


--
==================
Remove the "x" from my email address
Jerry Stuckle
JDS Computer Training Corp.
jstucklex(at)attglobal(dot)net
==================
[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: Sun Dec 01 05:07:57 GMT 2024

Total time taken to generate the page: 0.04324 seconds