Re: [PHP] PHP Reference

2010-08-14 Thread Karl DeSaulniers

Thanks tedd.


On Aug 14, 2010, at 7:45 AM, tedd wrote:


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/


Karl DeSaulniers
Design Drumm
http://designdrumm.com


--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



Re: [PHP] PHP Reference

2010-08-14 Thread tedd

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/

--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



Re: [PHP] PHP Reference

2010-08-14 Thread Karl DeSaulniers


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 
> 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
>
> --
> 
> WWW: http://plphp.dk / http://plind.dk
> LinkedIn: http://www.linkedin.com/in/plind
> BeWelcome/Couchsurfing: Fake51
> Twitter: http://twitter.com/kafe15
> 

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



Re: [PHP] PHP Reference

2010-08-14 Thread Ashley Sheridan
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   
> > 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
> >
> > -- 
> > 
> > WWW: http://plphp.dk / http://plind.dk
> > LinkedIn: http://www.linkedin.com/in/plind
> > BeWelcome/Couchsurfing: Fake51
> > Twitter: http://twitter.com/kafe15
> > 
> 
> 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




Re: [PHP] PHP Reference

2010-08-14 Thread Karl DeSaulniers

Thank you Andre.
Yes, I had been doing it that way, but was just wondering if PHP had  
a reference like that of javascript with the colin : in it.


Best,

Karl


On Aug 14, 2010, at 3:50 AM, Andre Polykanine wrote:


Hello Karl,

If I understood you properly, try this:

--
With best regards from Ukraine,
Andre
Skype: Francophile
Twitter: http://twitter.com/m_elensule
Facebook: http://facebook.com/menelion

- Original message -
From: Karl DeSaulniers 
To: php-general 
Date: Saturday, August 14, 2010, 9:08:20 AM
Subject: [PHP] PHP Reference

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 DeSaulniers
Design Drumm
http://designdrumm.com




Karl DeSaulniers
Design Drumm
http://designdrumm.com


--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



Re: [PHP] PHP Reference

2010-08-14 Thread Andre Polykanine
Hello Karl,

If I understood you properly, try this:

-- 
With best regards from Ukraine,
Andre
Skype: Francophile
Twitter: http://twitter.com/m_elensule
Facebook: http://facebook.com/menelion

- Original message -
From: Karl DeSaulniers 
To: php-general 
Date: Saturday, August 14, 2010, 9:08:20 AM
Subject: [PHP] PHP Reference

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 DeSaulniers
Design Drumm
http://designdrumm.com



-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



Re: [PHP] PHP Reference

2010-08-13 Thread Karl DeSaulniers

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   
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

--

WWW: http://plphp.dk / http://plind.dk
LinkedIn: http://www.linkedin.com/in/plind
BeWelcome/Couchsurfing: Fake51
Twitter: http://twitter.com/kafe15



Karl DeSaulniers
Design Drumm
http://designdrumm.com


--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



Re: [PHP] PHP Reference

2010-08-13 Thread Peter Lind
On 14 August 2010 08:08, 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,

No, you can't.

Regards
Peter

-- 

WWW: http://plphp.dk / http://plind.dk
LinkedIn: http://www.linkedin.com/in/plind
BeWelcome/Couchsurfing: Fake51
Twitter: http://twitter.com/kafe15


-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



[PHP] PHP Reference

2010-08-13 Thread Karl DeSaulniers

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 DeSaulniers
Design Drumm
http://designdrumm.com



Re: [PHP] PHP-reference

2008-05-16 Thread Daniel Kressler


"Daniel Brown" <[EMAIL PROTECTED]> wrote:
On Fri, May 16, 2008 at 5:24 PM, Daniel Kressler <[EMAIL PROTECTED]> 
wrote:

Hi!

I want to know, if it's allowed to write an own online reference for PHP,
with own examples and so on?


   Hello, fellow Daniel.  ;-P

   Absolutely!  In fact, you're encouraged to write references and
examples for PHP, and to share your knowledge with the community.  Let
us know how it comes along for you, and be sure to send the URL.


Greetings from Germany


   Greetings from Olyphant, Pennsylvania, USA.  Have a great weekend!


Hello Daniel ;-),

Thank you for your reply!
This is not a problem, if the results are presentable, I will not hesitate 
to communicate.


Many greetings and also a nice weekend!

Daniel 



--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



Re: [PHP] PHP-reference

2008-05-16 Thread Daniel Brown
On Fri, May 16, 2008 at 5:24 PM, Daniel Kressler <[EMAIL PROTECTED]> wrote:
> Hi!
>
> I want to know, if it's allowed to write an own online reference for PHP,
> with own examples and so on?

Hello, fellow Daniel.  ;-P

Absolutely!  In fact, you're encouraged to write references and
examples for PHP, and to share your knowledge with the community.  Let
us know how it comes along for you, and be sure to send the URL.

> Greetings from Germany

Greetings from Olyphant, Pennsylvania, USA.  Have a great weekend!

-- 

Dedicated Servers - Intel 2.4GHz w/2TB bandwidth/mo. starting at just
$59.99/mo. with no contract!
Dedicated servers, VPS, and hosting from $2.50/mo.

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



[PHP] PHP-reference

2008-05-16 Thread Daniel Kressler

Hi!

I want to know, if it's allowed to write an own online reference for PHP, 
with own examples and so on?


I'm looking forward to hearing from you.


Greetings from Germany

Daniel 



--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



[PHP] php reference behavior

2002-12-17 Thread 22 manopohuji

hi, i'm running into some weird behavior with php references.  i
distilled it down to some test code below:

 'dean' );

$var1['arrayref']  =  & $array;

$var2  =  $var1;

echo "var1:\n";
print_r( $var1 );

echo "var2:\n";
print_r( $var2 );

$var1['arrayref']  =  NULL;

echo "var1:\n";
print_r( $var1 );

echo "var2:\n";
print_r( $var2 );

?>

it seems that setting a hash key to a reference to something, and then
repointing that key to NULL, apparently sets the original 'something' to
NULL instead of just 'repointing' the hash key!  am i missing something
obvious here, or is this behavior not what you'd normally expect?  i
wrote similar code in perl, and it behaved as i expected: the second
hash still pointed to the original target (i am almost certain c/c++ and
java also behave this way).  so what is going on with php?  does anyone
know how to get it to do what i want it to do --  i.e., merely unset the
key mapping of one of the hashes, leaving the other hash still pointing
at the target?  thansk for any insight you might be able to give!

xomina





--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php