Re: [PHP] PHP Reference

[email protected] (tedd)
Newsgroups php.general
Message-ID <p06240800c88c3e8d788b@[192.168.1.104]>
At 1:08 AM -0500 8/14/10, Karl DeSaulniers 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,

Karl:

As others have answered, no php doesn't work that way.

However, you can still send/receive strings through a url via a 
$_GET) and direct the actions of a receiving php script and you can 
do the same thing via a $_POST.

As such, a "php:someFunction()" could be a:

url?php=someFunction

Where the receiving script takes the command and runs someFunction().

However, I would shorten it a bit and say

url?php=18

Where php would be the command to run a function and 18 would be the 
function you want to run.

So, while you can't use the same syntax as javascript, you can get 
the same performance.

Cheers,

tedd


-- 
-------
http://sperling.com/
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.