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 #182553 is a reply to message #182550] Wed, 14 August 2013 00:45 Go to previous messageGo to previous message
bill is currently offline  bill
Messages: 310
Registered: October 2010
Karma:
Senior Member
On 2013-08-13 7:34 PM, David Robley wrote:
> 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 -----------
>>

....

>> 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`
>
> https://www.google.com.au/search?q=Parse+error:+syntax+error,
> +unexpected+%24end+in&ie=utf-8&oe=utf-8&rls=org.mozilla:en-
> US:official&client=firefox-a&gws_rd=cr will give you the solution. This is
> quite a common error :-)
>
> You probably don't want to use stripslashes unless you KNOW that your data
> will have extraneous slashes added by magic_quotes_* otherwise you may strip
> valid slashes. At least use get_magic_quotes_gpc to see if magic quotes are
> enabled, and only strip slashes if they are
>
Many thanks! I never thought about searching for the error message
itself; it never got me much when I tried, but that was some time ago!
That link contains a cornucopia of good information!

Haven't put its ideas to work yet; too late in the day. But tomorrow
promises to be a better day now.

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: Sun Dec 01 06:29:27 GMT 2024

Total time taken to generate the page: 0.04726 seconds