Jump to content

WaxyChicken

New Members
  • Posts

    2
  • Joined

  • Last visited

WaxyChicken's Achievements

Newbie

Newbie (1/5)

0

Reputation

  1. BINGO! thank you. it was the result of me not having PHP as my first language.
  2. this works: echo("</table>"); echo("<br><BR><BR><BR>"); echo("URL file = "); echo($urlFile); echo("<BR>"); $urlFile = "" . $_GET['urlFile']; echo("$get urlfile = "); echo("*" . $urlFile . "*"); echo("<HR>"); echo ("Current Directory: " . getcwd() . "\n<BR>"); if ($urlFile = "") { $urlFile = "index.html"; } //$fh = fopen("index.html", 'r'); $fh = fopen("index.html", 'r'); $theData = fread($fh, filesize("index.html")); fclose($fh); echo $theData; this does not.... echo("</table>"); echo("<br><BR><BR><BR>"); echo("URL file = "); echo($urlFile); echo("<BR>"); $urlFile = "" . $_GET['urlFile']; echo("$get urlfile = "); echo("*" . $urlFile . "*"); echo("<HR>"); echo ("Current Directory: " . getcwd() . "\n<BR>"); if ($urlFile = "") { $urlFile = "index.html"; } //$fh = fopen("index.html", 'r'); $fh = fopen($urlFile, 'r'); $theData = fread($fh, filesize($urlFile)); fclose($fh); echo $theData; the dubug output is the same: urlfile = *index.html* Current Directory: c:\inetpub\wwwroot the errors it throws are: [phpBB Debug] PHP Warning: in file C:/inetpub/wwwroot/frametest.php on line 279: fopen(): Filename cannot be empty [phpBB Debug] PHP Warning: in file C:/inetpub/wwwroot/frametest.php on line 280: fread() expects parameter 1 to be resource, boolean given [phpBB Debug] PHP Warning: in file C:/inetpub/wwwroot/frametest.php on line 281: fclose() expects parameter 1 to be resource, boolean given how can $urlFile be the same in both examples, but not the name of a file in the second example? i'm using $urlFile = "" . $_GET['urlFile']; for the second example. eg: http://www.MYSITE.com/myPHPscript.php?urlFile=index.html
×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.