Re: [PHP] PHP Header to stimulate a POST method or POST string????

2004-02-19 Thread Scott Fletcher
I still get this message with the class HTTP_Request (Pear).

--snip--
Warning: fsockopen() [function.fsockopen]: php_hostconnect: connect failed
in /home/website/emarket/www/zz_test_dir/Net/Socket.php on line 108

Warning: fsockopen() [function.fsockopen]: unable to connect to
216.109.118.68:80 in /home/website/emarket/www/zz_test_dir/Net/Socket.php on
line 108
--snip--

The script I put down are

--snip--
?
   include('Request.php');

   $a = new HTTP_Request('http://www.yahoo.com/');
   $a-sendRequest();
   echo $a-getResponseBody();
?
--snip--

Scott F.
[EMAIL PROTECTED] wrote in message
news:[EMAIL PROTECTED]
 Firstly i luv the subject mwuahhaha, you may want to check out the pear
 class HTTP_Request , it'll do post and get sockets.

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



Re: [PHP] PHP Header to stimulate a POST method or POST string????

2004-02-19 Thread Scott Fletcher
Yes, the script on the box can run and hit google.  I did with telent and it
connected successfully and type a make-up word 'get' follow by the enter key
and got a response below...

--snip--
htmlheadtitle400 Bad Request/titlestyle!--body {font-family:
arial,sans-serif}div.nav {margin-top: 1ex}div.nav A {font-size: 10pt;
font-family: arial,sans-serif}span.nav {font-size: 10pt; font-family:
arial,sans-serif; font-weight: bold}div.nav A,span.big {font-size: 12pt;
color: #cc}div.nav A {font-size: 10pt; color: black}A.l:link {color:
#6f6f6f}A.u:link {color: green}//--/style/headbody text=#00
bgcolor=#fftable border=0 cellpadding=2 cellspacing=0
width=100%trtd rowspan=3 width=1% nowrapbfont face=times
color=#0039b6 size=10G/fontfont face=times color=#c41200
size=10o/fontfont face=times color=#f3c518 size=10o/fontfont
face=times color=#0039b6 size=10g/fontfont face=times color=#30a72f
size=10l/fontfont face=times color=#c41200
size=10e/fontnbsp;nbsp;/btdnbsp;/td/trtrtd
bgcolor=#3366ccfont face=arial,sans-serif
color=#ffbError/b/td/trtrtdnbsp;/td/tr/tableblockqu
oteH1Bad Request/H1Your client has issued a malformed or illegal
request.p/blockquotetable width=100% cellpadding=0
cellspacing=0trtd bgcolor=#3366ccimg alt= width=1
height=4/td/tr/table/body/htmlConnection closed.
--snip--

John Nichel [EMAIL PROTECTED] wrote in message
news:[EMAIL PROTECTED]
 Scott Fletcher wrote:

  This is what I get...
 
  --snip--
  1
  Warning: fsockopen() [function.fsockopen]: php_hostconnect: connect
failed
  in /home/website/emarket/www/zz_test.php on line 4
 
  Warning: fsockopen() [function.fsockopen]: unable to connect to
  www.google.com:80 in /home/website/emarket/www/zz_test.php on line 4
  [13] [Permission denied]
  --snip--

 Can the box where the script lives and runs hit google?

 -- 
 By-Tor.com
 It's all about the Rush
 http://www.by-tor.com

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



[PHP] PHP Header to stimulate a POST method or POST string????

2004-02-18 Thread Scott Fletcher
Hi!

I am wonder if it is possible to use the header(Location:
https://www.blah.net;) while stimulating it as a POST method/string.
Because I need to hide the get/post string as you would with a HTML form's
POST method.

   What I have here is header(Location:
https://www.blah.net?PHPSESSID=.$salt) for example, so to treat it as a
POST like would be ...

header(Location: https://www.blah.net;);
header( ??? );   //for PHPSESSID and other post strings...


Thanks,
   Scott F.

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



Re: [PHP] PHP Header to stimulate a POST method or POST string????

2004-02-18 Thread Chris Shiflett
--- Scott Fletcher [EMAIL PROTECTED] wrote:
 I am wonder if it is possible to use the header(Location:
 https://www.blah.net;) while stimulating it as a POST method/string.

It is not, and if you think about that for a minute, you should be glad.

You cannot force the user to submit a POST request to any URL, but you can
submit a POST request yourself and then show the content of the response
to the user.

There are PEAR classes that can help you with this (most of the HTTP_*
ones), the cURL extension can do it, and you can also do it yourself
manually with fopen():

http://shiflett.org/hacks/php/http_post

Hope that helps.

Chris

=
Chris Shiflett - http://shiflett.org/

PHP Security - O'Reilly
 Coming mid-2004
HTTP Developer's Handbook - Sams
 http://httphandbook.org/
PHP Community Site
 http://phpcommunity.org/

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



Re: [PHP] PHP Header to stimulate a POST method or POST string????

2004-02-18 Thread Scott Fletcher
Whoa!!  I never thought about that.  Now, I'm beginning to understand
this...  Fortunately, I have Mozilla, so I found out about the Live HTTP
header extension, not releted to the keywords while Google searching just
recently so I installed it and saw that it is different than I thought.  I
saw no Location: feature, now your comments surely would be of a help.
Thanks a million!  Now I'll have to decide which one to use..

Scott F.


Chris Shiflett [EMAIL PROTECTED] wrote in message
news:[EMAIL PROTECTED]
 --- Scott Fletcher [EMAIL PROTECTED] wrote:
  I am wonder if it is possible to use the header(Location:
  https://www.blah.net;) while stimulating it as a POST method/string.

 It is not, and if you think about that for a minute, you should be glad.

 You cannot force the user to submit a POST request to any URL, but you can
 submit a POST request yourself and then show the content of the response
 to the user.

 There are PEAR classes that can help you with this (most of the HTTP_*
 ones), the cURL extension can do it, and you can also do it yourself
 manually with fopen():

 http://shiflett.org/hacks/php/http_post

 Hope that helps.

 Chris

 =
 Chris Shiflett - http://shiflett.org/

 PHP Security - O'Reilly
  Coming mid-2004
 HTTP Developer's Handbook - Sams
  http://httphandbook.org/
 PHP Community Site
  http://phpcommunity.org/

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



Re: [PHP] PHP Header to stimulate a POST method or POST string????

2004-02-18 Thread Scott Fletcher
Groan!!!   I get permission denied error for fsockopen().   I looked
around on the Internet and it narrow down to the temporary directory like
/tmp for unix.  I don't believe that is the problem because the $_SESSION
feature work great without a problem.  The file permission doesn't seem to
be the problem because the directory folder is already at dr-xr-xr-x, so
not sure what the problem is exactly...

Scott F.
Chris Shiflett [EMAIL PROTECTED] wrote in message
news:[EMAIL PROTECTED]
 --- Scott Fletcher [EMAIL PROTECTED] wrote:
  I am wonder if it is possible to use the header(Location:
  https://www.blah.net;) while stimulating it as a POST method/string.

 It is not, and if you think about that for a minute, you should be glad.

 You cannot force the user to submit a POST request to any URL, but you can
 submit a POST request yourself and then show the content of the response
 to the user.

 There are PEAR classes that can help you with this (most of the HTTP_*
 ones), the cURL extension can do it, and you can also do it yourself
 manually with fopen():

 http://shiflett.org/hacks/php/http_post

 Hope that helps.

 Chris

 =
 Chris Shiflett - http://shiflett.org/

 PHP Security - O'Reilly
  Coming mid-2004
 HTTP Developer's Handbook - Sams
  http://httphandbook.org/
 PHP Community Site
  http://phpcommunity.org/

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



Re: [PHP] PHP Header to stimulate a POST method or POST string????

2004-02-18 Thread Chris Shiflett
--- Scott Fletcher [EMAIL PROTECTED] wrote:
 Groan!!!  I get permission denied error for fsockopen().

Do you know what allow_url_fopen is set to?

You should be able to use this to check:

http://www.php.net/ini_get

Chris

=
Chris Shiflett - http://shiflett.org/

PHP Security - O'Reilly
 Coming mid-2004
HTTP Developer's Handbook - Sams
 http://httphandbook.org/
PHP Community Site
 http://phpcommunity.org/

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



Re: [PHP] PHP Header to stimulate a POST method or POST string????

2004-02-18 Thread Scott Fletcher
It said it is set to 1 from ini_get(), it also said on from php.ini...

Scott F.

Chris Shiflett [EMAIL PROTECTED] wrote in message
news:[EMAIL PROTECTED]
 --- Scott Fletcher [EMAIL PROTECTED] wrote:
  Groan!!!  I get permission denied error for fsockopen().

 Do you know what allow_url_fopen is set to?

 You should be able to use this to check:

 http://www.php.net/ini_get

 Chris

 =
 Chris Shiflett - http://shiflett.org/

 PHP Security - O'Reilly
  Coming mid-2004
 HTTP Developer's Handbook - Sams
  http://httphandbook.org/
 PHP Community Site
  http://phpcommunity.org/

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



Re: [PHP] PHP Header to stimulate a POST method or POST string????

2004-02-18 Thread Chris Shiflett
--- Scott Fletcher [EMAIL PROTECTED] wrote:
 It said it is set to 1 from ini_get(), it also said on from php.ini.

In that case, you should be able to do this. Can you restate exactly what
you tried (perhaps a small sample script?) and what the error message was?

Chris

=
Chris Shiflett - http://shiflett.org/

PHP Security - O'Reilly
 Coming mid-2004
HTTP Developer's Handbook - Sams
 http://httphandbook.org/
PHP Community Site
 http://phpcommunity.org/

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



Re: [PHP] PHP Header to stimulate a POST method or POST string????

2004-02-18 Thread Scott Fletcher
Sample code is  $fp = fsockopen(www.whatever.com, 443, $errno, $errmsg);

Error message is $errno -- 13 and $errmsg -- Permission denied...

I think I understand the problem.  I'm using the self-created certificate
without having it be signed by certificate authority.  When I tried the
cURL, it refuse to work and give an SSL error..  Problem is the self-created
certificate is only temporary until the website development is ready for
production where I can then get a real SSL certificate with Certificate
Authority.

So, the question is how to get fsockopen to work with temporary certificate
if this is the problem.

Scott F

Chris Shiflett [EMAIL PROTECTED] wrote in message
news:[EMAIL PROTECTED]
 --- Scott Fletcher [EMAIL PROTECTED] wrote:
  It said it is set to 1 from ini_get(), it also said on from php.ini.

 In that case, you should be able to do this. Can you restate exactly what
 you tried (perhaps a small sample script?) and what the error message was?

 Chris

 =
 Chris Shiflett - http://shiflett.org/

 PHP Security - O'Reilly
  Coming mid-2004
 HTTP Developer's Handbook - Sams
  http://httphandbook.org/
 PHP Community Site
  http://phpcommunity.org/

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



Re: [PHP] PHP Header to stimulate a POST method or POST string????

2004-02-18 Thread Scott Fletcher
That's not the one, I tried it with port 80 and still get the error message,
so ssl have nothing to do with it.

Scott F.
Scott Fletcher [EMAIL PROTECTED] wrote in message
news:[EMAIL PROTECTED]
 Sample code is  $fp = fsockopen(www.whatever.com, 443, $errno, $errmsg);

 Error message is $errno -- 13 and $errmsg -- Permission denied...

 I think I understand the problem.  I'm using the self-created certificate
 without having it be signed by certificate authority.  When I tried the
 cURL, it refuse to work and give an SSL error..  Problem is the
self-created
 certificate is only temporary until the website development is ready for
 production where I can then get a real SSL certificate with Certificate
 Authority.

 So, the question is how to get fsockopen to work with temporary
certificate
 if this is the problem.

 Scott F

 Chris Shiflett [EMAIL PROTECTED] wrote in message
 news:[EMAIL PROTECTED]
  --- Scott Fletcher [EMAIL PROTECTED] wrote:
   It said it is set to 1 from ini_get(), it also said on from php.ini.
 
  In that case, you should be able to do this. Can you restate exactly
what
  you tried (perhaps a small sample script?) and what the error message
was?
 
  Chris
 
  =
  Chris Shiflett - http://shiflett.org/
 
  PHP Security - O'Reilly
   Coming mid-2004
  HTTP Developer's Handbook - Sams
   http://httphandbook.org/
  PHP Community Site
   http://phpcommunity.org/

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



Re: [PHP] PHP Header to stimulate a POST method or POST string????

2004-02-18 Thread Chris Shiflett
--- Scott Fletcher [EMAIL PROTECTED] wrote:
 Sample code is $fp = fsockopen(www.whatever.com, 443, $errno,
 $errmsg);
 
 Error message is $errno -- 13 and $errmsg -- Permission denied

I'd recommend forgetting the SSL bit for now and trying this with a
regular Web server.

I'm not sure what permission denied is about. You should get a connection
refused message if there is any networking problem or firewall preventing
the connection. Can you try this script:

?
echo ini_get('allow_url_fopen');
$fp = fsockopen('www.google.com', 80, $errno, $errmsg);
echo [$errno] [$errmsg];
?

Maybe this will reveal something. You can also want to manually test this:

telnet www.google.com 80

Just to see if you can connect from the host where this script is running.

Chris



=
Chris Shiflett - http://shiflett.org/

PHP Security - O'Reilly
 Coming mid-2004
HTTP Developer's Handbook - Sams
 http://httphandbook.org/
PHP Community Site
 http://phpcommunity.org/

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



Re: [PHP] PHP Header to stimulate a POST method or POST string????

2004-02-18 Thread Scott Fletcher
This is what I get...

--snip--
1
Warning: fsockopen() [function.fsockopen]: php_hostconnect: connect failed
in /home/website/emarket/www/zz_test.php on line 4

Warning: fsockopen() [function.fsockopen]: unable to connect to
www.google.com:80 in /home/website/emarket/www/zz_test.php on line 4
[13] [Permission denied]
--snip--

Chris Shiflett [EMAIL PROTECTED] wrote in message
news:[EMAIL PROTECTED]
 --- Scott Fletcher [EMAIL PROTECTED] wrote:
  Sample code is $fp = fsockopen(www.whatever.com, 443, $errno,
  $errmsg);
 
  Error message is $errno -- 13 and $errmsg -- Permission denied

 I'd recommend forgetting the SSL bit for now and trying this with a
 regular Web server.

 I'm not sure what permission denied is about. You should get a connection
 refused message if there is any networking problem or firewall preventing
 the connection. Can you try this script:

 ?
 echo ini_get('allow_url_fopen');
 $fp = fsockopen('www.google.com', 80, $errno, $errmsg);
 echo [$errno] [$errmsg];
 ?

 Maybe this will reveal something. You can also want to manually test this:

 telnet www.google.com 80

 Just to see if you can connect from the host where this script is running.

 Chris



 =
 Chris Shiflett - http://shiflett.org/

 PHP Security - O'Reilly
  Coming mid-2004
 HTTP Developer's Handbook - Sams
  http://httphandbook.org/
 PHP Community Site
  http://phpcommunity.org/

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



Re: [PHP] PHP Header to stimulate a POST method or POST string????

2004-02-18 Thread Scott Fletcher
P.S.  The telnet part, it said...

--snip--
Trying
Connected to www.google.akadns.net
--snip--

When I exited, I get HTML codes dumped on screen along with bad request...

Scott F.
Chris Shiflett [EMAIL PROTECTED] wrote in message
news:[EMAIL PROTECTED]
 --- Scott Fletcher [EMAIL PROTECTED] wrote:
  Sample code is $fp = fsockopen(www.whatever.com, 443, $errno,
  $errmsg);
 
  Error message is $errno -- 13 and $errmsg -- Permission denied

 I'd recommend forgetting the SSL bit for now and trying this with a
 regular Web server.

 I'm not sure what permission denied is about. You should get a connection
 refused message if there is any networking problem or firewall preventing
 the connection. Can you try this script:

 ?
 echo ini_get('allow_url_fopen');
 $fp = fsockopen('www.google.com', 80, $errno, $errmsg);
 echo [$errno] [$errmsg];
 ?

 Maybe this will reveal something. You can also want to manually test this:

 telnet www.google.com 80

 Just to see if you can connect from the host where this script is running.

 Chris



 =
 Chris Shiflett - http://shiflett.org/

 PHP Security - O'Reilly
  Coming mid-2004
 HTTP Developer's Handbook - Sams
  http://httphandbook.org/
 PHP Community Site
  http://phpcommunity.org/

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



Re: [PHP] PHP Header to stimulate a POST method or POST string????

2004-02-18 Thread John Nichel
Scott Fletcher wrote:

This is what I get...

--snip--
1
Warning: fsockopen() [function.fsockopen]: php_hostconnect: connect failed
in /home/website/emarket/www/zz_test.php on line 4
Warning: fsockopen() [function.fsockopen]: unable to connect to
www.google.com:80 in /home/website/emarket/www/zz_test.php on line 4
[13] [Permission denied]
--snip--
Can the box where the script lives and runs hit google?

--
By-Tor.com
It's all about the Rush
http://www.by-tor.com
--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php


Re: [PHP] PHP Header to stimulate a POST method or POST string????

2004-02-18 Thread daniel
Firstly i luv the subject mwuahhaha, you may want to check out the pear
class HTTP_Request , it'll do post and get sockets.

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