checkbox - PHP - Write selected checkboxes to a text file -


What I have to do is write a bunch of songs that a user selects in a text file from the checkbox list. The songs are listed in a text file, which is then opened and its values ​​are stored in an array, and that array is used to create the checkbox list. This is what I have done so far.

  & lt; Html & gt; & Lt; H1 & gt; Welcome to Zmzon To add to your library, select the song below. & Lt; / H1> & Lt ;? Php var_dump ($ _ POST); / * Type song selection in the MyLibrary.txt file. * / If (isset ($ _ POST ['songList'])) {$ addSongs = $ _POST ['song list']; $ Handle = fopen ('myLibrary.txt', 'a'); Foreign currency ($ add $ adds as song) {FILIT ($ handle, $ song. "\ N"); } Fclose ($ handle); }? & Gt; & Lt; Form action = "zmzon.php" method = "post" & gt; & Lt ;? Add the contents of zmzonSongs.txt to the php / * array. * / $ SongList = Explosion ("\ n", file_get_contents ('zmzonSongs.txt')); External songs ($ song written as $ song) {echo "
& gt; ; $ Song & lt; br & gt; "; }? & Gt; & Lt; Input type = "submit" & gt; & Lt; / Form & gt; & Lt; A href = "ztunes.php" & gt; For ZTunes & lt; / A & gt; & Lt; / Html & gt;

I have looked around everywhere and I am still struggling with this.

in the following zmzon.php file

   

The above process is used to get the song list and it is stored in the 'myLibrary.txt' file. You can get your existing zmzon.php file

can include the above section

Comments

Popular posts from this blog

ios - How do I use CFArrayRef in Swift? -

eclipse plugin - Run java code error: Workspace is closed -

c - Error on building source code in VC 6 -