Can't read page itself

if your page test.php
[email protected]_get_contents(“http://localhost/test.php”);
then error

Posted at Nginx Forum:
http://forum.nginx.org/read.php?2,5607,5607#msg-5607

nginx/0.7.61 for win
fcgi/5.3.0

Posted at Nginx Forum:
http://forum.nginx.org/read.php?2,5607,5608#msg-5608

but apache can be

Posted at Nginx Forum:
http://forum.nginx.org/read.php?2,5607,5723#msg-5723

I try not into recursion
test.php

<? $id=$_GET['id']; if ($id==1){ echo"1"; }else{ [email protected]_get_contents("http://localhost/test.php?id=1";); } ?>

still error

Posted at Nginx Forum:
http://forum.nginx.org/read.php?2,5607,5724#msg-5724

In the future, perhaps you should:

  1. post the actual error
  2. post your nginx config

That way people don’t have to guess about what you are doing.

On Sun, 2009-09-06 at 23:48 -0400, afen wrote:

I try not into recursion
test.php

<? $id=$_GET['id']; if ($id==1){

if ($id==“1”){

Note that all _GET variables will be strings. You have to coerce them
if you want them to become other types.

I also seriously doubt this worked under Apache. This is a PHP
programming error. Making false claims doesn’t help get your problem
solved.

Cliff

Hello!

On Thu, Sep 03, 2009 at 11:55:47PM -0400, afen wrote:

if your page test.php
[email protected]_get_contents(“http://localhost/test.php”);
then error

Looks like infinite recursion for me.

See http://en.wikipedia.org/wiki/Recursion

Maxim D.

On Sun, 2009-09-06 at 21:52 -0700, Cliff W. wrote:

<? $id=$_GET['id']; if ($id==1){

if ($id==“1”){

Note that all _GET variables will be strings. You have to coerce them
if you want them to become other types.

Bah, I forgot that PHP stupidly coerces crap without prompting.

“1” == 1 is true in PHP.

Better post your config.

Cliff

On Mon, Sep 7, 2009 at 10:48 AM, afen[email protected] wrote:

still error

it works here.

<?php $id=$_GET['id']; if ($id==1){ echo"1"; }else{ [email protected]_get_contents("http://localhost/test.php?id=1"); echo $html; } ?>

returns 1 no matter what the id is.