...

View Full Version : Having problems with include..



cyphix
05-14-2004, 11:22 PM
It writes to the files fine & creates them etc.. but including the file spouts errors even tho the file "does" exist.



<?php

$file="num.txt";

$content = file_get_contents($file);

$content++;

$resourceid = fopen($file, "w");

fputs($resourceid, $content);

fclose($resourceid);

$sn = $content;

$snf = $sn . "file.txt";


$fd = fopen("files/$snf", "w");

fputs($fd, "\$fileid = $sn;");

fclose($fd);


include('files/$snf');

?>


Any clue?

cyphix
05-14-2004, 11:24 PM
Forgot... the errors are:

Warning: main(files/$snf): failed to open stream: No such file or directory in xxxxxxxxxxxxxx/test.php on line 28

Warning: main(): Failed opening 'files/$snf' for inclusion (include_path='.:/usr/local/lib/php') in xxxxxxxxxxxxxxxxxxxx/test.php on line 28

cyphix
05-14-2004, 11:42 PM
nm.. got it figured out. Should of used double quotes instead. ;)



EZ Archive Ads Plugin for vBulletin Copyright 2006 Computer Help Forum