Question
Using Netbeans create a project in PHP, from it create a text file. Using the validation functions check that the txt file is writable. If
Using Netbeans create a project in PHP, from it create a text file. Using the validation functions check that the txt file is writable. If it is not possible to write in it, send a error message indicating this. Using PHP functions to handle files, write about a favorite hobby and favorite color, . Then you must close the file and verify that it was created, it should have been saved in the folder where the PHP project was saved example : WindowsC:/XAMPS/htdocs/nombredelarchivo.
EXAMPLE OF SOLUTION :
php // Create the file $ Firstfile = "Firstfiles.txt"; // Assign the variable pa to the file in writing mode $ pa = fopen ($ Firstfile, 'w'); // Check that the file is writable, if it is, the text is added if (is_writable ($ Firstfile)) { fwrite ($ pa, "My name is Milagros Fernandez Santiago. "); fwrite ($ pa, "I live in Santa Isabel \ n"); fwrite ($ pa, "Course in the third year of University."); fclose ($ pa); } // If it doesn't print error message else { echo 'cannot be opened'; } ?>
Step by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started