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


Groups > comp.lang.php > #10501

Re: Function Problem

From Norman Peelman <npeelman@cfl.rr.com>
Newsgroups comp.lang.php
Subject Re: Function Problem
Date 2013-08-13 19:25 -0400
Organization A noiseless patient Spider
Message-ID <kuefa5$ggm$1@dont-email.me> (permalink)
References <kudttm$82o$1@speranza.aioe.org>

Show all headers | View raw


On 08/13/2013 02:29 PM, Twayne 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:
>
> ----------- error message ----------------
> Parse error: syntax error, unexpected $end in C:\xampp\htdocs\twa2.php
> on line 114
> ----------- end error message -----------
>
>      BUT, moving the lines around and monitoring the line number the
> error is reported on seems to be PAST line 117 OR line 117, depending on
> (your guess is as good as mine).

   Moving what lines around? Is this script only or are you jumping in 
and out of PHP and HTML?

>
> I've removed the PHP End (?>) and of course that results in the expected
> error message. Deleting session_destroy and die had no effect on
> anything; error lines remained in the same places, different line
> numbers of course.
>
> Realizing PHP's often misleading line numbers, I went through each and
> every use of the function call on the entire page.
>
> I don't understand what the "unexpected $end" might be; I've looked and
> looked without sucess.  All I feel sure of at the moment is that it's
> not the function itself: I've used it and others on other pages and
> other forms and they all worked fine. I'm going to restudy my error log
> and see if I can find anything there but I don't think I will. I'm
> thinking it's actually a type somewhere but darned if I can find it!
>     Hmm, wonder if it matters where the function is located within the
> file? I'll have to look into that more.
>

   No, it should be fine,

> So ... if anyone has any ideas, leads, suggestions or comments on this
> matter I'd sincerely appreciate your input and will provide anything
> else I can should you have questions.
>     I am not allowed to post full code, so the above is really all I can
> reveal in actual code.
>     I don't think I'm a newbie, but at the same time I'm not overly
> experienced either; still a lot to learn!
>
> Thanks in advance,
>
> Twayne`
>

   The function as coded is fine, it's all there, nothing is missing. 
Therefor the error lies above it. check for unclosed () {} ""...


-- 
Norman
Registered Linux user #461062
-Have you been to www.php.net yet?-

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