Welcome to HBH! If you have tried to register and didn't get a verification email, please using the following link to resend the verification email.

real 2 php help


ghost's Avatar
0 0

teh following code bellow says that a certain page works, but when i goto that page it doesnt work! is there something wrong with me PHP coding?


for($i=0;$i<30;$i++)
{
  for($j=1;$j<25;$j++)
  {
    $sqlfile="http://hellboundhackers.org/challenges/real2/backups/backup_2004-09-0" . $i . "_" . $j . "00.sql";
    $file=fopen($sqlfile,"r");
	if(!$file)
	{
	  echo "<h6>DOESNT WORK!";
	}
	else
	  echo "<h1>WORKS!!!!";
  }
}

?>```

ghost's Avatar
0 0

Im pretty sure if you get the wrong sql file you do recieve some data aswel, so maybe its the !file bit.


SySTeM's Avatar
-=[TheOutlaw]=-
20 0

also, you've put this:

echo "<h1>WORKS!!!!";
}```

it should be:

```markupelse
{
echo "<h1>WORKS!!!!";
}```

ghost's Avatar
0 0

i have redone my file, and this is what i have come up with:


for($i=0;$i<32;$i++)
{
  for($j=0;$j<24;$j++)
  {
    if($i<10)
    {
      $sqlfile="http://hellboundhackers.org/challenges/real2/backups/backup_2004-09-0" . $i . "_" . $j . "00.sql";
      $file=fopen($sqlfile,"r");
      $theData=fread($file, filesize($sqlfile));
    }
    else
    {
      $sqlfile="http://hellboundhackers.org/challenges/real2/backups/backup_2004-09-" . $i . "_" . $j . "00.sql";
      $file=fopen($sqlfile,"r");
      $theData=fread($file, filesize($sqlfile));
    }
  }
}

?>```