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


Groups > comp.lang.php > #10502

Re: Function Problem

From Twayne <nobody@spamcop.net>
Newsgroups comp.lang.php
Subject Re: Function Problem
Date 2013-08-13 19:29 -0400
Organization Aioe.org NNTP Server
Message-ID <kuefgp$n6b$1@speranza.aioe.org> (permalink)
References <kudttm$82o$1@speranza.aioe.org> <ob7l09p0n832dobh7i6e6e5qldk0t45ne5@news.eternal-september.org>

Show all headers | View raw


On 2013-08-13 4:57 PM, Paul Herber wrote:
> On Tue, 13 Aug 2013 14:29:09 -0400, Twayne <nobody@spamcop.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`










Back to comp.lang.php | Previous | Next — Previous in thread | Next in thread | Find similar | Unroll thread


Thread

Function Problem Twayne <nobody@spamcop.net> - 2013-08-13 14:29 -0400
  Re: Function Problem Paul Herber <paul@pherber.com> - 2013-08-13 21:57 +0100
    Re: Function Problem Jerry Stuckle <jstucklex@attglobal.net> - 2013-08-13 17:26 -0400
    Re: Function Problem Twayne <nobody@spamcop.net> - 2013-08-13 19:29 -0400
      Re: Function Problem The Natural Philosopher <tnp@invalid.invalid> - 2013-08-14 10:24 +0100
  Re: Function Problem Norman Peelman <npeelman@cfl.rr.com> - 2013-08-13 19:25 -0400
    Re: Function Problem Twayne <nobody@spamcop.net> - 2013-08-13 19:39 -0400
  Re: Function Problem David Robley <me@home.invalid> - 2013-08-14 09:04 +0930
    Re: Function Problem Twayne <nobody@spamcop.net> - 2013-08-13 20:45 -0400
    PS Re: Function Problem Twayne <nobody@spamcop.net> - 2013-08-13 20:51 -0400
  Re: Function Problem Richard Yates <richard@yatesguitar.com> - 2013-08-13 16:48 -0700
    Re: Function Problem Twayne <nobody@spamcop.net> - 2013-08-13 21:00 -0400
  Re: Function Problem "J.O. Aho" <user@example.net> - 2013-08-14 07:10 +0200
    Re: Function Problem Twayne <nobody@spamcop.net> - 2013-08-15 18:17 -0400
  Re: Function Problem RESOLVED Twayne <nobody@spamcop.net> - 2013-08-15 17:28 -0400
    Re: Function Problem RESOLVED Tim Streater <timstreater@greenbee.net> - 2013-08-15 23:15 +0100
      Re: Function Problem RESOLVED Twayne <nobody@spamcop.net> - 2013-08-15 18:59 -0400
        Re: Function Problem RESOLVED Tim Streater <timstreater@greenbee.net> - 2013-08-16 08:50 +0100
          Re: Function Problem RESOLVED Twayne <nobody@spamcop.net> - 2013-08-17 13:41 -0400
    Re: Function Problem RESOLVED Norman Peelman <npeelman@cfl.rr.com> - 2013-08-16 06:43 -0400
      Re: Function Problem RESOLVED Twayne <nobody@spamcop.net> - 2013-08-17 13:44 -0400

csiph-web