Re: [PHP] http request

2010-12-05 Thread Daniel Molina Wegener
On Sunday 05 December 2010,
Moses jam...@gmail.com wrote:

 Hi Everyone,

  Hello...

 
 I would like to know whether there is a http request PHP script. I
 would like to use in cases where a background script is running for
 sometime and outputs the results in PHP once the script  has been
 executed.

  You can try cURL:

  http://php.net/manual/en/book.curl.php

 
 
 Thanks.
 
 musa


Best regards,
-- 
Daniel Molina Wegener dmw [at] coder [dot] cl
System Programmer  Web Developer
Phone: +56 (2) 979-0277 | Blog: http://coder.cl/


Re: [PHP] http request

2010-12-05 Thread Shreyas
I am not sure if I understand the question with clarity. What exactly  
do you mean by a HTTP request script?


Since it involves a web server to run the PHP script, the HTTP request  
and response will be the backbone of the whole transaction. But like I  
mentioned earlier, I could be seeing the question wrong.


--Shreyas

Sent from my iPhone

On 05-Dec-2010, at 18:09, Moses jam...@gmail.com wrote:


Hi Everyone,

I would like to know whether there is a http request PHP script. I
would like to use in cases where a background script is running for
sometime and outputs the results in PHP once the script  has been  
executed.



Thanks.

musa


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



Re: [PHP] http://www.mytrash.mail.ua spam

2010-10-13 Thread Joshua Kehn
I get the same thing but wrote it off as someone's autoresponder. I didn't 
check the email address.

Regards,

-Josh

Joshua Kehn | josh.k...@gmail.com
http://joshuakehn.com

On Oct 13, 2010, at 2:52 PM, Ashley Sheridan wrote:

 I know this isn't PHP related, but every day I post to this list I get a 
 message back from mytr...@mail.ua mytr...@mail.ua which is an 
 auto-responder.
 
 It is rather annoying, and makes little sense for whoever is using this 
 service to sign up to a mailing list and not make this service aware of the 
 mailing list at all.
 
 Please could whomsoever is responsible please try to figure something out 
 with it. It's ironic, because while it appears to be aimed at preventing 
 spam, it is actually creating spam for me, and doubtless many others.
 
 Thanks,
 Ash
 http://www.ashleysheridan.co.uk
 
 
 
 From: mytr...@mail.ua mytr...@mail.ua
 Date: October 13, 2010 2:28:04 PM EDT
 To: Ashley Sheridan a...@ashleysheridan.co.uk
 Subject: Требуется подтверждение отправки Вашего письма для mytr...@mail.ua
 Reply-To: mytr...@mail.ua mytr...@mail.ua
 
 
 (see english version below)
 (дивіться українську версію нижче)
 
 
 Я использую антиспам-систему, которая не позволяет принимать письма
 от незнакомых отправителей, не внесенных в мою адресную книгу (белый 
 список),
 поэтому ваше письмо было помещено в папку Спам.
 
 Для того чтобы переместить ваше письмо в папку Входящие сообщения,
 перейдите по этой ссылке:
 http://www.mytrash.mail.ua/confirm/1286994421.H636465P22409.mx.mail.ua
 
 После этого ваш адрес будет автоматически добавлен в мою адресную книгу,
 и вы сможете отправлять мне письма с адреса Ashley Sheridan 
 a...@ashleysheridan.co.uk
 без дополнительных проверок.
 
 Вы также можете отправлять мне сообщения в любой момент с моей персональной 
 страницы:
 http://www.mytrash.mail.ua
 
 Спасибо за понимание,
 sender owner mytr...@mail.ua
 
 
 -- english ---
 
 Confirmation is required to send your message to mytr...@mail.ua
 
 
 My antispam system detected your message as possible SPAM,
 because your address is not listed in my address book (white list).
 
 To confirm that your message is not a spam, please open the following link:
 http://www.mytrash.mail.ua/confirm/1286994421.H636465P22409.mx.mail.ua
 
 After that your address will be automatically added into
 my address book and you will be able to send me messages from
 Ashley Sheridan a...@ashleysheridan.co.uk without any additional checks.
 
 You can also use my personal webpage and send me a message anytime:
 http://www.mytrash.mail.ua.
 
 Thank you,
 sender owner mytr...@mail.ua
 
 
 -- українська ---
 
 Потрібне підтвердження відправки Вашого листа для mytr...@mail.ua
 
 
 Я використовую антиспам-систему, яка не дозволяє приймати листи
 від незнайомих відправників, не внесених у мою адресну книгу (білий список),
 тому ваш лист був поміщений у папку Спам.
 
 Для того, щоб перенести ваш лист до Вхідних повідомлень,
 перейдіть по цьому посиланню:
 http://www.mytrash.mail.ua/confirm/1286994421.H636465P22409.mx.mail.ua
 
 Після цього ваша адреса буде автоматично додана в мою адресну книгу,
 і ви зможете відправляти мені листи з вашої адреси Ashley Sheridan 
 a...@ashleysheridan.co.uk
 без жодних додаткових перевірок.
 
 Ви також можете відправляти мені повідомлення в будь-який момент з моєї 
 персональної сторінки:
 http://www.mytrash.mail.ua.
 
 Дякую вам за розуміння,
 sender owner mytr...@mail.ua
 
 
 
 -- 
 PHP General Mailing List (http://www.php.net/)
 To unsubscribe, visit: http://www.php.net/unsub.php



Re: [PHP] http://www.mytrash.mail.ua spam

2010-10-13 Thread Daniel P. Brown
2010/10/13 Ashley Sheridan a...@ashleysheridan.co.uk

 I know this isn't PHP related, but every day I post to this list I get a 
 message back from mytr...@mail.ua mytr...@mail.ua which is an 
 auto-responder.

 It is rather annoying, and makes little sense for whoever is using this 
 service to sign up to a mailing list and not make this service aware of the 
 mailing list at all.

 Please could whomsoever is responsible please try to figure something out 
 with it. It's ironic, because while it appears to be aimed at preventing 
 spam, it is actually creating spam for me, and doubtless many others.

I'll drop them from the list if I get the chance later.  If I
don't, and you keep getting them, bitch at us on the webmaster list
(php-webmas...@lists.php.net).

--
/Daniel P. Brown
Dedicated Servers, Cloud and Cloud Hybrid Solutions, VPS, Hosting
(866-) 725-4321
http://www.parasane.net/

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



Re: [PHP] http vs https

2010-01-23 Thread Jonathan Tapicer
Hi,

isset($_SERVER['HTTPS']) should do it.

Regards,

Jonathan

On Sat, Jan 23, 2010 at 2:11 PM, Ben Miller biprel...@gmail.com wrote:
 Is there a PHP function that will return whether the request was http or
 https?  I have functions that need to cURL other servers - sometimes over
 SSL, sometimes not, depending whether the function is called from
 http://www.mydomain.com/script_that_calls_function.php or
 https://www.mydomain.com/script_that_calls_function.php



 Hope the question is clear.  Thanks,



 Ben







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



Re: [PHP] HTTP headers and include()

2009-07-12 Thread Lenin
On Fri, Jul 10, 2009 at 12:49 PM, Michael A. Peters mpet...@mac.com wrote:

 James Colannino wrote:



 White space can cause this - make sure your code has ?php as the very top
 and ? at the very bottom, or the white space may trigger the web server to
 send a header and the white space as data before the cookie for
 session_start() is sent.



Well, at the end of the file dont put a ? on your php files especially
which files you are gonna include at others. It would save you some
dreadfull buggy times. Its also practiced in the framework programming.


Re: [PHP] HTTP headers and include()

2009-07-12 Thread Ashley Sheridan
On Sunday 12 July 2009 12:01:12 Lenin wrote:
 On Fri, Jul 10, 2009 at 12:49 PM, Michael A. Peters mpet...@mac.com wrote:
  James Colannino wrote:
 
 
 
  White space can cause this - make sure your code has ?php as the very
  top and ? at the very bottom, or the white space may trigger the web
  server to send a header and the white space as data before the cookie for
  session_start() is sent.

 Well, at the end of the file dont put a ? on your php files especially
 which files you are gonna include at others. It would save you some
 dreadfull buggy times. Its also practiced in the framework programming.

Well, some frameworks insist on it being in there. I tend to always include 
them, but I use a text editor that I know won't add characters to the end 
after the final ?

-- 
Thanks,
Ash
http://www.ashleysheridan.co.uk

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



Re: [PHP] HTTP headers and include()

2009-07-12 Thread tedd

At 12:09 PM +0100 7/12/09, Ashley Sheridan wrote:

On Sunday 12 July 2009 12:01:12 Lenin wrote:

 On Fri, Jul 10, 2009 at 12:49 PM, Michael A. Peters mpet...@mac.com wrote:
  James Colannino wrote:
 
 
 
  White space can cause this - make sure your code has ?php as the very
  top and ? at the very bottom, or the white space may trigger the web
  server to send a header and the white space as data before the cookie for
  session_start() is sent.

 Well, at the end of the file dont put a ? on your php files especially
 which files you are gonna include at others. It would save you some
 dreadfull buggy times. Its also practiced in the framework programming.


Well, some frameworks insist on it being in there. I tend to always include
them, but I use a text editor that I know won't add characters to the end
after the final ?

--
Thanks,
Ash


Ash:

I do the same. It would brother me (lack of symmetry) if I didn't 
include a ? at the end of my scripts.


As for additional characters after the ?, I make sure my 
terminations don't have any. Just because characters can be white 
space doesn't mean you can't detect them.


Cheers,

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

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



Re: [PHP] HTTP headers and include()

2009-07-12 Thread Zareef Ahmed
On Fri, Jul 10, 2009 at 12:54 PM, James Colannino ja...@colannino.orgwrote:

 Eddie Drapkin wrote:

  HTTP headers are sent and finalized after the first bit of output.   I
  had the same problem before and it turned out to be because I had a
  close tag ? at the end of a file followed by some whitespace.  The
  solution was to remove the ? from the end of all the files and I
  haven't closed an entire file since.  Perhaps that might be it?

 Hmm...  In fact, I did close all my include files with the ? tag, and
 per Michael's observation in another response, there is a line of
 whitespace after the closing tag in my include files.

 I tried getting rid of the trailing whitespace, and removed the closing
 tags.  Unfortunately, even after that, when I place my include files
 before session_start, I get the same problem.  There's no leading
 whitespace before the starting ?php tag, so I'm still a little at a loss.

 It's not too big of a deal though; I simply placed my include files
 after the call to session_start().  That seems to solve the problem.


That's a good practice, (Although not optimal is some application setups )
but I am wondering why you are not getting information about exact place
where output is being started.
You should get a headers already sent output started at  kind of error
if you have enabled error reporting with display_errors ON.



 James

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




-- 
Zareef Ahmed :: A PHP Developer in India ( Delhi )
Homepage :: http://www.zareef.net


Re: [PHP] HTTP headers and include()

2009-07-12 Thread James Colannino
Zareef Ahmed wrote:

 You should get a headers already sent output started at  kind of error
 if you have enabled error reporting with display_errors ON.

Actually, I did.  I just didn't think to mention it in my first post.
The thing was that it said it was coming from one of my includes, even
though I wasn't yet printing anything to the browser.  That's why I was
so confused.

I've been following what tedd said in an earlier post (to make
session_start() your first line of code) and haven't had a problem since.

James


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



Re: [PHP] HTTP headers and include()

2009-07-12 Thread Zareef Ahmed
On Sun, Jul 12, 2009 at 11:27 PM, James Colannino ja...@colannino.orgwrote:

 Zareef Ahmed wrote:

  You should get a headers already sent output started at  kind of
 error
  if you have enabled error reporting with display_errors ON.

 Actually, I did.  I just didn't think to mention it in my first post.
 The thing was that it said it was coming from one of my includes, even
 though I wasn't yet printing anything to the browser.  That's why I was
 so confused.


Its not only print or echo command which may output.
 As Michael was pointing even a space can cause this problem.
Your error message will tell you about exact location of the problem spot
with line number.

(If you are only getting this problem after uploading your code to server
then your FTP client may be culprit)




 I've been following what tedd said in an earlier post (to make
 session_start() your first line of code) and haven't had a problem since.


Yes, its a good practice for almost all applications and you should do it
always unless you have a reason to do otherwise.
If its really hard to maintain (like working with older codebase with lots
of references to session_start in the middle of application process) then
just putting ob_start at very start of application can also solve the
problem.


 James


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




-- 
Zareef Ahmed :: A PHP Developer in India ( Delhi )
Homepage :: http://www.zareef.net


Re: [PHP] HTTP headers and include()

2009-07-10 Thread James Colannino
Eddie Drapkin wrote:

 HTTP headers are sent and finalized after the first bit of output.   I
 had the same problem before and it turned out to be because I had a
 close tag ? at the end of a file followed by some whitespace.  The
 solution was to remove the ? from the end of all the files and I
 haven't closed an entire file since.  Perhaps that might be it?

Hmm...  In fact, I did close all my include files with the ? tag, and
per Michael's observation in another response, there is a line of
whitespace after the closing tag in my include files.

I tried getting rid of the trailing whitespace, and removed the closing
tags.  Unfortunately, even after that, when I place my include files
before session_start, I get the same problem.  There's no leading
whitespace before the starting ?php tag, so I'm still a little at a loss.

It's not too big of a deal though; I simply placed my include files
after the call to session_start().  That seems to solve the problem.

James

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



Re: [PHP] HTTP headers and include()

2009-07-10 Thread kranthi
a single line break after the closing ? will not cause this problem. PHP
interpreter will neglect a single line break after ? a good debugger like
xdebug will be helpful in this case. u can also see the source code of the
file to locate the output. any thing before php warning is the output before
session_start()


Re: [PHP] HTTP headers and include()

2009-07-10 Thread Michael A. Peters

tedd wrote:

At 12:24 AM -0700 7/10/09, James Colannino wrote:

Eddie Drapkin wrote:


 HTTP headers are sent and finalized after the first bit of output.   I
 had the same problem before and it turned out to be because I had a
 close tag ? at the end of a file followed by some whitespace.  The
 solution was to remove the ? from the end of all the files and I
 haven't closed an entire file since.  Perhaps that might be it?


Hmm...  In fact, I did close all my include files with the ? tag, and
per Michael's observation in another response, there is a line of
whitespace after the closing tag in my include files.

I tried getting rid of the trailing whitespace, and removed the closing
tags.  Unfortunately, even after that, when I place my include files
before session_start, I get the same problem.  There's no leading
whitespace before the starting ?php tag, so I'm still a little at a 
loss.


It's not too big of a deal though; I simply placed my include files
after the call to session_start().  That seems to solve the problem.

James



James:

As I understand things, that's the way it is supposed to work -- you 
always start a session page off with session_start() as your first 
statement.


I've had some pages complain that a session has already been started and 
in that case, I check to see if a session ID is set and it not, then do 
a session_start().


 But, as a matter of habit, I always make session_start() my first line 
of code.


Cheers,

tedd



If the included file has

?php
somefunc() {
  }
?

?php
somefunc() {
  }
?

that will also cause it.
Or maybe one of the include files includes a file (IE db connection 
script) that has white space.


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



Re: [PHP] HTTP headers and include()

