I’m new to PHP and just faced the problem with creating and opening a file with fopen(). Here is my code: When I try to run the file by opening it in the browser I see the next message: ‘Cannot create a file’. But when I start debug session everithing works as it supposed to. I suspect that there is
Tag: fopen
PHP file handling read and write
I am trying to figure out how the file handling works, the thread says: Your task is to write a PHP script, which reads grades from the file “grades.txt”, raises all of them by one, writes the raised grades into the file “results.txt”, and finally prints the raised grades from the file “results.txt”. If a grade is 5, it won’t
How to display line by line a csv file in PHP with a particular structure? [closed]
I have this code that reads a csv file and displays it in this form : REFERENCE;COLOR;QUANTITY;TURNOVER;SELL TROUGH;COMMENT GJK0C9;8952;3;90;3%;Pack S GJKCS4;399;2;19;10%;Windows GSIJS5;9224;…
Why doesn’t PHP 7.2 fopen(/tmp, a) write to the file?
I have an old “PHPDBG” function that lets me “printf” to a text file. I’ve had PHPDBG.inc “since forever” (at least since PHP 4.x days), but it doesn’t seem to be working in my current configuration (ubuntu18, Apache 2.4.29 and PHP 7.2). Specifically: I can’t open the file ($fp is null) … /tmp/PHPDBG.txt never gets created (because of the fopen
Open a password protected EXCEL in wamp using PHP
I have an excel that has a password (When you open it, it asks for a password). I want to open it and save it to a new folder. Supposing that there is no password my script would be : How can I mention the password of the file in the fopen function? It must be only one line that
Edit PHP file using another PHP file and add a line on top of it
I have a PHP file that I want to dynamically add lines to it whenever I want. Let’s say I have foo.php which has these inside it: but I want to be able to add a line I specify in another file as a variable to be added on top of it and save the old content as well, to
PHP, Date() and fopen
I have an error system that take the date() and the error and insert it into a file: My problem: for start at the fopen at the second parameter I need the pointer to be at the start and that looked at the manual and I need the parameter to be writing only, put the pointer at the start and
Using fopen and str_replace to auto fill a select option
I have this file ‘gardens.php’, which pulls data from a table called ‘generalinfo’ and I use fopen to send that data to a file called ‘index.html’. Here is the issue, only one option is filled. I have a demo running here Garden Demo <– this is a new updated page and location, there are more errors than I have locally