php read file
-
I have worked press in store on my local PC. And installed elementor, insert php code snippet plugin.
create 2 php snippetprint_deno <?php print '<h3>'.'Good Morning.'.'</h3>'.'<br>'; print 'What is your Roll No.?'.'<br>'; ?>read_file_demo
<?php $myfile = fopen("abc.txt", "r") or die("Unable to open file!"); echo fread($myfile,filesize("abc.txt")); fclose($myfile); ?>and insert the snippet into a page.
the print_demo works fine. but read_file_demo failed. got this:
Warning: fopen(abc.txt): failed to open stream: No such file or directory in C:\xampp\htdocs\wp6\wp-content\plugins\insert-php-code-snippet\widget.php(64) : eval()’d code on line 2
Unable to open file!
I do have abc.txt at C:\xampp\htdocs\wp6\wp-content\plugins\insert-php-code-snippet\please tell me what I did wrong.
thank you for reading.
Viewing 4 replies - 1 through 4 (of 4 total)
Viewing 4 replies - 1 through 4 (of 4 total)
The topic ‘php read file’ is closed to new replies.