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

Home » Imported messages » comp.lang.php » Logic behind this?
Show: Today's Messages :: Polls :: Message Navigator
Return to the default flat view Create a new topic Submit Reply
Re: Logic behind this? [message #171538 is a reply to message #171532] Sat, 08 January 2011 02:54 Go to previous messageGo to previous message
Modafinil is currently offline  Modafinil
Messages: 3
Registered: January 2011
Karma:
Junior Member
On Jan 8, 6:49 am, "Peter H. Coffin" <hell...@ninehells.com> wrote:
> On Fri, 7 Jan 2011 13:22:25 -0800 (PST), Modafinil wrote:
>> On Jan 8, 1:13?am, Jerry Stuckle <jstuck...@attglobal.net> wrote:
>>> PHP scripts run on the server, so if you request a PHP script from
>>> another server, it will run on the remote. ?You will get only the output
>>> from that script, just as if you were to request it from a browser.
>
>>> But rather than set variables before including the script, check out
>>> functions and passing parameters to them. ?It makes your code much more
>>> maintainable and reliable.
>
>>> --
>>> ==================
>>> Remove the "x" from my email address
>>> Jerry Stuckle
>>> JDS Computer Training Corp.
>>> jstuck...@attglobal.net
>>> ==================- Hide quoted text -
>
>>> - Show quoted text -
>
>> Yep, wanting to send querystrings to included local PHP files was my
>> shortcut to calling included files' functions, and supplying them with
>> parameters. Thinking about it, that might be a tidier solution than
>> using parent script variables, that appear as globals in the included
>> script, as parameter containers. I can't guarantee that
>> REGISTER_GLOBALS will always be enabled, though it appears to be on
>> the server I'm using, and included file functions may be called more
>> than once. It seems you only get one shot at running code in the
>> global scope, when executing it by inclusion from a parent script.
>
> http://php.net/manual/en/function.getopt.php
>
> You can use that to define optional parameters that (can) duplicate what
> you'd otherwise have passed on a HTTP request. There's no
> "REGISTER_GLOBALS" for this, so you don't even have to get used to it.
>
> And, yeah, you'll want to sanitize the stuff coming in via the options
> similar to how you'd sanitize the stuff coming in on a request.
>
> - Show quoted text -

Another interesting option for efficiently passing parameters to local
includes, and some valuable extra advice too!

M.
[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
Previous Topic: the changeover to mysqli
Next Topic: [urgent] need solution of Questions, in context of PHP5
Goto Forum:
  

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

Current Time: Fri Sep 20 19:19:22 GMT 2024

Total time taken to generate the page: 0.06779 seconds