Forum Moderators: coopster

Message Too Old, No Replies

Call proxy settings from a php script

         

turbohost

2:16 pm on Jan 5, 2005 (gmt 0)

10+ Year Member



Hi Guys,

Is it possible to use proxy settings in a php script? How can I code this?

Thx,
Turbo

turbohost

3:45 pm on Jan 5, 2005 (gmt 0)

10+ Year Member



someone?

jatar_k

11:10 pm on Jan 5, 2005 (gmt 0)

WebmasterWorld Administrator 10+ Year Member



I am not sure I understand what you are wanting to do.

turbohost

4:22 am on Jan 6, 2005 (gmt 0)

10+ Year Member



Well, I've got to access the Internet via php because I want to load a html page and get some information from it. I'm inside a company though and I've got to pass a proxy for internet access. I've got to add username, password and other proxy information to the php script but I don't know how.

coopster

1:07 pm on Jan 6, 2005 (gmt 0)

WebmasterWorld Administrator 10+ Year Member



I don't follow yet either. Are you trying to bypass the proxy?

turbohost

1:28 pm on Jan 6, 2005 (gmt 0)

10+ Year Member



No, I don't want to bypass the proxy ... I want to authenticate to the proxy in my php script.

e.g. I can tell the script to go to www.example.com. This way it will go to www.example.com on port 80 for http. In my company this traffic will drop on the firewalls because direct internet access isn't allowed. To follow the security policy I will have to go through the proxy. To use the proxy I need to send a username and password to the proxy on port 8080. When my authentication is successful I can fetch www.example.com on the Internet.

coopster

1:35 pm on Jan 6, 2005 (gmt 0)

WebmasterWorld Administrator 10+ Year Member



Have you considered curl [php.net]?

turbohost

2:24 pm on Jan 27, 2005 (gmt 0)

10+ Year Member



Hi Guys,

I'm not able to use curl. Isn't there a way to use shell_exec, call iexplore and fetch the content of the page?

Turbo

Timotheos

5:38 pm on Jan 27, 2005 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



Hi turbohost,

This page [php.net] in the php manual talks about using headers to authenticate. I think you're answer lies there, especially in the user comments.

Tim