i’m making a music website.
i have this button image for adding a song to playlist. if a user clicks on that button,it should enter that songs details into my playlist table.
i know how to submit information to database using text boxes.
can anybody help me with the code for it?
what should be the IF condition for clicking of the image/button?
i’m making a music website. i have this button image for adding a song
Share
there are two ways:
1) using a regular HTML form. Wrap the form around your button image, put a hidden field in the form with the song details e.g.
<input type="hidden" name="song" value="Where the streets have no name">then when the form is submitted your will have the details of that song. Use more than one hidden field if you have to.2) a little more complicated but it would be ideal to use Ajax. You could collect the song details from the image id attribute and then push it all to a PHP page.