Link to home
Start Free TrialLog in
Avatar of TheMaximumWeasel
TheMaximumWeasel

asked on

** EASY 500 POINTS ** Fix Script For PHP5

I installed PHProxy on my webserver and I get this error because of some problem with running a PHP4 script on a PHP5 Server

Fatal error: Non-static method PHProxy::decode_url() cannot be called statically in /var/www/hosting/max/maxweisel/html/proxybypass/PHProxy.class.php on line 276

and on line 276 I have:

$this->url = decode_url($url);

How can I fix this.

Max
ASKER CERTIFIED SOLUTION
Avatar of TeRReF
TeRReF
Flag of Netherlands image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
If $this is already a PHProxy object,
$this->decode_url($url);
will suffice...
Sorry, you can forget about my last remark :)
Avatar of TheMaximumWeasel
TheMaximumWeasel

ASKER

When I use the first solution ( $this->url = PHProxy::decode_url($url); ) I get the same error and with the second one ( $this->url = PHProxy->decode_url($url); ) I get this error:
Parse error: parse error, unexpected T_OBJECT_OPERATOR in /var/www/hosting/max/maxweisel/html/proxybypass/PHProxy.class.php on line 276

Max
nvm the first one gives me this error:

Fatal error: Call to undefined method PHProxy::decode_url() in /var/www/hosting/max/maxweisel/html/proxybypass/PHProxy.class.php on line 276
Download PHProxy from sourceforge version 0.4 and see if you can get it to work on a server with php 5.0.4 because that is my only problem is it doesn't work on php 5.

Max
It works 'out of the box' for me on PHP 5.1.2
safe_mode needs to be turned off in your php.ini by the way...
hi TheMaximumWeasel ,

I think your problem is str_rot13 encoding function... . try this:

remove str_rot13 from 113th line...

105 if ($this->flags['rotate13'])
106        {
107            function encode_url($url)
108            {
109                return rawurlencode(str_rot13($url));
110            }
111            function decode_url($url)
112            {
113                return str_replace('&', '&', str_rot13(rawurldecode($url)));
114            }
115        }
116        else if ($this->flags['base64_encode'])
117        {
118            function encode_url($url)
119            {


new code is like that:
105 if ($this->flags['rotate13'])
106        {
107            function encode_url($url)
108            {
109                return rawurlencode(str_rot13($url));
110            }
111            function decode_url($url)
112            {
113                return str_replace('&', '&', rawurldecode($url));
114            }
115        }
116        else if ($this->flags['base64_encode'])
117        {
118            function encode_url($url)
119            {

let me know the results.. bye