2009-07-09 Thread Eddie Drapkin
On Fri, Jul 10, 2009 at 1:21 AM, James Colanninoja...@colannino.org wrote:
 Hey everyone,

 I've been hard at work on a new web application, and discovered
 something that I would never have seen coming.  I was noticing that when
 I called session_start() after a few lines of includes, I was getting
 complaints because the HTTP headers had already been sent out.  Then,
 after putting session_start() above the include lines, suddenly
 everything was working fine.

 The files that were included were nothing more than functions; there was
 no code executing that I could tell up to the point of the call to
 session_start().

 I was just wondering if anybody on the list knows why HTTP headers were
 being sent out by my includes.  I'm sure there's a good reason.  I'm
 just very curious :)

 Thanks very much in advance.

 James

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



HTTP headers are sent and finalized after the first bit of output.   I
had the same problem before and it turned out to be because I had a
close tag ? at the end of a file followed by some whitespace.  The
solution was to remove the ? from the end of all the files and I
haven't closed an entire file since.  Perhaps that might be it?

--Eddie

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



Re: [PHP] HTTP headers and include()

2009-07-09 Thread Michael A. Peters

James Colannino wrote:

Hey everyone,

I've been hard at work on a new web application, and discovered
something that I would never have seen coming.  I was noticing that when
I called session_start() after a few lines of includes, I was getting
complaints because the HTTP headers had already been sent out.  Then,
after putting session_start() above the include lines, suddenly
everything was working fine.

The files that were included were nothing more than functions; there was
no code executing that I could tell up to the point of the call to
session_start().

I was just wondering if anybody on the list knows why HTTP headers were
being sent out by my includes.  I'm sure there's a good reason.  I'm
just very curious :)

Thanks very much in advance.

James



White space can cause this - make sure your code has ?php as the very 
top and ? at the very bottom, or the white space may trigger the web 
server to send a header and the white space as data before the cookie 
for session_start() is sent.


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



Re: [PHP] HTTP Authentication

2008-11-19 Thread Craige Leeder

Thiago H. Pojda wrote:

Guys,

I have to access a WS that uses HTTP auth directly with PHP.

