php-general Digest 10 Aug 2008 08:04:56 -0000 Issue 5616

Topics (messages 277935 through 277944):

ProgramPHP domain offer
        277935 by: Nathan Rixham

Re: PUT vs. POST (was: php File upload)
        277936 by: tedd
        277937 by: Luke
        277938 by: Per Jessen
        277939 by: mike
        277943 by: tedd

Send a cookie with a file_get_contents( ) request?
        277940 by: Anders Norrbring
        277941 by: Per Jessen
        277942 by: Anders Norrbring
        277944 by: Per Jessen

Administrivia:

To subscribe to the digest, e-mail:
        [EMAIL PROTECTED]

To unsubscribe from the digest, e-mail:
        [EMAIL PROTECTED]

To post to the list, e-mail:
        [EMAIL PROTECTED]


----------------------------------------------------------------------
--- Begin Message ---
Hi Guys,

I've cut back on my php programming work, and don't need my domain anymore. Can't think of a better place to pass it on to somebody deserving. As such here it is: ProgramPHP,com - if you fancy it give me a shout / offer via email - please don't reply here as I don't think this is a thread that should be bumped up!

Many Regards All

--- End Message ---
--- Begin Message ---
At 3:50 PM +0100 8/9/08, Richard Heyes wrote:
 > Given that PHP doesn't run on the client, there is no way for anything
 written in PHP to access anything on the client.

Wouldn't it be fun though if it could? :-)

--
Richard Heyes

In a round about way it can, but it's limited.

You see, anything that javascript can discover can be passed to php. The limits are those limits imposed on javascript.

Cheers,

tedd


--
-------
http://sperling.com  http://ancientstones.com  http://earthstones.com

--- End Message ---
--- Begin Message ---
Except if paired with javadcript.

Luke Slater
Lead Developer
NuVoo

On 9 Aug 2008, at 15:09, Per Jessen <[EMAIL PROTECTED]> wrote:

Boyd, Todd M. wrote:

I had to use Java for the simple fact that PHP by itself cannot access
the local file system in a way that allows for the partial loading of
files.

Given that PHP doesn't run on the client, there is no way for anything
written in PHP to access anything on the client.


/Per Jessen, Zürich


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


--- End Message ---
--- Begin Message ---
tedd wrote:

> At 3:50 PM +0100 8/9/08, Richard Heyes wrote:
>>  > Given that PHP doesn't run on the client, there is no way for
>>  > anything
>>>  written in PHP to access anything on the client.
>>
>>Wouldn't it be fun though if it could? :-)
>>
>>--
>>Richard Heyes
> 
> In a round about way it can, but it's limited.
> 

No, it cannot. 

> You see, anything that javascript can discover can be passed to php.
> The limits are those limits imposed on javascript.

Ah, so you mean that _javascript_ can access something on the client -
very true, but javascript!=PHP.  

Of course PHP can do all sorts if you combine it with javascript, black
magic, or what have you, but PHP alone is a server side scripting
language, nothing more nor less.



/Per Jessen, Zürich


--- End Message ---
--- Begin Message ---


On Aug 9, 2008, at 7:50 AM, "Richard Heyes" <[EMAIL PROTECTED]> wrote:

Given that PHP doesn't run on the client, there is no way for anything
written in PHP to access anything on the client.

Wouldn't it be fun though if it could? :-)

--
Richard Heyes
http://www.phpguru.org

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


Years ago someone made an activex component to run php on the client. Apparently it went nowhere.
--- End Message ---
--- Begin Message ---
At 8:20 PM +0200 8/9/08, Per Jessen wrote:
tedd wrote:

 > You see, anything that javascript can discover can be passed to php.
 The limits are those limits imposed on javascript.

Ah, so you mean that _javascript_ can access something on the client -
very true, but javascript!=PHP.
Of course PHP can do all sorts if you combine it with javascript, black
magic, or what have you, but PHP alone is a server side scripting
language, nothing more nor less.


While js != php, they can communicate and that's what I was saying.

There's nothing that js can discover that can't be passed to php and back again -- js and php can communicate and play together. Here's an example:

http://webbytedd.com/b/timed-php/

Cheers,

tedd

--
-------
http://sperling.com  http://ancientstones.com  http://earthstones.com

--- End Message ---
--- Begin Message ---
I have a web site where I use cookies to store logins, and also session
cookies for users logged in.
Is there a way for me to use file_get_contents() to pull content which are
"behind" the login?
In other words, I want to use my own log-in cookie and somehow send it with
the file_get_contents request to get the content.
Can I somehow do this? Or are there other ways?

Anders.


--- End Message ---
--- Begin Message ---
Anders Norrbring wrote:

> I have a web site where I use cookies to store logins, and also
> session cookies for users logged in.
> Is there a way for me to use file_get_contents() to pull content which
> are "behind" the login?
> In other words, I want to use my own log-in cookie and somehow send it
> with the file_get_contents request to get the content.
> Can I somehow do this? Or are there other ways?

I think you can do that by using a stream context.

http://php.net/manual/en/function.stream-context-create.php


/Per Jessen, Zürich


--- End Message ---
--- Begin Message ---
> Anders Norrbring wrote:
> 
> > I have a web site where I use cookies to store logins, and also
> > session cookies for users logged in.
> > Is there a way for me to use file_get_contents() to pull content
> which
> > are "behind" the login?
> > In other words, I want to use my own log-in cookie and somehow send
> it
> > with the file_get_contents request to get the content.
> > Can I somehow do this? Or are there other ways?
> 
> I think you can do that by using a stream context.
> 
> http://php.net/manual/en/function.stream-context-create.php
> 
> 
> /Per Jessen, Zürich


Thanks Per,
I think so too, I glanced it, but unfortunately I have no idea whatsoever about 
*how* to do it...
So, if anyone have suggestions, or concrete examples, please do share!

Anders.


--- End Message ---
--- Begin Message ---
Anders Norrbring wrote:

> Thanks Per,
> I think so too, I glanced it, but unfortunately I have no idea
> whatsoever about *how* to do it... So, if anyone have suggestions, or
> concrete examples, please do share!
> 
> Anders.

I did play around with it once, but I don't have any actual code to
share.  Try this though:

$opts = array(
  'http'=>array(
  'method'=>"GET",
  'header'=>"Accept-language: en\r\n".
            "Cookie: foo=bar\r\n"
  )
);

$context = stream_context_create($opts);

$result=file_get_contents( <url>, FILE_TEXT, $context );


/Per Jessen, Zürich


--- End Message ---

Reply via email to