&#9;// NOTE: Some PHP installations may use a different nomenclature for the "$_REQUEST" such as "$_HTTP_SERVER"
&#9;$theContent = "";
&#9;
&#9;// Here we are extracting all of the info contained in the request.

the code returns the result of a user voting on a song and returns all of the variables of the song such as title, artist, filename to the text file. What i am looking to do is take this information and scan a database and add a vote to a song based upon the information that is posted. How would I do this using a php function?

If you are wanting to record a vote, where are you going to store that? Are you wanting to keep a count in table with a foreign key constraint to the table you mentioned above so it will grow vertically and you have an audit trail of the votes or do you want to just have a vote column in the table you mentioned and update it with a running total of votes?

Manage projects of all sizes how you want. Great for personal to-do lists, project milestones, team priorities and launch plans.
- Combine task lists, docs, spreadsheets, and chat in one
- View and edit from mobile/offline
- Cut down on emails

Okay, not sure if you have the song id or not. Let's assume you do for now and it is 53. Also let's say you have a column in your table that holds the vote counts called votes.

$songId=53;<?php$con = mysql_connect("host","username","password");if (!$con) { die('Could not connect: ' . mysql_error()); }mysql_select_db("my_db", $con);//we need to do a select to grab the current votes the song has$result = mysql_query("SELECT votes FROM music WHERE id = '$songId'");while($row = mysql_fetch_array($result)) { $voteCnt = $row['votes']; //grab the current vote count }$voteCnt++; add 1 vote to the count//now we need to insert the new vote total back into the dbmysql_query("INSERT INTO musc(votes) VALUES('$voteCnt' ) where id='$songId' ") or die(mysql_error()); //cloe your db connectionmysql_close($con);?>

so as it is the function creates a function called test.txt which has all of the information in it. How do I catch this information? Do I jus make a file called votecapture.php, which has the above function in it, and set that where the test.txt currently is? Or do i need to do something else.

@jvsmooth, here is how I would handle the voting. Make a junction table that contains (at a minimum) two columns - the key of the song and the key of the user. You could augment this table to include other interesting things like the DATETIME of the vote, or the IP address (can be used to determine the geographic location of the voter). This table will be quite long, but if you have an index on the key columns you will have pretty good performance even if it goes into the hundreds of thousands of rows.

I would not have a vote column in the music table. To understand why, you would need to understand all about data base normalization and that is a little too much for you to learn over a question at EE.

The purpose of this video is to demonstrate how to set up the WordPress backend so that each
page automatically generates a Mailchimp signup form in the sidebar.
This will be demonstrated using a Windows 8 PC. Tools Used are Photoshop, Awesome…

HTML5 has deprecated a few of the older ways of showing media as well as offering up a new way to create games and animations. Audio, video, and canvas are just a few of the adjustments made between XHTML and HTML5.
As we learned in our last micr…