GoFuckYourself.com - Adult Webmaster Forum

GoFuckYourself.com - Adult Webmaster Forum (https://gfy.com/index.php)
-   Fucking Around & Business Discussion (https://gfy.com/forumdisplay.php?f=26)
-   -   PHP problem! (https://gfy.com/showthread.php?t=64787)

Validus 06-18-2002 05:19 PM

PHP problem!
 
I wonder why this doesn't work. Anybody have any ideas?

<?
$fp = fopen("source.php", "r");
$out = fread($fp, filesize("output.php"));
?>

<? echo $out; ?>

Validus 06-18-2002 05:22 PM

But But But... php is cool!

SetTheWorldonFire 06-18-2002 05:22 PM

send me $1000 immediatly!

dodo 06-18-2002 05:40 PM

Quote:

Originally posted by Validus
I wonder why this doesn't work. Anybody have any ideas?

<?
$fp = fopen("source.php", "r");
$out = fread($fp, filesize("output.php"));
?>

<? echo $out; ?>

you are opening source.php and using filesize of output.php.

you should use the filesize of source.php. remember to close $fp

:thumbsup

Socks 06-18-2002 08:20 PM

Did that fix your problem?

NitroPhil 06-18-2002 09:09 PM

Quote:

Originally posted by dodo


you are opening source.php and using filesize of output.php.

you should use the filesize of source.php. remember to close $fp

:thumbsup

Yeah, that's exactly what's going on. Having a starting PHP tag would help to. :) As long as you do filesize() on source.php instead of output.php, it should be cool.

leverage7 06-18-2002 09:18 PM

Quote:

Originally posted by Validus
I wonder why this doesn't work. Anybody have any ideas?

<?
$fp = fopen("source.php", "r");
$out = fread($fp, filesize("output.php"));
?>

<? echo $out; ?>

In addition to the filesize() being called on a different file, make sure that source.php is in your php include path.

You can get your include_path by calling

ini_get('include_path');

and you can change it by calling

ini_set('include_path', '/path/one:/path/two:/etc');

foe 06-18-2002 09:22 PM

Quote:

Originally posted by dodo


you are opening source.php and using filesize of output.php.

you should use the filesize of source.php. remember to close $fp

:thumbsup

exactly, not much to add, closing $fp is recomended but not necessary as it will be closed at end of script.

Also when posting in the future copy and paste php errors if there are any as well :)


All times are GMT -7. The time now is 10:20 AM.

Powered by vBulletin® Version 3.8.8
Copyright ©2000 - 2026, vBulletin Solutions, Inc.
©2000-, AI Media Network Inc123