Re: RE: [PHP] I can't execute pf commands

2011-07-28 Thread Arthur Moczulski
Answer to your problem is in your pop Apache module configuration. I would
suggest to look how different your cli php.ini file is in comparison to your
Apache php module php.ini file

Also I would not follow the suggestion of adding Apache user to sudoers.
It's quite high risk move in security-wise

Arthur Moczulski
On 28 Jul 2011 19:16, Bulent Malik bma...@ihlas.net.tr wrote:




  did you try it in shell? or just You tried it in PHP?

 Yeah, I tried it on shell and it works on it. Also if I execute it as
 command line, it works ;

 php test.php

 But when I try it on www ( internet explorer, firefox, chrome ..) it
 doesn't work.




Re: [PHP] I want to use POST when redirect via PHP Header function.

2011-06-30 Thread Arthur Moczulski
that's quite basic thing which you can definitely find in the manual

On 30 June 2011 10:48, Md Ashickur Rahman Noor ashickur.n...@gmail.comwrote:

 
  On Thu, Jun 30, 2011 at 1:52 PM, Geoff Lane ge...@gjctech.co.uk wrote:
   On Thursday, June 30, 2011, Md Ashickur Rahman Noor wrote:
 
   I want to use POST when redirect via PHP Header function. Is it
   possible?
 
  AFAICT, it isn't. You can use GET variables by passing them on the
  querystring. These can then be accessed via $_REQUEST, which is an
  amalgamation of $_POST, $_GET, and $_COOKIE. So if you have a script
  that might take input from either $_POST or $_GET, you can usually
  code fairly transparently by replacing both by $_REQUEST.
 
  Alternatively, you can create a form on the page and use client-side
  javascript to 'auto-submit' via the body onLoad event. However, this
  does require JS on the client and so cannot be guaranteed.
 
  HTH,
 
  --
  Geoff
 

 Thank you every one. If I use GET then the value will be shown in the
 address bar, Which I don't want to do.

 Can any one describe me the $_REQUEST and $_COOKIE, if you can give example
 it will be helpful for me.
 --
 Dedicated Linux Forum in
 Bangladesh
 http://forums.linuxdesh.com/member.php?action=registerreferrer=3%20
 Follow Me Twiter https://twitter.com/#%21/AshickunNoor
 Thank you
 Md Ashickur Rahman



Re: [PHP] Manipulate Request Headers after Redirect

2011-06-24 Thread Arthur Moczulski
Hey,
this is what I understand: you want to manipulate headers of the request
sent by the client directly after receiving a 302 response?
If that's the case, than read further ;)

Any client goes through the following process while communicating with a
web-server:
1. get IP address from the domain (achieved thanks to DNSs)
2. create an IP socket connection with the obtained IP address
3. write an HTTP request through the socket
4. receive an HTTP response from the web-server. the answer will include
status compatible with the HTTP protocol.

In your example this process is repeated twice:
1. get ip of domain using dns
2. open a connection
3. write an http request to the socket
4. receive http with 302 status

(the client as an http protocol compliant software continues with the
alternative url provided by the 302 response)

5. get ip of domain specified as alternative url in received 302 using dns
6. open a new connection
7. write an http request to the newly opened socket
8. receive http response from web-server

Your problem is exactly between point 4 and 5. Unfortunately for you that's
client software's work to determine what will be done next. HTTP compliant
software (which every browser is) will follow the redirection. So, unless a
client provides you with some way of manipulating this behaviour, which is
quite unlikely, this can't be done.

Javascript won't be too much help in here as js scripts loaded into the
browser live only in the lifetime of displaying the specific response. As
302 responses can't include any content like javascript code which can live
in the lifetime of processing the response, so you can't control what's
going on in here.

The only way that comes my mind is to check if 302 response can hold any
force behaviour sort of information which is taken under consideration by
the client. Unfortunately, I don't think HTTP protocol specification defines
anything like that (however something definitely worth checking).

What you can try though is extending whole the communication between client
and web-server. So:
1. send the original request
2. receive the 302 response
3. send the request for alternative url
4. web-server checks the referrer of the request received and sends an
answer needed, so you receive a response which guides your client

To achieve that you need an access to the server-side application.

Let me know if that's any help.

On 24 June 2011 08:37, Louis Huppenbauer louis.huppenba...@gmail.comwrote:

 Thanks for your response, but I don't think that will do.

 First - SERVER_PORT is the port the apache/iis/whatever server is
 working with (usually 80 or 443)
 Second - That would still be manipulating the headers for the response
 (As php mostly just generates the response, and not the request).

 I'm thinking more and more that this is not really a php-question (as
 it is server-side), but more of a js-question (client-side).

 thanks anyway!
 louis
 2011/6/24  ad...@buskirkgraphics.com:
  Try
 
 
  If($_SERVER['SERVER_PORT'] == 302)
  {
  header('Referer: example.net');
  }
 
 
  Richard L. Buskirk
 
  -Original Message-
  From: Louis Huppenbauer [mailto:louis.huppenba...@gmail.com]
  Sent: Friday, June 24, 2011 3:05 AM
  To: php-general@lists.php.net
  Subject: [PHP] Manipulate Request Headers after Redirect
 
  Hi there!
 
  I just have a small question concerning the http-protocol and php (and
  in specific the header-function, i think).
  Is it possible to manipulate the headers for the request which is sent
  after a 302-header?
 
 
  eg:
 
  Response:
  header('Referer: example.com');
  header('Location: example.net');
 
  Request (for the 302):
  header('Referer: example.net');
  header('Cache: max-age=0);
 
 
  I think I need that for a login to a tomcat app from an external
  php-form. As of now the Login works fine, I just have to reload the
  page to actually be logged in (and that is quite a bother).
 
 
  Sincerely yours
  Louis
 
  --
  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