Re: [PHP] PHP Reference
[email protected] (Karl DeSaulniers)
| Newsgroups | php.general |
|---|---|
| Message-ID | <[email protected]> |
On Aug 14, 2010, at 5:19 AM, Ashley Sheridan wrote: > On Sat, 2010-08-14 at 01:57 -0500, Karl DeSaulniers wrote: >> >> That is what I thought. >> Thank you for confirming. >> >> Karl >> >> >> On Aug 14, 2010, at 1:54 AM, Peter Lind wrote: >> >> > On 14 August 2010 08:08, Karl DeSaulniers <[email protected]> >> > wrote: >> >> Hello all, >> >> I was wondering, can you reference php in a url string like you >> can >> >> javascript. >> >> EG: >> >> "javascript:someFunction()" >> >> >> >> Can you do something similar in php like >> >> >> >> "php:someFunction()" >> >> >> >> I am thinking that you can not do this, but was wondering if there >> >> was >> >> something like that. >> >> Thanks, >> > >> > No, you can't. >> > >> > Regards >> > Peter >> > >> > -- >> > <hype> >> > WWW: http://plphp.dk / http://plind.dk >> > LinkedIn: http://www.linkedin.com/in/plind >> > BeWelcome/Couchsurfing: Fake51 >> > Twitter: http://twitter.com/kafe15 >> > </hype> >> >> Karl DeSaulniers >> Design Drumm >> http://designdrumm.com >> >> > > The reason you can't is because PHP is on the server and Javascript > is local (e.g. the browser). > > Even if the PHP code you're executing is through localhost, because > PHP needs the server to run, it has to be run on the server, and > exposing functions directly like this would expose all sorts of > security issues (imagine calling up a getUserDetails() on a website > you're not logged into for example, which would mean every function > of a system would need some sort of user auth check and would slow > the whole thing to a crawl) > > Thanks, > Ash > http://www.ashleysheridan.co.uk > > I see. Very good point. Thanks Ash. I figured it was because of the whole pre-processing part of PHP. Thanks for the explination. Best, Karl DeSaulniers Design Drumm http://designdrumm.com