I've tried using the usual http://user:[EMAIL PROTECTED]/ but I couldn't get it
working. I believe it has something to do with the password containing a #
(can't change it) and the browser thinks it's an achor or something.

All I've seen were scripts to implement HTTP Auth in PHP, nothing about
actually logging in with PHP.

Is it possible to send the authentication headers the first time I access
the link? I could send all necessary headers to the page I'm trying to
access and retrieve it's content at once.


Thanks,
  



Why don't you let yourself in regardless of the credentials and print 
them out to make sure they're being evaluated as you expect.


- Craige

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



Re: [PHP] HTTP Authentication

2008-11-19 Thread Thiago H. Pojda
On Wed, Nov 19, 2008 at 11:34 AM, Craige Leeder [EMAIL PROTECTED] wrote:

 Thiago H. Pojda wrote:

 Guys,

 I have to access a WS that uses HTTP auth directly with PHP.

 I've tried using the usual http://user:[EMAIL PROTECTED]/ but I couldn't get
 it
 working. I believe it has something to do with the password containing a #
 (can't change it) and the browser thinks it's an achor or something.

 All I've seen were scripts to implement HTTP Auth in PHP, nothing about
 actually logging in with PHP.

 Is it possible to send the authentication headers the first time I access
 the link? I could send all necessary headers to the page I'm trying to
 access and retrieve it's content at once.


 Thanks,


  Why don't you let yourself in regardless of the credentials and print them
 out to make sure they're being evaluated as you expect.

 - Craige


I can' t change the WebService, it's not mine. If it were, I could manage to
test some stuff but now all I can do is type it's address in my browser,
login and see the content I want my app to see.


Thanks,
-- 
Thiago Henrique Pojda


RE: [PHP] HTTP Authentication

2008-11-19 Thread Boyd, Todd M.
 -Original Message-
 From: Craige Leeder [mailto:[EMAIL PROTECTED]
 Sent: Wednesday, November 19, 2008 8:35 AM
 To: Thiago H. Pojda
 Cc: PHP-General List
 Subject: Re: [PHP] HTTP Authentication
 
 Thiago H. Pojda wrote:
  Guys,
 
  I have to access a WS that uses HTTP auth directly with PHP.
 
  I've tried using the usual http://user:[EMAIL PROTECTED]/ but I
couldn't
 get it
  working. I believe it has something to do with the password
 containing a #
  (can't change it) and the browser thinks it's an achor or something.
 
  All I've seen were scripts to implement HTTP Auth in PHP, nothing
 about
  actually logging in with PHP.
 
  Is it possible to send the authentication headers the first time I
 access
  the link? I could send all necessary headers to the page I'm trying
 to
  access and retrieve it's content at once.
 
 
  Thanks,
 
 
 
 Why don't you let yourself in regardless of the credentials and print
 them out to make sure they're being evaluated as you expect.

Well... he said he needs to access a WS, not that he administrates it or
has any control over the authentication, etc.

As for the Basic Authentication, I believe you can send the
authentication info in the headers (instead of the URL). If you have
problems implementing that in straight PHP, perhaps cURL could be of
some assistance.

http://www.httprevealer.com/article_basic_authentication.htm - this
outlines the header formats, etc... just remember--you will need to
Base64 encode username:password for the Authorization header.

HTH,


// Todd

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



Re: [PHP] HTTP Authentication

2008-11-19 Thread Andrew Ballard
On Wed, Nov 19, 2008 at 9:26 AM, Thiago H. Pojda [EMAIL PROTECTED] wrote:
 Guys,

 I have to access a WS that uses HTTP auth directly with PHP.

 I've tried using the usual http://user:[EMAIL PROTECTED]/ but I couldn't get 
 it
 working. I believe it has something to do with the password containing a #
 (can't change it) and the browser thinks it's an achor or something.

 All I've seen were scripts to implement HTTP Auth in PHP, nothing about
 actually logging in with PHP.

 Is it possible to send the authentication headers the first time I access
 the link? I could send all necessary headers to the page I'm trying to
 access and retrieve it's content at once.


 Thanks,
 --
 Thiago Henrique Pojda


You're passing the username and password as part of a URL, so
shouldn't the username and password be urlencoded? I'm thinking it
will work if you replace the '#' sign with %23.

Andrew

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



Re: [PHP] HTTP Authentication [ SOLVED ]

2008-11-19 Thread Thiago H. Pojda
On Wed, Nov 19, 2008 at 12:15 PM, Andrew Ballard [EMAIL PROTECTED] wrote:

 On Wed, Nov 19, 2008 at 9:26 AM, Thiago H. Pojda [EMAIL PROTECTED]
 wrote:
  Guys,
 
  I have to access a WS that uses HTTP auth directly with PHP.
 
  I've tried using the usual http://user:[EMAIL PROTECTED]/ but I couldn't
 get it
  working. I believe it has something to do with the password containing a
 #
  (can't change it) and the browser thinks it's an achor or something.
 
  All I've seen were scripts to implement HTTP Auth in PHP, nothing about
  actually logging in with PHP.
 
  Is it possible to send the authentication headers the first time I access
  the link? I could send all necessary headers to the page I'm trying to
  access and retrieve it's content at once.
 
 
  Thanks,
  --
  Thiago Henrique Pojda
 

 You're passing the username and password as part of a URL, so
 shouldn't the username and password be urlencoded? I'm thinking it
 will work if you replace the '#' sign with %23.

 Andrew


I only tried thworing urlencode on everything, which obviously didn't work.

Both ways worked, using %23 for '#' and the snippet from Nathan.


Thanks a lot everyone, I was about to build all the headers and stuff :P

Regards,
-- 
Thiago Henrique Pojda


RE: [PHP] HTTP Authentication [ SOLVED ]

2008-11-19 Thread Boyd, Todd M.
 -Original Message-
 From: Thiago H. Pojda [mailto:[EMAIL PROTECTED]
 Sent: Wednesday, November 19, 2008 11:47 AM
 To: Andrew Ballard
 Cc: PHP-General List
 Subject: Re: [PHP] HTTP Authentication [ SOLVED ]
 
 On Wed, Nov 19, 2008 at 12:15 PM, Andrew Ballard [EMAIL PROTECTED]
 wrote:
 
  On Wed, Nov 19, 2008 at 9:26 AM, Thiago H. Pojda
 [EMAIL PROTECTED]
  wrote:
   Guys,
  
   I have to access a WS that uses HTTP auth directly with PHP.
  
   I've tried using the usual http://user:[EMAIL PROTECTED]/ but I
 couldn't
  get it
   working. I believe it has something to do with the password
 containing a
  #
   (can't change it) and the browser thinks it's an achor or
 something.
  
   All I've seen were scripts to implement HTTP Auth in PHP, nothing
 about
   actually logging in with PHP.
  
   Is it possible to send the authentication headers the first time I
 access
   the link? I could send all necessary headers to the page I'm
trying
 to
   access and retrieve it's content at once.
  
  
   Thanks,
   --
   Thiago Henrique Pojda
  
 
  You're passing the username and password as part of a URL, so
  shouldn't the username and password be urlencoded? I'm thinking it
  will work if you replace the '#' sign with %23.
 
  Andrew
 
 
 I only tried thworing urlencode on everything, which obviously didn't
 work.
 
 Both ways worked, using %23 for '#' and the snippet from Nathan.
 
 
 Thanks a lot everyone, I was about to build all the headers and stuff
 :P

All the headers, meaning 2? :) Glad to hear you've solved your
problem, anyway..


// Todd

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



Re: [PHP] HTTP Authentication [ SOLVED ]

2008-11-19 Thread Thiago H. Pojda
On Wed, Nov 19, 2008 at 2:49 PM, Boyd, Todd M. [EMAIL PROTECTED] wrote:

  -Original Message-
  From: Thiago H. Pojda [mailto:[EMAIL PROTECTED]
  Sent: Wednesday, November 19, 2008 11:47 AM
  To: Andrew Ballard
  Cc: PHP-General List
  Subject: Re: [PHP] HTTP Authentication [ SOLVED ]
 
  On Wed, Nov 19, 2008 at 12:15 PM, Andrew Ballard [EMAIL PROTECTED]
  wrote:
 
   On Wed, Nov 19, 2008 at 9:26 AM, Thiago H. Pojda
  [EMAIL PROTECTED]
   wrote:
Guys,
   
I have to access a WS that uses HTTP auth directly with PHP.
   
I've tried using the usual http://user:[EMAIL PROTECTED]/ but I
  couldn't
   get it
working. I believe it has something to do with the password
  containing a
   #
(can't change it) and the browser thinks it's an achor or
  something.
   
All I've seen were scripts to implement HTTP Auth in PHP, nothing
  about
actually logging in with PHP.
   
Is it possible to send the authentication headers the first time I
  access
the link? I could send all necessary headers to the page I'm
 trying
  to
access and retrieve it's content at once.
   
   
Thanks,
--
Thiago Henrique Pojda
   
  
   You're passing the username and password as part of a URL, so
   shouldn't the username and password be urlencoded? I'm thinking it
   will work if you replace the '#' sign with %23.
  
   Andrew
  
 
  I only tried thworing urlencode on everything, which obviously didn't
  work.
 
  Both ways worked, using %23 for '#' and the snippet from Nathan.
 
 
  Thanks a lot everyone, I was about to build all the headers and stuff
  :P

 All the headers, meaning 2? :) Glad to hear you've solved your
 problem, anyway..


 // Todd

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


Haha, yes, 'all' those :)

I thought there were many more, thankfully it only needed Basic and the
other - which I forgot now.

Thank you too :)
-- 
Thiago Henrique Pojda


Re: [PHP] HTTP Authentication [ SOLVED ]

2008-11-19 Thread Andrew Ballard
On Wed, Nov 19, 2008 at 12:47 PM, Thiago H. Pojda
[EMAIL PROTECTED] wrote:
 On Wed, Nov 19, 2008 at 12:15 PM, Andrew Ballard [EMAIL PROTECTED] wrote:

 On Wed, Nov 19, 2008 at 9:26 AM, Thiago H. Pojda [EMAIL PROTECTED]
 wrote:
  Guys,
 
  I have to access a WS that uses HTTP auth directly with PHP.
 
  I've tried using the usual http://user:[EMAIL PROTECTED]/ but I couldn't
  get it
  working. I believe it has something to do with the password containing a
  #
  (can't change it) and the browser thinks it's an achor or something.
 
  All I've seen were scripts to implement HTTP Auth in PHP, nothing about
  actually logging in with PHP.
 
  Is it possible to send the authentication headers the first time I
  access
  the link? I could send all necessary headers to the page I'm trying to
  access and retrieve it's content at once.
 
 
  Thanks,
  --
  Thiago Henrique Pojda
 

 You're passing the username and password as part of a URL, so
 shouldn't the username and password be urlencoded? I'm thinking it
 will work if you replace the '#' sign with %23.

 Andrew

 I only tried thworing urlencode on everything, which obviously didn't work.

 Both ways worked, using %23 for '#' and the snippet from Nathan.


 Thanks a lot everyone, I was about to build all the headers and stuff :P

 Regards,
 --
 Thiago Henrique Pojda


Yes. If you go that route, you have to separately urlencode each piece
of data rather than the whole URL because you don't want the valid
delimiters like the colon, @ symbol, slashes, etc. to get encoded.

Andrew

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



Re: [PHP] HTTP PUT for file uploads

2008-08-01 Thread Micah Gersten
Is this a repetitive thing your clients will do many times?  I recently
created a backup solution using ssh keys and the pecl ssh extension to
automate backups.  Then a cronjob sorts the files on the server.  It's a
lot more secure than allowing PUTs.

Thank you,
Micah Gersten
onShore Networks
Internal Developer
http://www.onshore.com



mike wrote:
 It appears that PHP can support the PUT method using php://stdin and
 appropriately configuring the webserver to accept it.

 My company needs a file upload solution that will support large file
 uploads (2GB limit is optional - if we have to tell them less than 2GB
 that's fine) that will keep re-trying the upload until it is done. We
 have slow geo users and then just flat out large files to deal with
 even from fast connections.

 There's a variety of Java-based PUT uploaders.

 So far, we haven't found any Flash ones (we'd love to NOT use Java) -
 but there is a way to do it apparently, we just can't find anyone
 who's done it yet.

 I'm assuming that we should keep the connection open as long as there
 is some activity and maybe timeout after a minute or two... the
 client-side applet should have the logic to continue retrying and
 since it is PUT, the PHP script will accept the data and use fseek()
 on the file to resume at the offset supplied (the client will have to
 give us that info)

 See the examples here:
 http://www.radinks.com/upload/examples/ - look at the Handlers that
 support resume section.

 Anyone have any thoughts? I think I need to tweak PHP settings
 too possibly as well, for max execution time and such. But also any
 uploader ideas would be great.

 The reason for using this is FTP/SFTP require logins or some sort of
 pick up process or two step process to first upload the file then
 have the user associate it (or a cronjob somehow associate and move
 it) to it's final destination. HTTP isn't the best for file uploads
 but it appears PUT does support resuming, and we just want the
 cleanest possible frontend to it. Java stuff is slow, Flash would be
 better, but it appears Flash only supports basic POST/GET and you have
 to use a third party library (and possibly the latest Flex?) to be
 able to support other HTTP methods. If anyone has any products or
 knows of any projects, open source solutions would be best but money
 is not an object basically so we'd be open to commercial ones as well.
 We want the least amount of work for the end-user, so no thick clients
 and hopefully the most compact [cross-platform] browser applet as
 well. (I am assuming Flash does finally work on Linux)

   

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



Re: [PHP] HTTP PUT for file uploads

2008-08-01 Thread mike
On 8/1/08, Micah Gersten [EMAIL PROTECTED] wrote:

 Is this a repetitive thing your clients will do many times?  I recently
 created a backup solution using ssh keys and the pecl ssh extension to
 automate backups.  Then a cronjob sorts the files on the server.  It's a
 lot more secure than allowing PUTs.

Yes, we have end users (non-employees) and other employees from all
geographies (slow connections in China, India), USA, europe, etc, etc.
uploading files of any size and any shape. Video files, audio files,
executables, PDFs, anything.

This is a general purpose file upload solution for our content
management system used worldwide. We can't really create a list of
users and such, as it's open to anyone to contribute. We still
moderate/filter/etc. as needed. We're not worried about security, each
file will have its own unique location so they wouldn't clobber each
other, and they'll be isolated and not executed on the server, so
security to me isn't a concern. The webserver is already open to the
world, SSH/SFTP and FTP are not; so that would technically open that
up to the world, and actually open up more attack vectors :)

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



Re: [PHP] http response 200

2008-06-20 Thread Iv Ray

joaquinbordado wrote:
 'm a total newbie..i just want to know how can i display an http 
response 200


Don't have time to customize it for you, but that's how it can be done-

header(HTTP/1.0 404 Not Found);
/*
 *
 * I copied the DOCTYPE from what Apache 1.3.34 returns.
 *
 */
echo !DOCTYPE HTML PUBLIC \-//IETF//DTD HTML 2.0//EN\;
echo html;
echo head;
echo title404 Not Found/title;
echo /head;
echo body;
echo h1Not Found/h1;
echo pThe requested URL  . $_SERVER['REQUEST_URL'] . was not found 
on this server./p;

echo hr;

Note, that you must not have any output before sending header(). There 
is a way to check, write back, if interested how.


Iv

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



Re: [PHP] http response 200

2008-06-20 Thread Iv Ray

ryan gacusana wrote:

here is my code
when accessing this url
http://localhost/podcast/podcast.php?mobile=0823172message=2343443=%3Eryan 


This runs on your computer, I can't access it.


else
echo Message has been sent successfully.;
// in this part i want to respond with a status of 200,sorry i just 
started php last wik


Actually... If you print this text, the web server sends status 200 to 
the browser on its own accord. Or am I missing something.


The code I sent you sends custom 404 Not Found - in case you need that.

Iv

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



Re: [PHP] http response 200

2008-06-20 Thread Daniel Brown
On Fri, Jun 20, 2008 at 5:35 AM, joaquinbordado [EMAIL PROTECTED] wrote:

 'm a total newbie..i just want to know how can i display an http response 200
 with this message message successfully sent ...here is my code

HTTP code 200 just means OK.  Any successful location and serving
of a web file will result in HTTP 200.

 ?php
 if ($status == RETEMP02)
 echo Mobile number is empty.;
 elseif ($status == RETEMP03)
 echo Message is empty.;
 elseif ($status == RETEMP05)
 echo Message Id is empty.;
 elseif ($status == RETVAL03)
 echo Invalid mobile number.;
 elseif ($status == RETVAL04)
 echo Mobile number not recognized.;
 elseif ($status == RETVAL05)
 echo Message is containing illegal character.;
 elseif ($status == )
 echo Message sending failed;
 else
 echo Message has been sent successfully.;
 ?

My preference here would be:

?php
if ($status == RETEMP02) {
echo Mobile number is empty.;
} elseif ($status == RETEMP03) {
echo Message is empty.;
} elseif ($status == RETEMP05) {
echo Message Id is empty.;
} elseif ($status == RETVAL03) {
echo Invalid mobile number.;
} elseif ($status == RETVAL04) {
echo Mobile number not recognized.;
} elseif ($status == RETVAL05) {
echo Message is containing illegal character.;
} elseif ($status == ) {
echo Message sending failed;
} else {
echo Message has been sent successfully.;
}
?

In any case, regardless of what message is echoed out from above,
it will give an HTTP 200/OK response.

-- 
/Daniel P. Brown
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



Re: [PHP] http response 200

2008-06-20 Thread tedd

At 3:57 PM -0400 6/20/08, Daniel Brown wrote:

My preference here would be:

?php
if ($status == RETEMP02) {
echo Mobile number is empty.;
} elseif ($status == RETEMP03) {
echo Message is empty.;
} elseif ($status == RETEMP05) {
echo Message Id is empty.;
} elseif ($status == RETVAL03) {
echo Invalid mobile number.;
} elseif ($status == RETVAL04) {
echo Mobile number not recognized.;
} elseif ($status == RETVAL05) {
echo Message is containing illegal character.;
} elseif ($status == ) {
echo Message sending failed;
} else {
echo Message has been sent successfully.;
}
?



Arrggg!

switch ($status)
   {
   case 'RETEMP02':
   echo Mobile number is empty.;
   break;

   case 'RETEMP03':
   echo Message is empty.;
   break;

   case 'RETEMP05':
   echo Message Id is empty.;
   break;

   case 'RETVAL03':
   echo Invalid mobile number.;
   break;

   case 'RETVAL04':
   echo Mobile number not recognized.;
   break;

   case 'RETVAL05':
   echo Message is containing illegal character.;
   break;

   default:
   echo Message has been sent successfully.;
   break;
   }

For me, this is easier to read, edit, maintain, and understand. And, 
the reason why I have never used elseif -- thank God the case 
statement came before elseif's.


And don't think that I don't see all of you scurrying away checking 
old programming manuals to prove me wrong, but I think you'll find 
I'm right.  :-)


In any event, elseif's are vexations to the sprit.

Cheers,

tedd

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

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



RE: [PHP] HTTP Server Written entirely in PHP ?

2008-04-18 Thread Hans Zaunere
 I was wondering if there was any HTTP server written entirely in PHP
 with the following features:
 
 1. HTTP/1.1 compliance
 2. Apache mod_rewrite-like URL rewrite support
 3. Native PHP support ( not through CGI/FastCGI )
 4. Support PHP 4.2.0 or above
 
 Nanoweb is an HTTP server written in PHP but It doesn't support all the
 above features.
 
 So could anyone give me a clue if you know such a HTTP server ?

Why would you want one?  Are you thinking #3

H



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



Re: [PHP] HTTP methods, Web Browsers and REST

2007-08-14 Thread Chris



Looking over PHP i can see a web service client
could be written for a
RESTful web service using the curl extension (and perhaps others as well)
because it facilitates an
ability to invoke the HTTP PUT and DELETE methods.
Now, coming to my question..  Looking at the W3C page on the XHTML 1.0 form
tag specification http://www.w3schools.com/tags/tag_form.asp, it is
clear the method attribute supports only  get and post.  What i wonder is
why would it not also support
put and delete?


Because they are not part of forms, they are something the webserver 
needs to handle.


http://www.apacheweek.com/features/put

Particularly this sentence:

POST method is normally handed a script which is explicitly named by 
the resource (that is, something that already exists), while a PUT 
request could be directed at a resource which does not (yet) exist.


--
Postgresql  php tutorials
http://www.designmagick.com/

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



Re: [PHP] HTTP methods, Web Browsers and REST

2007-08-14 Thread Nathan Nobbe
Chris,

thanks for your reply

it sounds like apache does allow the use of a script to handle PUT requests

In fact, Apache handles PUT exactly like it handles the POST method. That
is, it supports it, but in order for it to do anything useful you need to
supply a suitable CGI program.

getting php to handle PUT requests is probably not too complicated..  there
is this other constraint, imposed by the protocol, that is noteworthy:

Another difference is that the POST method can be used in response to a
form, while the PUT method can only contain a single data item.

so, perhaps, in designing a page intended to allow the user to create a new
datum in an application, the data elements should probably be sent delimited
by / in the url; then parsing the url would provide the script w/ the
elements it needed to create the  new datum in the application.

this helps me to  understand the basics of using PUT and DELETE in a php
application, but im still unclear as to how PUT and DELETE methods can be
invoked on the server from a browser.  to be specific, is a client side
scripting technology like javascript or otherwise mandatory in order to
invoke PUT and DELETE from the browser, or is there some way to invoke these
methods on the server natively ??

from the sound of it; PUT and DELETE wont work well when using a browser to
interact w/ a server, it seems like they are mostly supplied for
programmatic interaction only, but that sounds odd to me  i wonder what
the intended use of PUT and DELETE was when they were first created and
added to the HTTP.

-nathan

On 8/14/07, Chris [EMAIL PROTECTED] wrote:


  Looking over PHP i can see a web service client
  could be written for a
  RESTful web service using the curl extension (and perhaps others as
 well)
  because it facilitates an
  ability to invoke the HTTP PUT and DELETE methods.
  Now, coming to my question..  Looking at the W3C page on the XHTML 1.0form
  tag specification http://www.w3schools.com/tags/tag_form.asp, it is
  clear the method attribute supports only  get and post.  What i wonder
 is
  why would it not also support
  put and delete?

 Because they are not part of forms, they are something the webserver
 needs to handle.

 http://www.apacheweek.com/features/put

 Particularly this sentence:

 POST method is normally handed a script which is explicitly named by
 the resource (that is, something that already exists), while a PUT
 request could be directed at a resource which does not (yet) exist.

 --
 Postgresql  php tutorials
 http://www.designmagick.com/



Re: [PHP] HTTP methods, Web Browsers and REST

2007-08-14 Thread Chris

Nathan Nobbe wrote:

Chris,

thanks for your reply

it sounds like apache does allow the use of a script to handle PUT requests


If you install the module, yes.

from the sound of it; PUT and DELETE wont work well when using a browser 
to interact w/ a server, it seems like they are mostly supplied for 
programmatic interaction only, but that sounds odd to me  i wonder 
what the intended use of PUT and DELETE was when they were first created 
and added to the HTTP.


http://www.webdav.org/specs/rfc2518.html#METHOD_PUT

What are you trying to do anyway where you need put/delete?

--
Postgresql  php tutorials
http://www.designmagick.com/

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



Re: [PHP] HTTP 1.1 keep-alive support in ext/soap/php_http.c ? (fwd)

2007-08-14 Thread Brian A. Seklecki


Found it:

http://cvs.php.net/viewvc.cgi/php-src/ext/soap/php_http.c?annotate=1.109

Lines 892-895 and 903-905 bring the violence.

Rev 1.28 commented it out:

http://cvs.php.net/viewvc.cgi/php-src/ext/soap/php_http.c?r1=1.27r2=1.28


The bugs assocaited with it are:
 http://bugs.php.net/bug.php?id=33164
 http://bugs.php.net/bug.php?id=30329

Please advise on a course of action -- I will open another bug report if 
requested.


http://wiki.apache.org/ws/FrontPage/Axis/AxisCommonsHTTP

Extract from [WWW] RFC 2616 : HTTP/1.1 - Persistent Connection :

* An HTTP/1.1 server MAY assume that a HTTP/1.1 client intends to 
maintain a persistent connection unless a Connection header including the 
connection-token close was sent in the request.


Then presumably, unless the server explicitly closes the connection by 
instructing the client to do so in headers, the client may simply check 
for the presence of HTTP/1.1 and continue to cane the connection/socket.


Cane one!

~BAS

On Tue, 14 Aug 2007, Brian A. Seklecki wrote:



Re-send to php-general@ since soap@ is a ghost town.

Per the msg below, still trying to figure out why each client call to any 
server results in a new TCP socket being built and closed (BAD!)


I finally got around to:
 print Request :\n . $soapClient-__getLastRequestHeaders() . \n;
 print Request :\n . $soapClient-__getLastRequest() . \n;
 print Response:\n . $soapClient-__getLastResponseHeaders() . \n;
 print Response:\n . $soapClient-__getLastResponse() . \n;

As well as checking tcpdump(8) --- my worst fears are confirmed.

The client headers says:
Connection: Keep-Alive

The server header response says:
Response:
HTTP/1.1 200 OK
Content-Type: application/soap+xml;charset=utf-8
Transfer-Encoding: chunked
Date: Tue, 14 Aug 2007 22:35:07 GMT
Server: Apache-Coyote/1.1

And yet, the PHP client running from the CLI binary executing the same 
function call to the server opens  closes two sockets to accomplish the 
work!


~BAS

-- Forwarded message --
Date: Wed, 8 Aug 2007 11:51:50 -0400 (EDT)
From: Brian A. Seklecki [EMAIL PROTECTED]
To: [EMAIL PROTECTED]
Subject: [SOAP] HTTP 1.1 keep-alive support in ext/soap/php_http.c ?


All:

Am I correct in reading ext/soap/php_http.c that the SoapClient / SoapServer 
object will not transmit a Connection: Close line into the HTTP header 
(either via the Client call itself or by modifying Apache's response?)


E.g., by default PHP SOAP client recycles HTTP connections to the server for 
calls to methods using the same server object / instance?



l8*
-lava (Brian A. Seklecki - Pittsburgh, PA, USA)
   http://www.spiritual-machines.org/

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

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




l8*
-lava (Brian A. Seklecki - Pittsburgh, PA, USA)
   http://www.spiritual-machines.org/

Guilty? Yeah. But he knows it. I mean, you're guilty.
You just don't know it. So who's really in jail?
~Maynard James Keenan

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



Re: [PHP] HTTP methods, Web Browsers and REST

2007-08-14 Thread Nathan Nobbe
im imagining a system using the REST paradigm where a web browser is the
client.
rather than a REST paradigm simply for web services.

-nathan

On 8/14/07, Chris [EMAIL PROTECTED] wrote:

 Nathan Nobbe wrote:
  Chris,
 
  thanks for your reply
 
  it sounds like apache does allow the use of a script to handle PUT
 requests

 If you install the module, yes.

  from the sound of it; PUT and DELETE wont work well when using a browser
  to interact w/ a server, it seems like they are mostly supplied for
  programmatic interaction only, but that sounds odd to me  i wonder
  what the intended use of PUT and DELETE was when they were first created
  and added to the HTTP.

 http://www.webdav.org/specs/rfc2518.html#METHOD_PUT

 What are you trying to do anyway where you need put/delete?

 --
 Postgresql  php tutorials
 http://www.designmagick.com/



Re: [PHP] HTTP 1.1 keep-alive support in ext/soap/php_http.c ? (fwd)

2007-08-14 Thread Chris

Brian A. Seklecki wrote:


Found it:

http://cvs.php.net/viewvc.cgi/php-src/ext/soap/php_http.c?annotate=1.109

Lines 892-895 and 903-905 bring the violence.

Rev 1.28 commented it out:

http://cvs.php.net/viewvc.cgi/php-src/ext/soap/php_http.c?r1=1.27r2=1.28


The bugs assocaited with it are:
 http://bugs.php.net/bug.php?id=33164
 http://bugs.php.net/bug.php?id=30329

Please advise on a course of action -- I will open another bug report if 
requested.


Best to ask the -internals list me thinks - they handle the C code 
behind php :)


--
Postgresql  php tutorials
http://www.designmagick.com/

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



Re: [PHP] http request problem

2007-01-03 Thread Richard Lynch
On Tue, January 2, 2007 11:55 pm, Kencana wrote:
 I got problem in getting file content. the file is located at another
 server
 (tomcat) and it is a jsp file.
 i don't know why i keep getting the same error message file accessing
 that
 file but
 while i am trying to access to another file, from another server it
 run
 perfect.
 this is the error message i get:
 PHP Warning:
 file_get_contents(http://123.123.1.2:8008/V3JRoute?slot=1startX=103.880764startY=1.335458endX=103.886297endY=1.334953routeType=1format=2)
 [function.file-get-contents]: failed to open stream: HTTP request
 failed!
 $5$13:53:22,13:53:22,13:53:22,13:53:22,13:53:22$0.0,0.0,0.0,0.0,0.0$Depart
 on,Turn sharp left onto,Continue on,Turn right onto in C:\Program
 Files\MapGuideOpenSource\WebServerExtensions\www\phpviewersample\xmlaccesstrial.php
 on line 5

 take note that the text in bold is part of the page contents.
 i don't understand why i cant get the whole content and keep getting
 this
 error.
 I hope somebody can help me out.

First, it is entirely possible that the service provided is filtering
on request IP and only responds nicely to requests from specific IP
servers.

This is *very* common in paid-for peer-to-peer business-to-business
services.

If you have an account with the folks providing this service, just let
them know your static IP, and they'll add it to their friend list on
their end.

If that's not what's going on, I suggest you try using CURL to see if
you can get the headers to find out more info about WHY the request is
being denied.  Or you can use wget --server-response if you don't have
curl.  Or perhaps Firefox and LiveHTTPHeaders.  Or even PHP's
fopen/fread. Just use *something* to see the full raw response.

-- 
Some people have a gift link here.
Know what I want?
I want you to buy a CD from some starving artist.
http://cdbaby.com/browse/from/lynch
Yeah, I get a buck. So?

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



Re: [PHP] http request problem

2007-01-02 Thread Kencana

hi all,

by the way, the page that i am trying to get, i can open the page without
any problem
in IE 7 browser.

Thanks

Regards,
Kencana

-- 
View this message in context: 
http://www.nabble.com/http-request-problem-tf2911952.html#a8136297
Sent from the PHP - General mailing list archive at Nabble.com.

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



Re: [PHP] http request problem

2007-01-02 Thread Curt Zirzow

On 1/2/07, Kencana [EMAIL PROTECTED] wrote:


hi all,

I got problem in getting file content. the file is located at another server
(tomcat) and it is a jsp file.
i don't know why i keep getting the same error message file accessing that
file but
while i am trying to access to another file, from another server it run
perfect.
this is the error message i get:
PHP Warning:
file_get_contents(http://123.123.1.2:8008/V3JRoute?slot=1startX=103.880764startY=1.335458endX=103.886297endY=1.334953routeType=1format=2)
[function.file-get-contents]: failed to open stream: HTTP request failed!
$5$13:53:22,13:53:22,13:53:22,13:53:22,13:53:22$0.0,0.0,0.0,0.0,0.0$Depart
on,Turn sharp left onto,Continue on,Turn right onto in C:\Program
Files\MapGuideOpenSource\WebServerExtensions\www\phpviewersample\xmlaccesstrial.php
on line 5


Sounds like you need to make that 'right turn', the only people that
could answer this are the people that wrote V3JRoute

Curt.

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



Re: [PHP] http://sourceforge.net/projects/dfo/

2006-10-27 Thread Gert Cuykens

Ok, What specific documentation do you want i start with ? i was
hoping it would just work on every firefox and php 5 mysql 5 server
with one small change to the php.ini to disable magic quotes see
http://php.net/manual/en/security.magicquotes.disabling.php

Using it should be quit simple if not i failt to do so. It should work
like point on the field do what you want to do with the field and if
you are ready to upload, push on the green V. The only thing that
maybe could be a bit strange in the begining is the login. I created a
cookie database that remebers all your servers and you need to select
on using the select options to go to the databases bij pushing on the
V button after you selected your server.

Thats it download check the ini and goto startpage
http://localhost/db/htm/datagrid.htm

On 10/27/06, Leonard Burton [EMAIL PROTECTED] wrote:

Hi,

 I wrote my own phpmyadmin from scratch, so far i got this
 http://sourceforge.net/projects/dfo/ and i was wondering what i needed
 to change so other people would like it too ?

When you get more Documentation I will check it out.

Thanks,

--
Leonard Burton, N9URK
[EMAIL PROTECTED]

The prolonged evacuation would have dramatically affected the
survivability of the occupants.



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



Re: [PHP] HTTP ERRORS Boolean

2006-06-07 Thread Rabin Vincent

On 6/7/06, Rodrigo de Oliveira Costa [EMAIL PROTECTED] wrote:

Guys is there a way that I can call the func file(www.url.com) and
get a result true if there is a page and false if the page doesnt
exists (error 404)?


This would work, but will not specifically check for a 404:

$page = file('..');
if (!$page) {
 // does not exist or some other error
}

Rabin

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



Re: [PHP] HTTP HEADERS

2006-06-03 Thread David Tulloh
kartikay malhotra wrote:
 Hi all!
 
 I use HTTP POST to upload a file. I've a PHP script running on the server.
 Are HTTP headers passed with this request? How can I see the headers passed
 to the server?

Headers are passed by the client and server with every request.  The
Firefox Tamper Data extension shows the headers being sent and allows
you to modify them on the fly.


David

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



Re: [PHP] HTTP HEADERS

2006-06-03 Thread Joe Wollard

(sorry for the dup kartikay, forgot to hit reply to all;-)
So is the file going from server to server or from a client machine to the
server? It sounds like server to server - which if that's the case you can
use headers_list() to see what your server is going to be sending out to the
other server ( http://www.php.net/manual/en/function.headers-list.php) -
otherwise you can use the get_headers() function
(http://www.php.net/manual/en/function.get-headers.php)
see what headers the client sent you along with the file.

-Joe


On 6/3/06, kartikay malhotra [EMAIL PROTECTED] wrote:


Hi all!

I use HTTP POST to upload a file. I've a PHP script running on the server.
Are HTTP headers passed with this request? How can I see the headers
passed
to the server?

Thanks
KM




Re: [PHP] HTTP status code

2006-03-31 Thread gustav
 No,
 I'm creating remote service and it's returning codes according to passed
 parameters. I only wanted to test it using browsers...

 I do not care about the output actually, but the status code

 B.

It seems to me, that this is more html-related. Maybe the tags in the
html-document screws it up regarding to the use of html. IE is more
insensitive regarding correct typing of html-tags.

header('HTTP/1.1 404 Not Found');
header(Status: 404 Not Found);

Why do you have ' on the first line and  on the second?

/Gustav Wiberg

 Jasper Bryant-Greene wrote:
 The default Apache error handler is not called when PHP sends a 404
 header. The code that does Apache error handling happens *before* PHP
 gets in the loop, and checks to see if the script being referenced
 exists, which it indeed does, whether it sends a 404 header or not.

 Tested on Apache 2.2 with PHP 5.1.

 If you really want to get the default Apache error handler to appear
 then either readfile() it or redirect to it.

 Jasper

 Anthony Ettinger wrote:

 well, you typically would redirect 404 to something like
 foo.com/404.html

 Otherwise, it's whatever your server (apache/IIS) has as the default
 404 handler...

 Default is something like this:

   Not Found

   The requested URL /asdf was not found on this server.
   Apache Server at foo.org Port 80


 On 3/30/06, Jasper Bryant-Greene [EMAIL PROTECTED] wrote:

 In other words, if you want Firefox/Opera/etc to display something,
 you
 have to output something. Strange, that. :P

 Jasper

 Anthony Ettinger wrote:

 Then it's workingFireFox, et. al. show you the server 404, IE on
 the otherhand has it's own 404 error page (for those newbies who
 don't
 know what a 404 is). You can disable it under IE options.

 On 3/30/06, Bronislav Klucka [EMAIL PROTECTED] wrote:

 Yes, I do...
 B.

 Anthony Ettinger wrote:

 Are you seeing the IE-specific 404 page? The one that looks like
 this:

 http://redvip.homelinux.net/varios/404-ie.jpg



 On 3/30/06, Bronislav Klucka [EMAIL PROTECTED] wrote:

 Hi,
 I'm using following construction to send http status code
 --
 header('HTTP/1.1 404 Not Found');
 header(Status: 404 Not Found);
 exit;
 --

 MSIE displays Page not found, but FireFox and Opera don't
 display
 anything. Just blank page with no text...

 full headers sent by this script (and server itself) are:

 --
 Date: Thu, 30 Mar 2006 18:02:49 GMT
 Server: Apache/2.0.55 (Debian) PHP/4.4.0-4 mod_ssl/2.0.55
 OpenSSL/0.9.8a
 X-Powered-By: PHP/5.1.2
 Keep-Alive: timeout=15, max=99
 Connection: Keep-Alive
 Transfer-Encoding: chunked
 Content-Type: text/html

 404 Not Found
 --

 can anyone tell me, why those two browsers are not affected?

 Brona

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




 --
 Anthony Ettinger
 Signature: http://chovy.dyndns.org/hcard.html

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




 --
 Anthony Ettinger
 Signature: http://chovy.dyndns.org/hcard.html

 --
 Jasper Bryant-Greene
 General Manager
 Album Limited

 http://www.album.co.nz/ 0800 4 ALBUM
 [EMAIL PROTECTED]  021 708 334




 --
 Anthony Ettinger
 Signature: http://chovy.dyndns.org/hcard.html



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



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



Re: [PHP] HTTP status code

2006-03-30 Thread Anthony Ettinger
Are you seeing the IE-specific 404 page? The one that looks like this:

http://redvip.homelinux.net/varios/404-ie.jpg



On 3/30/06, Bronislav Klucka [EMAIL PROTECTED] wrote:
 Hi,
 I'm using following construction to send http status code
 --
 header('HTTP/1.1 404 Not Found');
 header(Status: 404 Not Found);
 exit;
 --

 MSIE displays Page not found, but FireFox and Opera don't display
 anything. Just blank page with no text...

 full headers sent by this script (and server itself) are:

 --
 Date: Thu, 30 Mar 2006 18:02:49 GMT
 Server: Apache/2.0.55 (Debian) PHP/4.4.0-4 mod_ssl/2.0.55 OpenSSL/0.9.8a
 X-Powered-By: PHP/5.1.2
 Keep-Alive: timeout=15, max=99
 Connection: Keep-Alive
 Transfer-Encoding: chunked
 Content-Type: text/html

 404 Not Found
 --

 can anyone tell me, why those two browsers are not affected?

 Brona

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





--
Anthony Ettinger
Signature: http://chovy.dyndns.org/hcard.html

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



Re: [PHP] HTTP status code

2006-03-30 Thread Bronislav Klucka

Yes, I do...
B.

Anthony Ettinger wrote:

Are you seeing the IE-specific 404 page? The one that looks like this:

http://redvip.homelinux.net/varios/404-ie.jpg



On 3/30/06, Bronislav Klucka [EMAIL PROTECTED] wrote:


Hi,
I'm using following construction to send http status code
--
header('HTTP/1.1 404 Not Found');
header(Status: 404 Not Found);
exit;
--

MSIE displays Page not found, but FireFox and Opera don't display
anything. Just blank page with no text...

full headers sent by this script (and server itself) are:

--
Date: Thu, 30 Mar 2006 18:02:49 GMT
Server: Apache/2.0.55 (Debian) PHP/4.4.0-4 mod_ssl/2.0.55 OpenSSL/0.9.8a
X-Powered-By: PHP/5.1.2
Keep-Alive: timeout=15, max=99
Connection: Keep-Alive
Transfer-Encoding: chunked
Content-Type: text/html

404 Not Found
--

can anyone tell me, why those two browsers are not affected?

Brona

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







--
Anthony Ettinger
Signature: http://chovy.dyndns.org/hcard.html



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



Re: [PHP] HTTP status code

2006-03-30 Thread Anthony Ettinger
Then it's workingFireFox, et. al. show you the server 404, IE on
the otherhand has it's own 404 error page (for those newbies who don't
know what a 404 is). You can disable it under IE options.

On 3/30/06, Bronislav Klucka [EMAIL PROTECTED] wrote:
 Yes, I do...
 B.

 Anthony Ettinger wrote:
  Are you seeing the IE-specific 404 page? The one that looks like this:
 
  http://redvip.homelinux.net/varios/404-ie.jpg
 
 
 
  On 3/30/06, Bronislav Klucka [EMAIL PROTECTED] wrote:
 
 Hi,
 I'm using following construction to send http status code
 --
 header('HTTP/1.1 404 Not Found');
 header(Status: 404 Not Found);
 exit;
 --
 
 MSIE displays Page not found, but FireFox and Opera don't display
 anything. Just blank page with no text...
 
 full headers sent by this script (and server itself) are:
 
 --
 Date: Thu, 30 Mar 2006 18:02:49 GMT
 Server: Apache/2.0.55 (Debian) PHP/4.4.0-4 mod_ssl/2.0.55 OpenSSL/0.9.8a
 X-Powered-By: PHP/5.1.2
 Keep-Alive: timeout=15, max=99
 Connection: Keep-Alive
 Transfer-Encoding: chunked
 Content-Type: text/html
 
 404 Not Found
 --
 
 can anyone tell me, why those two browsers are not affected?
 
 Brona
 
 --
 PHP General Mailing List (http://www.php.net/)
 To unsubscribe, visit: http://www.php.net/unsub.php
 
 
 
 
 
 
  --
  Anthony Ettinger
  Signature: http://chovy.dyndns.org/hcard.html
 

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





--
Anthony Ettinger
Signature: http://chovy.dyndns.org/hcard.html

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



Re: [PHP] HTTP status code

2006-03-30 Thread Jasper Bryant-Greene
In other words, if you want Firefox/Opera/etc to display something, you 
have to output something. Strange, that. :P


Jasper

Anthony Ettinger wrote:

Then it's workingFireFox, et. al. show you the server 404, IE on
the otherhand has it's own 404 error page (for those newbies who don't
know what a 404 is). You can disable it under IE options.

On 3/30/06, Bronislav Klucka [EMAIL PROTECTED] wrote:

Yes, I do...
B.

Anthony Ettinger wrote:

Are you seeing the IE-specific 404 page? The one that looks like this:

http://redvip.homelinux.net/varios/404-ie.jpg



On 3/30/06, Bronislav Klucka [EMAIL PROTECTED] wrote:


Hi,
I'm using following construction to send http status code
--
header('HTTP/1.1 404 Not Found');
header(Status: 404 Not Found);
exit;
--

MSIE displays Page not found, but FireFox and Opera don't display
anything. Just blank page with no text...

full headers sent by this script (and server itself) are:

--
Date: Thu, 30 Mar 2006 18:02:49 GMT
Server: Apache/2.0.55 (Debian) PHP/4.4.0-4 mod_ssl/2.0.55 OpenSSL/0.9.8a
X-Powered-By: PHP/5.1.2
Keep-Alive: timeout=15, max=99
Connection: Keep-Alive
Transfer-Encoding: chunked
Content-Type: text/html

404 Not Found
--

can anyone tell me, why those two browsers are not affected?

Brona

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






--
Anthony Ettinger
Signature: http://chovy.dyndns.org/hcard.html


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






--
Anthony Ettinger
Signature: http://chovy.dyndns.org/hcard.html



--
Jasper Bryant-Greene
General Manager
Album Limited

http://www.album.co.nz/ 0800 4 ALBUM
[EMAIL PROTECTED]  021 708 334

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



Re: [PHP] HTTP status code

2006-03-30 Thread Anthony Ettinger
well, you typically would redirect 404 to something like foo.com/404.html

Otherwise, it's whatever your server (apache/IIS) has as the default
404 handler...

Default is something like this:

  Not Found

  The requested URL /asdf was not found on this server.
  Apache Server at foo.org Port 80


On 3/30/06, Jasper Bryant-Greene [EMAIL PROTECTED] wrote:
 In other words, if you want Firefox/Opera/etc to display something, you
 have to output something. Strange, that. :P

 Jasper

 Anthony Ettinger wrote:
  Then it's workingFireFox, et. al. show you the server 404, IE on
  the otherhand has it's own 404 error page (for those newbies who don't
  know what a 404 is). You can disable it under IE options.
 
  On 3/30/06, Bronislav Klucka [EMAIL PROTECTED] wrote:
  Yes, I do...
  B.
 
  Anthony Ettinger wrote:
  Are you seeing the IE-specific 404 page? The one that looks like this:
 
  http://redvip.homelinux.net/varios/404-ie.jpg
 
 
 
  On 3/30/06, Bronislav Klucka [EMAIL PROTECTED] wrote:
 
  Hi,
  I'm using following construction to send http status code
  --
  header('HTTP/1.1 404 Not Found');
  header(Status: 404 Not Found);
  exit;
  --
 
  MSIE displays Page not found, but FireFox and Opera don't display
  anything. Just blank page with no text...
 
  full headers sent by this script (and server itself) are:
 
  --
  Date: Thu, 30 Mar 2006 18:02:49 GMT
  Server: Apache/2.0.55 (Debian) PHP/4.4.0-4 mod_ssl/2.0.55 OpenSSL/0.9.8a
  X-Powered-By: PHP/5.1.2
  Keep-Alive: timeout=15, max=99
  Connection: Keep-Alive
  Transfer-Encoding: chunked
  Content-Type: text/html
 
  404 Not Found
  --
 
  can anyone tell me, why those two browsers are not affected?
 
  Brona
 
  --
  PHP General Mailing List (http://www.php.net/)
  To unsubscribe, visit: http://www.php.net/unsub.php
 
 
 
 
 
  --
  Anthony Ettinger
  Signature: http://chovy.dyndns.org/hcard.html
 
  --
  PHP General Mailing List (http://www.php.net/)
  To unsubscribe, visit: http://www.php.net/unsub.php
 
 
 
 
 
  --
  Anthony Ettinger
  Signature: http://chovy.dyndns.org/hcard.html
 

 --
 Jasper Bryant-Greene
 General Manager
 Album Limited

 http://www.album.co.nz/ 0800 4 ALBUM
 [EMAIL PROTECTED]  021 708 334




--
Anthony Ettinger
Signature: http://chovy.dyndns.org/hcard.html

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



Re: [PHP] HTTP status code

2006-03-30 Thread Jasper Bryant-Greene
The default Apache error handler is not called when PHP sends a 404 
header. The code that does Apache error handling happens *before* PHP 
gets in the loop, and checks to see if the script being referenced 
exists, which it indeed does, whether it sends a 404 header or not.


Tested on Apache 2.2 with PHP 5.1.

If you really want to get the default Apache error handler to appear 
then either readfile() it or redirect to it.


Jasper

Anthony Ettinger wrote:

well, you typically would redirect 404 to something like foo.com/404.html

Otherwise, it's whatever your server (apache/IIS) has as the default
404 handler...

Default is something like this:

  Not Found

  The requested URL /asdf was not found on this server.
  Apache Server at foo.org Port 80


On 3/30/06, Jasper Bryant-Greene [EMAIL PROTECTED] wrote:

In other words, if you want Firefox/Opera/etc to display something, you
have to output something. Strange, that. :P

Jasper

Anthony Ettinger wrote:

Then it's workingFireFox, et. al. show you the server 404, IE on
the otherhand has it's own 404 error page (for those newbies who don't
know what a 404 is). You can disable it under IE options.

On 3/30/06, Bronislav Klucka [EMAIL PROTECTED] wrote:

Yes, I do...
B.

Anthony Ettinger wrote:

Are you seeing the IE-specific 404 page? The one that looks like this:

http://redvip.homelinux.net/varios/404-ie.jpg



On 3/30/06, Bronislav Klucka [EMAIL PROTECTED] wrote:


Hi,
I'm using following construction to send http status code
--
header('HTTP/1.1 404 Not Found');
header(Status: 404 Not Found);
exit;
--

MSIE displays Page not found, but FireFox and Opera don't display
anything. Just blank page with no text...

full headers sent by this script (and server itself) are:

--
Date: Thu, 30 Mar 2006 18:02:49 GMT
Server: Apache/2.0.55 (Debian) PHP/4.4.0-4 mod_ssl/2.0.55 OpenSSL/0.9.8a
X-Powered-By: PHP/5.1.2
Keep-Alive: timeout=15, max=99
Connection: Keep-Alive
Transfer-Encoding: chunked
Content-Type: text/html

404 Not Found
--

can anyone tell me, why those two browsers are not affected?

Brona

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





--
Anthony Ettinger
Signature: http://chovy.dyndns.org/hcard.html


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





--
Anthony Ettinger
Signature: http://chovy.dyndns.org/hcard.html


--
Jasper Bryant-Greene
General Manager
Album Limited

http://www.album.co.nz/ 0800 4 ALBUM
[EMAIL PROTECTED]  021 708 334





--
Anthony Ettinger
Signature: http://chovy.dyndns.org/hcard.html



--
Jasper Bryant-Greene
General Manager
Album Limited

http://www.album.co.nz/ 0800 4 ALBUM
[EMAIL PROTECTED]  021 708 334

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



Re: [PHP] HTTP status code

2006-03-30 Thread Bronislav Klucka

No,
I'm creating remote service and it's returning codes according to passed 
parameters. I only wanted to test it using browsers...


I do not care about the output actually, but the status code

B.

Jasper Bryant-Greene wrote:
The default Apache error handler is not called when PHP sends a 404 
header. The code that does Apache error handling happens *before* PHP 
gets in the loop, and checks to see if the script being referenced 
exists, which it indeed does, whether it sends a 404 header or not.


Tested on Apache 2.2 with PHP 5.1.

If you really want to get the default Apache error handler to appear 
then either readfile() it or redirect to it.


Jasper

Anthony Ettinger wrote:


well, you typically would redirect 404 to something like foo.com/404.html

Otherwise, it's whatever your server (apache/IIS) has as the default
404 handler...

Default is something like this:

  Not Found

  The requested URL /asdf was not found on this server.
  Apache Server at foo.org Port 80


On 3/30/06, Jasper Bryant-Greene [EMAIL PROTECTED] wrote:


In other words, if you want Firefox/Opera/etc to display something, you
have to output something. Strange, that. :P

Jasper

Anthony Ettinger wrote:


Then it's workingFireFox, et. al. show you the server 404, IE on
the otherhand has it's own 404 error page (for those newbies who don't
know what a 404 is). You can disable it under IE options.

On 3/30/06, Bronislav Klucka [EMAIL PROTECTED] wrote:


Yes, I do...
B.

Anthony Ettinger wrote:

Are you seeing the IE-specific 404 page? The one that looks like 
this:


http://redvip.homelinux.net/varios/404-ie.jpg



On 3/30/06, Bronislav Klucka [EMAIL PROTECTED] wrote:


Hi,
I'm using following construction to send http status code
--
header('HTTP/1.1 404 Not Found');
header(Status: 404 Not Found);
exit;
--

MSIE displays Page not found, but FireFox and Opera don't display
anything. Just blank page with no text...

full headers sent by this script (and server itself) are:

--
Date: Thu, 30 Mar 2006 18:02:49 GMT
Server: Apache/2.0.55 (Debian) PHP/4.4.0-4 mod_ssl/2.0.55 
OpenSSL/0.9.8a

X-Powered-By: PHP/5.1.2
Keep-Alive: timeout=15, max=99
Connection: Keep-Alive
Transfer-Encoding: chunked
Content-Type: text/html

404 Not Found
--

can anyone tell me, why those two browsers are not affected?

Brona

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





--
Anthony Ettinger
Signature: http://chovy.dyndns.org/hcard.html


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





--
Anthony Ettinger
Signature: http://chovy.dyndns.org/hcard.html


--
Jasper Bryant-Greene
General Manager
Album Limited

http://www.album.co.nz/ 0800 4 ALBUM
[EMAIL PROTECTED]  021 708 334





--
Anthony Ettinger
Signature: http://chovy.dyndns.org/hcard.html





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



Re: [PHP] http curl to https is that a secure connection?

2005-12-19 Thread Curt Zirzow
On Mon, Dec 19, 2005 at 04:01:34PM -0800, Mark Steudel wrote:
 I was curious, if have a page at http and it initiates a curl session to a
 https, is the information sent secure or open because the the curl session
 is from a unecrypted page?

The data sent back and forth to the curl session will be secure,
the data between the client and the script that calls curl will be
insecure.

Curt.
-- 
cat .signature: No such file or directory

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



Re: [PHP] HTTP User Authentication Problems

2005-12-06 Thread Steve McGill
Hi Rahul,

Try doing a print_r($_SERVER) to see if the variables are being set.

If they aren't, take a look at the phpinfo(); - chances are your host is 
using a CGI binary version of PHP to use together with a security wrapper 
like suPHP or phpSuExec, which might throw away the variables that you 
require.

Steve

Rahul S. Johari [EMAIL PROTECTED] schreef in bericht 
news:[EMAIL PROTECTED]

Ave,

I¹m trying to run this very simple HTTP user authentication script:

?php
  if (!isset($_SERVER['PHP_AUTH_USER'])) {
header('WWW-Authenticate: Basic realm=Private');
header('HTTP/1.0 401 Unauthorized');
echo 'Unauthorized';
exit;
  } else {

if(($_SERVER['PHP_AUTH_USER']==try) 
($_SERVER['PHP_AUTH_PW']==try)) {
?

HTML
HEAD/HEAD
BODY
My Stuff Goes Here!
/BODY
/HTML


?
}
else {
echo Access Denied;
}
  }
?

The problem is, this script runs perfectly fine on my localhost machine at
home, however it¹s not working on my web server (purchased webhosting). When
I open this page on my web site, it does bring up the popup box asking for
Username  Password ­ the problem is, even if I type the correct user/pass,
it won¹t accept it. It keeps asking me for user/pass again and again and
finally brings up the ³Unauthorized² text on the page.

Why won¹t it allow the correct user/pass to login? I don¹t understand.

The only difference between the PHP on my localhost and the PHP on my
webhost server is that my local machine is running PHP 5 and the webhost
server is running PHP 4.4.1 

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



Re: [PHP] HTTP User Authentication Problems

2005-12-06 Thread Rahul S. Johari

Ave,

Steve, I did a phpinfo() on my webhost and as it turns out, they are using a
CGI binary version, much to my surprise and dismay.

Anyhow... Do I have any alternatives for an http authentication kind of
authentication ?

Thanks,

Rahul S. Johari
Coordinator, Internet  Administration
Informed Marketing Services Inc.
251 River Street
Troy, NY 12180

Tel: (518) 266-0909 x154
Fax: (518) 266-0909
Email: [EMAIL PROTECTED]
http://www.informed-sources.com

On 12/6/05 9:50 AM, Steve McGill [EMAIL PROTECTED] wrote:

 Hi Rahul,
 
 Try doing a print_r($_SERVER) to see if the variables are being set.
 
 If they aren't, take a look at the phpinfo(); - chances are your host is
 using a CGI binary version of PHP to use together with a security wrapper
 like suPHP or phpSuExec, which might throw away the variables that you
 require.
 
 Steve
 
 Rahul S. Johari [EMAIL PROTECTED] schreef in bericht
 news:[EMAIL PROTECTED]
 
 Ave,
 
 I¹m trying to run this very simple HTTP user authentication script:
 
 ?php
   if (!isset($_SERVER['PHP_AUTH_USER'])) {
 header('WWW-Authenticate: Basic realm=Private');
 header('HTTP/1.0 401 Unauthorized');
 echo 'Unauthorized';
 exit;
   } else {
 
 if(($_SERVER['PHP_AUTH_USER']==try) 
 ($_SERVER['PHP_AUTH_PW']==try)) {
 ?
 
 HTML
 HEAD/HEAD
 BODY
 My Stuff Goes Here!
 /BODY
 /HTML
 
 
 ?
 }
 else {
 echo Access Denied;
 }
   }
 ?
 
 The problem is, this script runs perfectly fine on my localhost machine at
 home, however it¹s not working on my web server (purchased webhosting). When
 I open this page on my web site, it does bring up the popup box asking for
 Username  Password ­ the problem is, even if I type the correct user/pass,
 it won¹t accept it. It keeps asking me for user/pass again and again and
 finally brings up the ³Unauthorized² text on the page.
 
 Why won¹t it allow the correct user/pass to login? I don¹t understand.
 
 The only difference between the PHP on my localhost and the PHP on my
 webhost server is that my local machine is running PHP 5 and the webhost
 server is running PHP 4.4.1

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



Re: [PHP] http protocols defining what gets sent between web server and browser

2005-11-23 Thread David Tulloh
I find the LiveHTTPHeaders extension for firefox to be very good for 
this kind of thing.

http://livehttpheaders.mozdev.org/

It gives you a realistic (as opposed to theoretical) view of exactly 
what is being sent between the browser and the server.  Networking 
details that you listed like the mac address are handled in the 
networking layer rather than by the browser, you probably also want to 
look up TCP/IP headers.



David

bruce wrote:


hi...

this might not be a php question but might still provide interest...

I'm working on a project, and need to know if there's anyone who's a guru
with Web Server/Client interactions. Basically, I'm trying to get a much
better/deeper understanding of the HTTP protocols defining the information
that is sent/transfered between the web server/client browser apps.

I'm interested in understanding what the various information is that gets
transfered between the apps, as well as understanding what information can
be spoofed/altered on the client side, as it goes back to the server.

I know you can get the querystring information from the
get/put/request/etc... I'm more interested in any other information that
gets transferred as potentially part of the header structure, like machine
id, mac address, date/time, etc I'm interested in whether this can be
spoofed/altered, and potentially rendered invalid by a 'man in the middle'
type of attack.

Searching google isn't getting me what i really want!!

So, if you have the skills/expertise in this area, and you're willing to
talk to me for a few minutes, I'd appreciate it. As stated, the underlying
reason for the questions is to get a better understanding of 'man in the
middle attacks' as this applies to web server apps.

Thanks

bruce
[EMAIL PROTECTED]

 



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



Re: [PHP] http protocols defining what gets sent between web server and browser

2005-11-23 Thread Curt Zirzow
On Wed, Nov 23, 2005 at 04:53:50PM -0800, bruce wrote:
 hi...
 
 this might not be a php question but might still provide interest...
 
 I'm working on a project, and need to know if there's anyone who's a guru
 with Web Server/Client interactions. Basically, I'm trying to get a much
 better/deeper understanding of the HTTP protocols defining the information
 that is sent/transfered between the web server/client browser apps.

I'd probably recomend this book:
  http://www.amazon.com/gp/product/0672324547/103-9975129-7570262

Curt.
-- 
cat .signature: No such file or directory

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



Re: [PHP] http scanner

2005-07-04 Thread Rory Browne
Something along the lines of 

preg_replace(#(http://|www\.)\S+#, a/a, $line)

I´d have put the proper code in, except that I´m still getting used to
a spanish keyboard layout - and don´t know the layout too well.

Rory

On 7/2/05, timothy johnson [EMAIL PROTECTED] wrote:
 I am still writing a script for my friend he asked me about being able
 to scan strings and make any strings that have http links in them,
 able to be an anchor in a broswer, as I am sure I am not the first to
 do this, any one have any ideas??? I am on php.net looking thru the
 functions see lots of ides but nothing that seems to want to work.
 
 --
 PHP General Mailing List (http://www.php.net/)
 To unsubscribe, visit: http://www.php.net/unsub.php
 


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



Re: [PHP] http to https session problem

2005-06-11 Thread Richard Lynch
On Thu, June 9, 2005 7:43 am, Joe Harman said:
 I am having a little problem with users keeping the same session id
 when they go from http to https... is there a work around for this...
 I don't appear to have this problem when using openSSL just when the
 site has it's own certificate.

 should I store the session id in a cookie??? or is there another way or
 setting

A Cookie would be a fine way to pass it, or in the URL.

You probably have a very clear user-interaction-path into and out of SSL
anyway, so you'd only be changing a couple lines of code, in a
well-designed application.

Essentially, it's probably best to think of your HTTP and HTTPS as two
totally different servers, with nothing in common, even when, in fact,
they are the same server with the same files in the same exact hard drive
and all that.

Some hosts split HTTPS off on another box ; Some don't.

If you're ready for the split, you're more mobile.

-- 
Like Music?
http://l-i-e.com/artists.htm

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



Re: [PHP] http to https session problem

2005-06-11 Thread Joe Harman
On 6/11/05, Joe Harman [EMAIL PROTECTED] wrote:
 On 6/11/05, Richard Lynch [EMAIL PROTECTED] wrote:
  On Thu, June 9, 2005 7:43 am, Joe Harman said:
   I am having a little problem with users keeping the same session id
   when they go from http to https... is there a work around for this...
   I don't appear to have this problem when using openSSL just when the
   site has it's own certificate.
  
   should I store the session id in a cookie??? or is there another way or
   setting
 
  A Cookie would be a fine way to pass it, or in the URL.
 
  You probably have a very clear user-interaction-path into and out of SSL
  anyway, so you'd only be changing a couple lines of code, in a
  well-designed application.
 
  Essentially, it's probably best to think of your HTTP and HTTPS as two
  totally different servers, with nothing in common, even when, in fact,
  they are the same server with the same files in the same exact hard drive
  and all that.
 
  Some hosts split HTTPS off on another box ; Some don't.
 
  If you're ready for the split, you're more mobile.
 
  --
  Like Music?
  http://l-i-e.com/artists.htm
 
 
 
 Yep... i am going to have to keep something in a cookie to identify
 the user if they come back to the site... I was trying to avoid the
 whole P3P things with cookies... not that it's hard... it's jsut a
 pain in the butt :o)
 
 Thanks! Cheers!
 

Yep... i am going to have to keep something in a cookie to identify
the user if they come back to the site... I was trying to avoid the
whole P3P things with cookies... not that it's hard... it's jsut a
pain in the butt :o)

Thanks! Cheers!
-- 
Joe Harman
-
Do not go where the path may lead, go instead where there is no path
and leave a trail. - Ralph Waldo Emerson

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



Re: [PHP] HTTP RAW CONETNE question

2005-03-29 Thread Burhan Khalid
 wrote:
 Dear php users,
 
 I've been working on a project which needs to get the raw post content from 
 the http request.
 Unfortunately,I can't get the content with $HTTP_RAW_POST_DATA variable.
 My php version is 4.2.2. My OS is rh linux9.0. And I've turned the global 
 variable tag.
 Any hints would be appreciated.

Any reason that you haven't upgraded? Lots of improvement in PHP since 4.2.2

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




Re: [PHP] HTTP Include Error

2005-03-01 Thread AdamT
On Mon, 28 Feb 2005 15:35:36 -0700, Suhas [EMAIL PROTECTED] wrote:
 Hi
 
 This issue has been discusses many times before, but no perticular
 solution found.
 
Things to check when 'including' with http:

i) Can the server resolve the host name?  Eg - if, from the server,
you run 'ping host.example.com, will it resolve this to an IP address?
ii) Can the server connect to that IP address on port 80?
iii) Are you marking up files and directories properly?  /example.php
is a file, whereas /example.php/ is a directory (note the forwardslash
on the end).
iv) Is the file-system case-sensitive?  Might
example.com/thingy/index.php be different to
example.com/THINGY/Index.PHP ?  This is more likely on UNIX
filesystems.
v) Are you trying to connect with HTTP/1.1 to a server which only
understands HTTP/1.0 ?
vi) Is there something in the path which might be causing the problems
with php?  Eg - special characters which would need to be \'escaped\'.
 This is a particular nuisance when connecting to IIS boxen which
don't have the default domain configured, so you have to give a
username in the format of DOMAIN\username.
vii) You *did* plug that network cable back in, didn't you?
viii) The file does actually exist, doesn't it?  Try GETing the URL
manually with telnet:
telnet example.com 80
GET /uri/of/file.php HTTP/1.0
Host: example.com
CR/LFCR/LF

