NamePros
Welcome, Guest! Ready to make a name for yourself in the domain business? We welcome both the hobbyist and professional domainer to join the discussion as part of the NamePros community.

Click here to create your profile to start earning reputation for posting, and trader ratings for buying & selling in our free e-marketplace. Build your trader rating with each successful sale. Our system has tracked over 100,000 sales and counting!
FAQ & TOS Register Search Today's Posts Mark Forums Read

Go Back   NamePros.com > General Marketplace > Web Development > Web Development Wanted
Reload this Page Bit of php coding

Web Development Wanted Requests for websites, templates, custom programming, logos or graphics.

Advanced Search


Closed Thread
 
LinkBack Thread Tools
Old 07-24-2006, 03:59 PM THREAD STARTER               #1 (permalink)
NamePros Regular
 
evermore2000's Avatar
Join Date: Mar 2006
Posts: 385
evermore2000 will become famous soon enoughevermore2000 will become famous soon enough
 



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
????: NamePros.com http://www.namepros.com/web-development-wanted/220459-bit-of-php-coding.html
// 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";
}

// //
????: NamePros.com http://www.namepros.com/showthread.php?t=220459
// //
// //
/////////////////////////////////////////////////////////////////
}


?>




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 by evermore2000; 07-25-2006 at 04:58 AM.
evermore2000 is offline  
Old 07-25-2006, 04:58 AM THREAD STARTER               #2 (permalink)
NamePros Regular
 
evermore2000's Avatar
Join Date: Mar 2006
Posts: 385
evermore2000 will become famous soon enoughevermore2000 will become famous soon enough
 



anyone?
evermore2000 is offline  
Old 07-25-2006, 10:46 AM   #3 (permalink)
NamePros Regular
Join Date: Sep 2005
Location: Romania
Posts: 496
softgroups will become famous soon enoughsoftgroups will become famous soon enough
 



Yes, i can help you with that , please e-mail me at : bogdan@softgroups.com along with all your Yahoo/MSN messenger id, etc
__________________
Free PHP Scripts - Free online php scripts collection
http://www.iseotools.com - SEO Tools
softgroups is offline  
Old 07-25-2006, 01:00 PM THREAD STARTER               #4 (permalink)
NamePros Regular
 
evermore2000's Avatar
Join Date: Mar 2006
Posts: 385
evermore2000 will become famous soon enoughevermore2000 will become famous soon enough
 



thanks,

Email sent
evermore2000 is offline  
Closed Thread


Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Thread Tools


Liquid Web Smart Servers  
All times are GMT -7. The time now is 03:39 AM.

Managed Web Hosting by Liquid Web
Domain name forum recommended by Domaining.com Powered by: vBulletin® Copyright ©2000 - 2012, Jelsoft Enterprises Ltd.
Search Engine Friendly URLs by vBSEO 3.6.0 Ad Management plugin by RedTyger