Re: PHP Reference
| From: | tedd | Date: | Sat, 14 Aug 2010 12:45:50 +0000 |
| Subject: | Re: PHP Reference | ||
| References: | 1 | Groups: | php.general |
| Request: | Send a blank email to php-general+get-307467@lists.php.net to get a copy of this message | ||
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/