I'm new to JQuery and AJAX. I've only been learning them for ~1 day. I'm trying to make a form where the user puts in the data, hits submit and ajax takes the data and ships it off to my PHP script. The PHP script writes the data to two separate files and then returns 'OK' on success or the error on failure. This should then be printed out accordingly and the form hidden. The input is being written to the file ok but it's everything after that that's not working.
<p class="intro" style="display:none;">Here's how it works: I have a couple of songs in my music library. I want to get more into music so if you have just heard a song or you want to tell me to listen to one, just add it here!
<p class="toggle" style="text-align:center; border:1px solid #BBBBBB;">Hide/Show</p>
<p>Here's my music library right now!</p>
I haven't run this on my own server to test it, but one thing that jumps out at me is the die($error.="texthere" statements. AFAIK, die ends php execution, so the echo $error you've got at the bottom won't be run. You may be getting some sort of error after the files were written that isn't being written out and is preventing the echo "Ok" from being reached.