And see what you get back.  You'll either get the page contents sent
to you, or a 404 (This file isn't here), or maybe you'll get a 302
(Object has moved).  A 302 looks like this in the headers:

HTTP/1.0 302 Found
Location: /newlocation

If you look at it in a browser, you'll be taken to the new location,
and probably won't notice that anything was ever wrong.  If you try to
'include' from that path, it'll fail.


-- 
AdamT
Justify my text?  I'm sorry, but it has no excuse.

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



Re: [PHP] HTTP Include Error

2005-02-28 Thread Marek Kilimajer
Suhas wrote:
Hi
This issue has been discusses many times before, but no perticular
solution found.
include '/www/.../file.php'  = works fine
include 'http://google.com/'  = works fine
include 'http://myserver.com/file.php'  = 

Warning: main(http://myserver.com/file.php): failed to open stream:
HTTP request failed! HTTP/1.1 404 Not Found in /www/myserver/file2.php
on line 4
Warning: main(): Failed opening 'http://myserver.com/file.php' for
inclusion (include_path='') in . 4
allow_url_fopen  = ON
The file is on same machine. It is not a file access prblem, I have
ried with OPEN (777) permissions.
Can anyone please shed some light on this?
Thanks
SP
the file not was found, it's not a php problem, but rather apache or dns 
 misconfiguration. You can try

wget http://myserver.com/file.php
from the server shell and you should see the same response.
--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php


Re: [PHP] http referer

2005-02-26 Thread Stan F

- Original Message -
From: Sebastian [EMAIL PROTECTED]
To: php-general@lists.php.net
Sent: Saturday, February 26, 2005 8:31 PM
Subject: [PHP] http referer


 ok, so i made a file manager and i need to prevent people from linking
 directly to files that do not come from another part of the site.

 i know i can use http_referer, but i wonder how fool proof it is, i dont
 want to spit out errors to a legit user that actually came from a valid
page
 before trying to access the file url. some people have said http_referer
is
 not always accurate.

Never rely on it. It might be not set at all, it's easy to spoof. I would
think about sessions here.

btw this topic has been discussed much, so you probably should STFA.


 any examples, snips, would be helpful.

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



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



Re: [PHP] http referer

2005-02-26 Thread John Holmes
Sebastian wrote:
ok, so i made a file manager and i need to prevent people from linking
directly to files that do not come from another part of the site.
i know i can use http_referer, but i wonder how fool proof it is, i dont
want to spit out errors to a legit user that actually came from a valid page
before trying to access the file url. some people have said http_referer is
not always accurate.
I wouldn't rely on http_referer at all. Why not start a session when 
people enter your site and ensure a valid session is created before your 
file manager serves the file?

--
---John Holmes...
Amazon Wishlist: www.amazon.com/o/registry/3BEXC84AB3A5E/
php|architect: The Magazine for PHP Professionals  www.phparch.com
--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php


Re: [PHP] HTTP Authenticate via PHP

2004-11-30 Thread Raditha Dissanayake
Jeffery Fernandez wrote:
Hi,
I am trying to find out if its possible to authenticate a page against 
an HTTP authentication. Basically what I am trying to do is make 
available the stats page of the Cpanel to the admin interface of a 
site. When accessing the stats via the cpanel the user needs to login 
via http authentication.

Is it possible for me to store the username password credentials 
within the php page and pass that across via headers to authenticate 
the page for viewing the stats. The main purpose is to make the 
webstats transparent to the admin user so they don't have to enter any 
username/password. I tried putting the username:[EMAIL PROTECTED] into 
the url of an iframe page(session controlled) but stupid IE spits the 
authentication as a pop-up (login window). Hope I have explained well 
enough.

One option is to send an authorization header.  (exaple: Authorization: 
Basic   . credentials) more details are available in the RFC 2616 but 
the disadvantage is that you would not be able to make use of the 
fopen() method. My understanding however is that the url of the type 
that you described about should work. CPanel and other virtual hosting 
schemes have an '@' sign in the username that probably caused the 
hiccups you should try urlencoding the username and password.

cheers,
Jeffery

--
Raditha Dissanayake.
--
http://www.radinks.com/print/card-designer/ | Card Designer Applet
http://www.radinks.com/upload/  | Drag and Drop Upload 

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


Re: [PHP] HTTP Authenticate via PHP

2004-11-30 Thread Jason Wong
On Tuesday 30 November 2004 14:13, Jeffery Fernandez wrote:

 Is it possible for me to store the username password credentials within
 the php page and pass that across via headers to authenticate the page
 for viewing the stats. The main purpose is to make the webstats
 transparent to the admin user so they don't have to enter any
 username/password. 

You can use something like:

$doo = file_get_contents('http://user:[EMAIL PROTECTED]/secure-page.html');
echo $doo;

This should work fine if there no further interaction on secure-page.html, 
however if secure-page.html allows the user to interact with it you would 
have to intercept and interpret those interactions so that you can forward 
them appropriately.

 I tried putting the username:[EMAIL PROTECTED] into the 
 url of an iframe page(session controlled) but stupid IE spits the
 authentication as a pop-up (login window). Hope I have explained well
 enough.

I believe this behaviour/functionality was removed in response to the spate of 
phishing epidemics.

-- 
Jason Wong - Gremlins Associates - www.gremlins.biz
Open Source Software Systems Integrators
* Web Design  Hosting * Internet  Intranet Applications Development *
--
Search the list archives before you post
http://marc.theaimsgroup.com/?l=php-general
--
/*
No man is useless who has a friend, and if we are loved we are indispensable.
  -- Robert Louis Stevenson
*/

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



Re: [PHP] http header script to stimluate upload with drag and drop??

2004-11-16 Thread Robby Russell
On Tue, 2004-11-16 at 13:10 -0500, Scott Fletcher wrote:
 Hi!
 
 I wonder is is it possible to have an http header that would stimluate
 files/folders upload via dragging over to the browser window?  If so then
 what are the sample functions or scripts that make this possible...
 
 Thanks,
  Scott
 

I have a script that will stimulate you.

;-)

-- 
/***
* Robby Russell | Owner.Developer.Geek
* PLANET ARGON  | www.planetargon.com
* Portland, OR  | [EMAIL PROTECTED]
* 503.351.4730  | blog.planetargon.com
* PHP/PostgreSQL Hosting  Development
*--- Now supporting PHP5 ---
/


signature.asc
Description: This is a digitally signed message part


Re: [PHP] http header script to stimluate upload with drag anddrop??

2004-11-16 Thread Scott Fletcher
:-)

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



Re: [PHP] http response

2004-11-13 Thread Robert Cummings
On Sat, 2004-11-13 at 10:38, Josh Howe wrote:
  
 Is it possible in php to get a hold of the response stream and see what has
 been sent already? I have a global php function, but it can't be called
 inside html form elements, because it creates its own form, and when you
 nest html forms things get weird. In this function, I want to check if there
 is already an open form tag in the response without a corresponding
 /form tag. Is there any way to do this? Thanks!!

Look into ob_get_contents()

Cheers,
Rob.
-- 
..
| InterJinn Application Framework - http://www.interjinn.com |
::
| An application and templating framework for PHP. Boasting  |
| a powerful, scalable system for accessing system services  |
| such as forms, properties, sessions, and caches. InterJinn |
| also provides an extremely flexible architecture for   |
| creating re-usable components quickly and easily.  |
`'

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



RE: [PHP] http response

2004-11-13 Thread Josh Howe

That's perfect, thanks Rob.


-Original Message-
From: Robert Cummings [mailto:[EMAIL PROTECTED] 
Sent: Saturday, November 13, 2004 10:48 AM
To: Josh Howe
Cc: PHP-General
Subject: Re: [PHP] http response

On Sat, 2004-11-13 at 10:38, Josh Howe wrote:
  
 Is it possible in php to get a hold of the response stream and see what
has
 been sent already? I have a global php function, but it can't be called
 inside html form elements, because it creates its own form, and when you
 nest html forms things get weird. In this function, I want to check if
there
 is already an open form tag in the response without a corresponding
 /form tag. Is there any way to do this? Thanks!!

Look into ob_get_contents()

Cheers,
Rob.
-- 
..
| InterJinn Application Framework - http://www.interjinn.com |
::
| An application and templating framework for PHP. Boasting  |
| a powerful, scalable system for accessing system services  |
| such as forms, properties, sessions, and caches. InterJinn |
| also provides an extremely flexible architecture for   |
| creating re-usable components quickly and easily.  |
`'

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

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



Re: [PHP] HTTP AUTH in PHP5

2004-10-27 Thread Christophe Chisogne
Nunners wrote:
I'm having some problems with using HTTP Auth in PHP5
IIRC, php 5.0 had a bug related to HTTP auth, corrected in php 5.0.1: [1]
Fixed bug #29132 [http://bugs.php.net/29132]
 ($_SERVER[PHP_AUTH_USER] isn't defined). (Stefan)
Note, I cant access bugs.php.net right now.
If you use PHP 5, upgrade to PHP 5.0.2 (released 23-Sep-2004),
which correct a (security) pblm related to GPC processing.
Christophe
[1] Changelog for 5.0.1
http://www.php.net/ChangeLog-5.php#5.0.1
--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php


Re: [PHP] HTTP AUTH in PHP5

2004-10-26 Thread John Nichel
Nunners wrote:
I'm having some problems with using HTTP Auth in PHP5 - how do I check
whether the old $PHP_AUTH_USER exists?
It's part of the $_SERVER super global.
$_SERVER['PHP_AUTH_USER']
--
John C. Nichel
ÜberGeek
KegWorks.com
716.856.9675
[EMAIL PROTECTED]
--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php


Re: [PHP] http 411 error with cURL

2004-10-09 Thread Marek Kilimajer
Nick Wilson wrote:
hi all, 

Im getting an http 411 error when trying to post data with php's cURL
functions. The spec says 

***The message for this error code is Length Required.
The server refuses to accept the request without a defined Content-
Length.***
Im confused on 2 points:
* Is it the server i am posting *from* causing the error or is it the
  server im posting *to*?
B is correct
* How to resolve this?
header('Content-Length: ' . strlen($data_you_are_posting));
Much thx for any guidance here, this was not happening yesterday doing
the same job.. weird!
--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php


Re: [PHP] http 411 error with cURL

2004-10-09 Thread Nick Wilson

* and then Marek Kilimajer declared
 * How to resolve this?
 
 header('Content-Length: ' . strlen($data_you_are_posting));

Ok, im with you Marek but how/where do i put it in my curl function?
Not with CURL_POSTFIELDS for sure.. i've been looking through the
options in the manual and dont see anything obivious...?

thanks mate..

-- 
Nick W

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



Re: [PHP] http 411 error with cURL

2004-10-09 Thread Nick Wilson

* and then Nick Wilson declared
 
 * and then Marek Kilimajer declared
  * How to resolve this?
  
  header('Content-Length: ' . strlen($data_you_are_posting));
 
 Ok, im with you Marek but how/where do i put it in my curl function?
 Not with CURL_POSTFIELDS for sure.. i've been looking through the
 options in the manual and dont see anything obivious...?

Opps!

CURLOPT_HTTPHEADER

I go play with it now ;-)

-- 
Nick W

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



Re: [PHP] http 411 error with cURL

2004-10-09 Thread Marek Kilimajer
Nick Wilson wrote:
* and then Nick Wilson declared
* and then Marek Kilimajer declared
* How to resolve this?
header('Content-Length: ' . strlen($data_you_are_posting));
Ok, im with you Marek but how/where do i put it in my curl function?
Not with CURL_POSTFIELDS for sure.. i've been looking through the
options in the manual and dont see anything obivious...?

Opps!
CURLOPT_HTTPHEADER
I go play with it now ;-)
Sorry, I got it mixed :) But you figured it out.
--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php


Re: [PHP] http 411 error with cURL

2004-10-09 Thread Nick Wilson

* and then Marek Kilimajer declared
 Opps!
 
 CURLOPT_HTTPHEADER
 
 I go play with it now ;-)
 
 
 Sorry, I got it mixed :) But you figured it out.

do you know if the lenght includes the args? like this

strlen(val=$varval2=$var2);

or 

strlen($var . $var2=;

?

cheers marek


-- 
Nick W

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



Re: [PHP] http 411 error with cURL

2004-10-09 Thread Nick Wilson
* and then Marek Kilimajer declared
 Nick Wilson wrote:
 * and then Marek Kilimajer declared
 
 Opps!
 
 CURLOPT_HTTPHEADER
 
 I go play with it now ;-)
 
 
 Sorry, I got it mixed :) But you figured it out.
 
 
 do you know if the lenght includes the args? like this
 
 strlen(val=$varval2=$var2);
 
 This one. Don't forget to urlencode where necessary


hmmm.. well, this is giving me the same curl_errno(22) http 411

$postF=s=$se=$ea= .  urlencode($a) . em= . urlencode($em) .x= .
$x . b=$bt= . urlencode($t) . p=$p;

$postL=strlen($postF);

curl_setopt($ch, CURLOPT_POSTFIELDS,$postF);
curl_setopt($ch, CURLOPT_HTTPHEADERS, Content-Length: $postL);

$result=curl_exec($ch);

-- 
Nick W

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



Re: [PHP] http 411 error with cURL

2004-10-09 Thread Marek Kilimajer
Nick Wilson wrote:
* and then Marek Kilimajer declared
Nick Wilson wrote:
* and then Marek Kilimajer declared

Opps!
CURLOPT_HTTPHEADER
I go play with it now ;-)
Sorry, I got it mixed :) But you figured it out.

do you know if the lenght includes the args? like this
strlen(val=$varval2=$var2);
This one. Don't forget to urlencode where necessary

hmmm.. well, this is giving me the same curl_errno(22) http 411
$postF=s=$se=$ea= .  urlencode($a) . em= . urlencode($em) .x= .
$x . b=$bt= . urlencode($t) . p=$p;
$postL=strlen($postF);
curl_setopt($ch, CURLOPT_POSTFIELDS,$postF);
curl_setopt($ch, CURLOPT_HTTPHEADERS, Content-Length: $postL);
CURLOPT_HTTPHEADER - An array of HTTP header fields to set.
curl_setopt($ch, CURLOPT_HTTPHEADERS, array('Content-Length' = $postL));
$result=curl_exec($ch);
--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php


Re: [PHP] http 411 error with cURL

2004-10-09 Thread Marek Kilimajer
Nick Wilson wrote:
* and then Marek Kilimajer declared
Opps!
CURLOPT_HTTPHEADER
I go play with it now ;-)
Sorry, I got it mixed :) But you figured it out.

do you know if the lenght includes the args? like this
strlen(val=$varval2=$var2);
This one. Don't forget to urlencode where necessary
--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php


Re: [PHP] http 411 error with cURL

2004-10-09 Thread Nick Wilson

* and then Marek Kilimajer declared
 CURLOPT_HTTPHEADER - An array of HTTP header fields to set.

Marek, im sure you dont need to know this, but i think it's funny so
maybe you will, i just went to bed, im now sitting here er.. without
much on at the PC cos i just realized the same thing! - sorry, im
tired

thanks so much!

-- 
Nick W

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



Re: [PHP] http 411 error with cURL

2004-10-09 Thread Nick Wilson

* and then Nick Wilson declared
 
 * and then Marek Kilimajer declared
  CURLOPT_HTTPHEADER - An array of HTTP header fields to set.

ahhh [EMAIL PROTECTED] it!

that dont work and niether does this:

curl_setopt($ch, CURLOPT_HTTPHEADERS, array(Content-Length: $postL));

im off to bed.. back in the am.

-- 
Nick W

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



Re: [PHP] HTTP Authentication in include()

2004-09-04 Thread Chris Shiflett
--- Matt Wondra [EMAIL PROTECTED] wrote:
 I'm trying to include a file from an HTTP Authenticated server
 in PHP. I have a valid username and password. Is there any way
 to remotely login and include the file?
 
 Ex:
 
 include(https://www.url.com/incl1.php;);

When allow_url_fopen is enabled, you can include a remote URL, similar to
what you've shown. What PHP does for you is send an HTTP request to the
remote server, receive the response, and include the content just as if
you included a local file.

It is this request that PHP sends that needs to have the Authorization
header. To my knowledge, there is no way to add your own headers to this
request made on your behalf, although you could certainly hack PHP's
source to allow such a thing.

What you can do is write your own code to make a request. I'll give you a
quick example, but keep in mind that I'm just typing this out in an email,
and it is likely to contain bugs. :-)

--
$username = 'myuser';
$password = 'mypass';
$host = 'example.org';
$path = '/path/to/script.php';
  
   
$authorization = base64_encode($username:$password);
$http_response = '';
  
   
$fp = fsockopen($host, 80);

fputs($fp, GET $path HTTP/1.1\r\n);
fputs($fp, Host: $host\r\n);
fputs($fp, Authorization: $authorization\r\n);
fputs($fp, Connection: close\r\n\r\n);
fputs($fp, $data);

while (!feof($fp))
{
 $http_response .= fgets($fp, 128);
}

fclose($fp);
--

Your example cites a URL with the https scheme. To speak SSL, this example
will of course require some enhancements, but hopefully this answers your
question.

Chris

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

PHP Security - O'Reilly
 Coming Fall 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] HTTP Authentication in include()

2004-09-03 Thread Jason Wong
On Friday 03 September 2004 05:27, Matt Wondra wrote:

 I'm trying to include a file from an HTTP Authenticated server in PHP. I
 have a valid username and password. Is there any way to remotely login and
 include the file?

 Ex:

 include(https://www.url.com/incl1.php;);  // Trying to include from
 password-protected site

  include('https://user:[EMAIL PROTECTED]/incl1.php')

-- 
Jason Wong - Gremlins Associates - www.gremlins.biz
Open Source Software Systems Integrators
* Web Design  Hosting * Internet  Intranet Applications Development *
--
Search the list archives before you post
http://marc.theaimsgroup.com/?l=php-general
--
/*
I am the wandering glitch -- catch me if you can.
*/

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



Re: [PHP] HTTP POST then Redirect?

2004-08-04 Thread Justin Patrin
On Wed, 04 Aug 2004 16:01:31 -0500, Jeff Oien [EMAIL PROTECTED] wrote:
 I'm using the code below to post form data to an ASP script. But I need
 to redirect to a thank you page when it all done or the person filling
 out the form sees what they're not supposed to see. Any way I can do
 this? If take out the last line and print a header(URL) it won't post
 the data. Thanks
 Jeff
 -
 function http_post($host, $path, $data)
 {
   $http_response = '';
   $content_length = strlen($data);
 
   $fp = fsockopen($host, 80);
   fputs($fp, POST $path HTTP/1.1\r\n);
   fputs($fp, Host: $host\r\n);
   fputs($fp, Content-Type: application/x-www-form-urlencoded\r\n);
   fputs($fp, Content-Length: $content_length\r\n);
   fputs($fp, Connection: close\r\n\r\n);
   fputs($fp, $data);
   while (!feof($fp))
   {
$http_response .= fgets($fp, 128);
   }
   fclose($fp);
 
   return $http_response;
 }
 
 $arr = array();
 
 foreach($_POST as $key = $value) {
 $arr[] = $key.'='.urlencode($value);
 }
 
 $data = implode('',$arr);
 
 $http_response = http_post('www.blah.com', '/test.aspx?', $data);
 print $http_response;
 

replace the print with:
header('Location: http://example.com');

-- 
DB_DataObject_FormBuilder - The database at your fingertips
http://pear.php.net/package/DB_DataObject_FormBuilder

paperCrane --Justin Patrin--

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



Re: [PHP] HTTP POST then Redirect?

2004-08-04 Thread Jeff Oien
Justin Patrin wrote:
On Wed, 04 Aug 2004 16:01:31 -0500, Jeff Oien [EMAIL PROTECTED] wrote:
I'm using the code below to post form data to an ASP script. But I need
to redirect to a thank you page when it all done or the person filling
out the form sees what they're not supposed to see. Any way I can do
this? If take out the last line and print a header(URL) it won't post
the data. Thanks
Jeff
-
function http_post($host, $path, $data)
{
 $http_response = '';
 $content_length = strlen($data);
 $fp = fsockopen($host, 80);
 fputs($fp, POST $path HTTP/1.1\r\n);
 fputs($fp, Host: $host\r\n);
 fputs($fp, Content-Type: application/x-www-form-urlencoded\r\n);
 fputs($fp, Content-Length: $content_length\r\n);
 fputs($fp, Connection: close\r\n\r\n);
 fputs($fp, $data);
 while (!feof($fp))
 {
  $http_response .= fgets($fp, 128);
 }
 fclose($fp);
 return $http_response;
}
$arr = array();
foreach($_POST as $key = $value) {
   $arr[] = $key.'='.urlencode($value);
}
$data = implode('',$arr);
$http_response = http_post('www.blah.com', '/test.aspx?', $data);
print $http_response;
replace the print with:
header('Location: http://example.com');
Then the data won't submit. cURL doesn't seem to help:
$URL=www.abc.com/VendorSubmitEx_test.aspx?;
$ch = curl_init();
curl_setopt($ch, CURLOPT_URL,https://$URL;);
curl_setopt($ch, CURLOPT_POST, 1);
curl_setopt($ch, CURLOPT_POSTFIELDS, $data);curl_exec ($ch);
curl_close ($ch);
Second to last line sends a header and I can't redirect.
Jeff
--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php


Re: [PHP] HTTP POST then Redirect?

2004-08-04 Thread Justin Patrin
On Wed, 04 Aug 2004 17:39:51 -0500, Jeff Oien [EMAIL PROTECTED] wrote:
 
 
 Justin Patrin wrote:
  On Wed, 04 Aug 2004 16:01:31 -0500, Jeff Oien [EMAIL PROTECTED] wrote:
 
 I'm using the code below to post form data to an ASP script. But I need
 to redirect to a thank you page when it all done or the person filling
 out the form sees what they're not supposed to see. Any way I can do
 this? If take out the last line and print a header(URL) it won't post
 the data. Thanks
 Jeff
 -
 function http_post($host, $path, $data)
 {
   $http_response = '';
   $content_length = strlen($data);
 
   $fp = fsockopen($host, 80);
   fputs($fp, POST $path HTTP/1.1\r\n);
   fputs($fp, Host: $host\r\n);
   fputs($fp, Content-Type: application/x-www-form-urlencoded\r\n);
   fputs($fp, Content-Length: $content_length\r\n);
   fputs($fp, Connection: close\r\n\r\n);
   fputs($fp, $data);
   while (!feof($fp))
   {
$http_response .= fgets($fp, 128);
   }
   fclose($fp);
 
   return $http_response;
 }
 
 $arr = array();
 
 foreach($_POST as $key = $value) {
 $arr[] = $key.'='.urlencode($value);
 }
 
 $data = implode('',$arr);
 
 $http_response = http_post('www.blah.com', '/test.aspx?', $data);
 print $http_response;
 
 
  replace the print with:
  header('Location: http://example.com');
 
 Then the data won't submit. cURL doesn't seem to help:
 
 $URL=www.abc.com/VendorSubmitEx_test.aspx?;
 $ch = curl_init();
 curl_setopt($ch, CURLOPT_URL,https://$URL;);
 curl_setopt($ch, CURLOPT_POST, 1);
 curl_setopt($ch, CURLOPT_POSTFIELDS, $data);curl_exec ($ch);
 curl_close ($ch);
 
 Second to last line sends a header and I can't redirect.
 

By default, curl sends it output to the browser. This is what is
causing the output. You can probably turn it off, but I don't know
how.

I would suggest using PEAR's HTTP_Request as it returns the result and
has lots of IMHO easier to use options than curl.

http://pear.php.net/package/HTTP_Request

-- 
DB_DataObject_FormBuilder - The database at your fingertips
http://pear.php.net/package/DB_DataObject_FormBuilder

paperCrane --Justin Patrin--

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



Re: [PHP] HTTP Session Recorder?

2004-07-13 Thread Justin Patrin
On Tue, 13 Jul 2004 19:42:19 -0400, John W. Holmes
[EMAIL PROTECTED] wrote:
 Does anyone know of a program that'll record the clicks and requests
 as I go through a site? Something that'll watch as I click on links,
 fill in forms, etc and then be able to perform the same requests
 (duplicating the forms, cookies, etc)?? Maybe a PHP script that can be
 dropped into an existing program and be turned on or off?
 
 Any ideas? Anyone think this is possible to implement in PHP and then
 use Curl or a PEAR class to reproduce the sequence?
 

Well, you can reproduct this with PEAR HTTP_Client. As for recording
it, I don't know of anything specific, but you could, for instance,
use the auto_prepend functionality of PHP to do something like this:

$vars = '$vars[] = array('uri' = '.addslashes($_SERVER['REQUEST_URI']).',
'get' = '.var_export($_GET, true).',
'post' = '.var_export($_POST, true).',
'cookie' = '.var_export($_COOKIE, true).');';

Then you could save $vars to a file and then include it from some
other script, loop through the contents, and send requests. :-)

-- 
DB_DataObject_FormBuilder - The database at your fingertips
http://pear.php.net/package/DB_DataObject_FormBuilder

paperCrane --Justin Patrin--

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



Re: [PHP] HTTP RAW DATA

2004-07-01 Thread raditha dissanayake
Alan McDonald wrote:
Does anyone know a way of getting the raw data passed back from a server?
I want to compare the total raw data sent back from Apache with that sent
back from IIS for a particular file. I don;t want any filtering at all and I
need to catch it so I can see it all.
Thanks
Alan
 

telnet hostname.com 80
GET /pathname HTTP/1.1
Host: hostname.com
(hit enter here again)

--
Raditha Dissanayake.
-
http://www.raditha.com/megaupload/upload.php
Sneak past the PHP file upload limits.
--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php


RE: [PHP] http to https

2004-06-18 Thread Ryan Schefke
Hitek - I tried adding the exit; after the header ('Location...

Andre - Your idea about sending them to another page is a good one.  I tried
it, without any luck.  

What could the issue still be?

To simplify my problem, I have a simple script:

?php 
header ('Location https://www.tgwedding.com/payment6.php');
exit;
?

Which just hangs when I access the page and it doesn't redirect.  Typing URL
in browser correctly sends me to the secure page though.



-Original Message-
From: Andre Dubuc [mailto:[EMAIL PROTECTED] 
Sent: Thursday, June 17, 2004 9:42 PM
To: [EMAIL PROTECTED]
Subject: Re: [PHP] http to https

Well, I'm no php-guru, that's for sure, but if you are trying to call:

https://www.tgwedding.com/payment6.php from
http://www.tgwedding.com/payment6.php

might be where the problem lies. You might need to do a 'refresh' since
What 
is strange is when I go back on my browser and resubmit, it correctly sends 
it to the https location and all is well.

What I have done a s a clutz-hack is to create an additional page for the 
re-direct, which then sends it back to the page in question. (I used that
for 
'cookie' detection/browser ident as well on my opening pages.) I suppose you

might get away with a Meta Refresh but I'm not too clear whetehr you can 
accomplish that for the same page . . 

Aside from that idea . . . .
 
Hth,
Andre


On Thursday 17 June 2004 08:31 pm, you wrote:
 Yeah, I'm assuming it's set.  I have an installed ssl cert from a CA and
 have successfully run other https scripts (by typing in the URL) on the
 server.

 I check phpinfo(),  http://www.tgwedding.com/tgwedding/phpinfo.php
 php, http, ftp, https, ftps, compress.bzip2, compress.zlib

 I searched php.ini for ssl and https and didn't find anything though


 -Original Message-
 From: Andre Dubuc [mailto:[EMAIL PROTECTED]
 Sent: Thursday, June 17, 2004 8:26 PM
 To: Ryan Schefke
 Subject: Re: [PHP] http to https

 Just a thought - is https on the server set? (Check your php.ini)

 On Thursday 17 June 2004 08:20 pm, Ryan Schefke wrote:
  Hi Andre,
 
  Thanks for responding.  I'm not using sessions, just cookies.  I used
  your recommendation in the code below (which gets executed if the submit
  button is pushed.  It still sends it to
  http://www.tgwedding.com/payment6.php; instead of
  https://www.tgwedding.com/payment6.php;
 
  Any advice please?
 
  
  if (isset($submit)) {
  if ($radiobutton == 1) {
  $value=$validcoupon;
  } else {
  $value=0;
  }
  $query_insertcoupon = UPDATE sitepayment SET couponcode='$value'
  WHERE customerID='$CID';
  $result_insertcoupon = mysql_query ($query_insertcoupon); // run the
  query
  if ($_SERVER['HTTPS'] != on){
  header(Location: https://www.tgwedding.com/payment6.php;);
  exit;}
 
  //  $redirect = https://www.tgwedding.com/payment6.php;;
  //header (Location: $redirect);
  }
  =
 
 
 
 
 
 
 
 
  -Original Message-
  From: Andre Dubuc [mailto:[EMAIL PROTECTED]
  Sent: Thursday, June 17, 2004 8:01 PM
  To: Ryan Schefke; [EMAIL PROTECTED]
  Subject: Re: [PHP] http to https
 
  Hi Ryan,
 
  I encountered all sorts of problems attempting to do the same
(especially
  with
  AOL, Yahoo, etc click-throughs).
 
  I finally resolved the problem by calling https on the page itself
(which
  is
 
  listed then as http) like so at the top (after my session_start(); of
  course:
 
  ?php if ($_SERVER['HTTPS'] != on){
  header(Location: https://www.your_site.com.php;);
  exit;}
  ?
 
 
  Hth,
  Andre
 
  On Thursday 17 June 2004 07:27 pm, Ryan Schefke wrote:
   I'm getting some strange behavior when trying to go from http to an

 https

   script.
  
  
  
   After clicking a form submit button the script will execute the two

 lines

   below.  It does this and sends it to the correct page without the
   https, only http.  What is strange is when I go back on my browswer
and
   resubmit, it correctly sends it to the https location and all is well.
  
  
  
   $redirect = https://www.tgwedding.com/payment6.php;;
  
   header (Location: $redirect);
  
  
  
  
  
   What am I doing wrong?

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

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



RE: [PHP] http to https

2004-06-18 Thread R'twick Niceorgaw
Hi Ryan,
you have an error in your script.

Quoting Ryan Schefke [EMAIL PROTECTED]:

 
 ?php 
 header ('Location https://www.tgwedding.com/payment6.php');
 exit;
 ?

correct one is 
?php
header ('Location: https://www.tgwedding.com/payment6.php');
?

Note the : after Location.

HTH
-R'twick
-- 
This is a signature


This message was sent using IMP, the Internet Messaging Program.

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



Re: [PHP] http to https

2004-06-17 Thread Andre Dubuc
Hi Ryan,

I encountered all sorts of problems attempting to do the same (especially with 
AOL, Yahoo, etc click-throughs).

I finally resolved the problem by calling https on the page itself (which is 
listed then as http) like so at the top (after my session_start(); of course:

?php if ($_SERVER['HTTPS'] != on){
header(Location: https://www.your_site.com.php;);
exit;}
?


Hth,
Andre

On Thursday 17 June 2004 07:27 pm, Ryan Schefke wrote:
 I'm getting some strange behavior when trying to go from http to an https
 script.



 After clicking a form submit button the script will execute the two lines
 below.  It does this and sends it to the correct page without the https,
 only http.  What is strange is when I go back on my browswer and resubmit,
 it correctly sends it to the https location and all is well.



 $redirect = https://www.tgwedding.com/payment6.php;;

 header (Location: $redirect);





 What am I doing wrong?

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



RE: [PHP] http to https

2004-06-17 Thread Chris W. Parker
Ryan Schefke mailto:[EMAIL PROTECTED]
on Thursday, June 17, 2004 4:28 PM said:

[snip]

 
 
 

[snip]

 
 
 

[snip]

 
 
 
 
 
 What am I doing wrong?

you're pressing the return key too much.


0_0

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



RE: [PHP] http to https

2004-06-17 Thread Ryan Schefke
Quick follow up...

Has anyone had any issues with redirecting from an http script to https?
Every time I try to to a redirect to https it hangs. For example, I write a
simple script like this, nothing...

?php 
header ('Location https://www.tgwedding.com/payment6.php');
?

...but if I type that link in a browser http is working fine.



-Original Message-
From: Andre Dubuc [mailto:[EMAIL PROTECTED] 
Sent: Thursday, June 17, 2004 8:01 PM
To: Ryan Schefke; [EMAIL PROTECTED]
Subject: Re: [PHP] http to https

Hi Ryan,

I encountered all sorts of problems attempting to do the same (especially
with 
AOL, Yahoo, etc click-throughs).

I finally resolved the problem by calling https on the page itself (which is

listed then as http) like so at the top (after my session_start(); of
course:

?php if ($_SERVER['HTTPS'] != on){
header(Location: https://www.your_site.com.php;);
exit;}
?


Hth,
Andre

On Thursday 17 June 2004 07:27 pm, Ryan Schefke wrote:
 I'm getting some strange behavior when trying to go from http to an https
 script.



 After clicking a form submit button the script will execute the two lines
 below.  It does this and sends it to the correct page without the https,
 only http.  What is strange is when I go back on my browswer and resubmit,
 it correctly sends it to the https location and all is well.



 $redirect = https://www.tgwedding.com/payment6.php;;

 header (Location: $redirect);





 What am I doing wrong?

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



RE: [PHP] http to https

2004-06-17 Thread Ryan Schefke
Hi Andre,

Thanks for responding.  I'm not using sessions, just cookies.  I used your
recommendation in the code below (which gets executed if the submit button
is pushed.  It still sends it to http://www.tgwedding.com/payment6.php;
instead of https://www.tgwedding.com/payment6.php;

Any advice please?


if (isset($submit)) {
if ($radiobutton == 1) {
$value=$validcoupon;
} else {
$value=0;
}
$query_insertcoupon = UPDATE sitepayment SET couponcode='$value'
WHERE customerID='$CID';
$result_insertcoupon = mysql_query ($query_insertcoupon); // run the
query
if ($_SERVER['HTTPS'] != on){
header(Location: https://www.tgwedding.com/payment6.php;);
exit;}

//  $redirect = https://www.tgwedding.com/payment6.php;;
//header (Location: $redirect);
}   
=








-Original Message-
From: Andre Dubuc [mailto:[EMAIL PROTECTED] 
Sent: Thursday, June 17, 2004 8:01 PM
To: Ryan Schefke; [EMAIL PROTECTED]
Subject: Re: [PHP] http to https

Hi Ryan,

I encountered all sorts of problems attempting to do the same (especially
with 
AOL, Yahoo, etc click-throughs).

I finally resolved the problem by calling https on the page itself (which is

listed then as http) like so at the top (after my session_start(); of
course:

?php if ($_SERVER['HTTPS'] != on){
header(Location: https://www.your_site.com.php;);
exit;}
?


Hth,
Andre

On Thursday 17 June 2004 07:27 pm, Ryan Schefke wrote:
 I'm getting some strange behavior when trying to go from http to an https
 script.



 After clicking a form submit button the script will execute the two lines
 below.  It does this and sends it to the correct page without the https,
 only http.  What is strange is when I go back on my browswer and resubmit,
 it correctly sends it to the https location and all is well.



 $redirect = https://www.tgwedding.com/payment6.php;;

 header (Location: $redirect);





 What am I doing wrong?

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



Re: [PHP] http to https

2004-06-17 Thread Andre Dubuc
Well, I'm no php-guru, that's for sure, but if you are trying to call:

https://www.tgwedding.com/payment6.php from
http://www.tgwedding.com/payment6.php

might be where the problem lies. You might need to do a 'refresh' since What 
is strange is when I go back on my browser and resubmit, it correctly sends 
it to the https location and all is well.

What I have done a s a clutz-hack is to create an additional page for the 
re-direct, which then sends it back to the page in question. (I used that for 
'cookie' detection/browser ident as well on my opening pages.) I suppose you 
might get away with a Meta Refresh but I'm not too clear whetehr you can 
accomplish that for the same page . . 

Aside from that idea . . . .
 
Hth,
Andre


On Thursday 17 June 2004 08:31 pm, you wrote:
 Yeah, I'm assuming it's set.  I have an installed ssl cert from a CA and
 have successfully run other https scripts (by typing in the URL) on the
 server.

 I check phpinfo(),  http://www.tgwedding.com/tgwedding/phpinfo.php
 php, http, ftp, https, ftps, compress.bzip2, compress.zlib

 I searched php.ini for ssl and https and didn't find anything though


 -Original Message-
 From: Andre Dubuc [mailto:[EMAIL PROTECTED]
 Sent: Thursday, June 17, 2004 8:26 PM
 To: Ryan Schefke
 Subject: Re: [PHP] http to https

 Just a thought - is https on the server set? (Check your php.ini)

 On Thursday 17 June 2004 08:20 pm, Ryan Schefke wrote:
  Hi Andre,
 
  Thanks for responding.  I'm not using sessions, just cookies.  I used
  your recommendation in the code below (which gets executed if the submit
  button is pushed.  It still sends it to
  http://www.tgwedding.com/payment6.php; instead of
  https://www.tgwedding.com/payment6.php;
 
  Any advice please?
 
  
  if (isset($submit)) {
  if ($radiobutton == 1) {
  $value=$validcoupon;
  } else {
  $value=0;
  }
  $query_insertcoupon = UPDATE sitepayment SET couponcode='$value'
  WHERE customerID='$CID';
  $result_insertcoupon = mysql_query ($query_insertcoupon); // run the
  query
  if ($_SERVER['HTTPS'] != on){
  header(Location: https://www.tgwedding.com/payment6.php;);
  exit;}
 
  //  $redirect = https://www.tgwedding.com/payment6.php;;
  //header (Location: $redirect);
  }
  =
 
 
 
 
 
 
 
 
  -Original Message-
  From: Andre Dubuc [mailto:[EMAIL PROTECTED]
  Sent: Thursday, June 17, 2004 8:01 PM
  To: Ryan Schefke; [EMAIL PROTECTED]
  Subject: Re: [PHP] http to https
 
  Hi Ryan,
 
  I encountered all sorts of problems attempting to do the same (especially
  with
  AOL, Yahoo, etc click-throughs).
 
  I finally resolved the problem by calling https on the page itself (which
  is
 
  listed then as http) like so at the top (after my session_start(); of
  course:
 
  ?php if ($_SERVER['HTTPS'] != on){
  header(Location: https://www.your_site.com.php;);
  exit;}
  ?
 
 
  Hth,
  Andre
 
  On Thursday 17 June 2004 07:27 pm, Ryan Schefke wrote:
   I'm getting some strange behavior when trying to go from http to an

 https

   script.
  
  
  
   After clicking a form submit button the script will execute the two

 lines

   below.  It does this and sends it to the correct page without the
   https, only http.  What is strange is when I go back on my browswer and
   resubmit, it correctly sends it to the https location and all is well.
  
  
  
   $redirect = https://www.tgwedding.com/payment6.php;;
  
   header (Location: $redirect);
  
  
  
  
  
   What am I doing wrong?

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



Re: [PHP] http to https

2004-06-17 Thread hitek
try placing an exit(); after your header line.
At 04:27 PM 6/17/2004, Ryan Schefke wrote:
I'm getting some strange behavior when trying to go from http to an https
script.

After clicking a form submit button the script will execute the two lines
below.  It does this and sends it to the correct page without the https,
only http.  What is strange is when I go back on my browswer and resubmit,
it correctly sends it to the https location and all is well.

$redirect = https://www.tgwedding.com/payment6.php;;
header (Location: $redirect);


What am I doing wrong?
--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php


Re: [PHP] http username

2004-05-02 Thread Matt
 If a user is logged in via http (authentification e.g. with  .htaccess and
 .htpasswd file), how can i get the username of the current logged in user?

Read the manual at: http://www.php.net/manual/en/features.http-auth.php

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



RE: [PHP] http username

2004-05-02 Thread rich
 If a user is logged in via http (authentification e.g. with  .htaccess and
 .htpasswd file), how can i get the username of the current logged in user?

 Thanx
 Harry

try $_SERVER['PHP_AUTH_USER']

rich

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



  1   2   3   >