Unstoppable Domains โ€” Get your daily AI drops report

Bit of php coding

Namecheap AuctionsNamecheap Auctions
Namecheap AuctionsNamecheap Auctions
Spacemail by SpaceshipSpacemail by Spaceship
Watch
Status
Not open for further replies.
Bit of php work - Paid

Hi,

I have a media player on my website which has a 'voting' option on it allowing visitors listening to a song to vote for it. The most voted for artists will play a showcase gig each month.

This is the voting script below. As it is now it just records 1 vote. If you read the first paragraph you'll get the idea.

My site is www.unsigned.fm if you wanna have a look at the media player. Everything came from www.wimpyplayer.com.

Can anyone help please? I need it to record all the votes. Please reply here or PM me with prices.

Many thanks

Rob :)



<?php
/////////////////////////////////////////////////////////////////
// //
// //
// //
// The following is for testing only:
//
// To test this script, create a text file and set the
// permissions on the file to 777 (read-write-all).
// The text file should reside in the same folder as
// this script. The result of the test should write the
// returned values from the vote to the file.


// Enter the name of the file that should record the information here:
$testFile = "test.txt";
// NOTE: The permissions on this file must be sett to 777 (read-write-all)
// NOTE: This test file will only record a single vote. This script
// is intended to provide you with an example of how to read the infromation
// returned from the player. It is up to you to develop a script that will store
// the retuned information as you see fit.


// The player will include "action" -- which is set to "vote" in the URI,
// so that you can differentiate calls from the player from those who might
// try and access this script directly.
if($_REQUEST['action']=="vote"){




function writeTextFile2($theFileName, $theContent, $openCondition='w+'){
if($theContent=="" || is_null($theContent)){
$enterContent = " ";
} else {
$enterContent = $theContent;
}
$retval = TRUE;
if (!$fp = fopen($theFileName, $openCondition)) {
$retval = FALSE;
}
if($retval){
if (!$filewrite = fwrite($fp, stripslashes($enterContent))) {
$retval = FALSE;
exit;
} else {
$retval = TRUE;
}
}
@fclose($fp);
return $retval;
@chmod ($theFileName, 0777);
}



// NOTE: Some PHP installations may use a different nomenclature for the "$_REQUEST" such as "$_HTTP_SERVER"
$theContent = "";

// Here we are extracting all of the info contained in the request.

foreach($_REQUEST as $key => $value){
$theContent .= $key." : \t".urldecode($value)."\r\n";
}

strstr( PHP_OS, "WIN") ? $slash = "\\" : $slash = "/";

//print "$testFile";

if(writeTextFile2(getcwd ().$slash.$testFile, $theContent, 'w+')){
print "&retval=ok";
} else {
print "&retval=error";
}

// //
// //
// //
/////////////////////////////////////////////////////////////////
}


?>




This is what the test.txt file looks like as it is now :


action : trackPlays
flashlistID : 4
entity : m
filename : http://www.unsigned.fm/mp3s/Evermore - No Escape.mp3
artist :
title : Evermore - No Escape
comments :
visual :
 
Last edited:
0
•••
The views expressed on this page by users and staff are their own, not those of NamePros.
Unstoppable Domains โ€” AI StorefrontUnstoppable Domains โ€” AI Storefront
anyone?
 
0
•••
Yes, i can help you with that , please e-mail me at : [email protected] along with all your Yahoo/MSN messenger id, etc
 
0
•••
thanks,

Email sent :)
 
0
•••
Status
Not open for further replies.
Dynadot โ€” .com TransferDynadot โ€” .com Transfer
CatchedCatched
Escrow.com
Spaceship
Domain Recover
CryptoExchange.com
Catchy
DomDB
NameFit
  • The sidebar remains visible by scrolling at a speed relative to the pageโ€™s height.
Back