Old 17th August 2006, 11:56   #1
Arvinja
Junior Member
 
Join Date: Aug 2006
Posts: 11
Request Script

Ok, I needed a simple request script for my radio, so I made one, it's not XHTML 1.0 Strict, cause I didn't use CSS, but you can modify it if you want!

--------------
Requirements:
-PHP
-MySQL
--------------
Change:
The MySQL Connect Info!
--------------
request.php (where they request)
PHP Code:
<?php
// All code is created by Arvin Johansson Arbab
// So all credits to me! HaHaHaHA xD
mysql_connect("server","username","password");
//Change the above line
mysql_select_db("database");
//Change the above line
$reg "yes";
$ip $_SERVER['REMOTE_ADDR'];
?>
<html>
<head>
<title>Request a song</title>
</head>
<body>
<?php
echo "Your ip is: ".$ip."<br />";
if (isset(
$_POST['submit'])) {
if (empty(
$_POST['song'])) {
echo 
"Sorry, you haven't supplied the song title!<br />";
$reg "no";
}
if (empty(
$_POST['artist'])) {
echo 
"Sorry, you haven't supplied the artists name!<br />";
$reg "no";
}
if (empty(
$_POST['name'])) {
echo 
"Sorry, you haven't supplied your name<br />";
$reg "no";
}

  
$sql "SELECT COUNT(*) FROM request_song WHERE ip='{$ip}'";
  
$result mysql_query($sql);
  if (
mysql_result($result0) > 0) {
echo 
"Sorry, your ip has already wished for one song, you can not wish for <br />another until the DJ's have seen your request!<br />";
$reg "no";
}
if (
$reg == "yes") {
    
$sql "INSERT INTO request_song(song, artist, name, ip)
            VALUES('
{$_POST['song']}', '{$_POST['artist']}', '{$_POST['name']}', '{$ip}')";
    
mysql_query($sql);
}
}
?>
<form action="request.php" method="POST">
<table>
<tr><td>Song title: </td><td><input type="text" name="song" value=""></td></tr>
<tr><td>Artist: </td><td><input type="text" name="artist" value=""></td></tr>
<tr><td>Your name: </td><td><input type="text" name="name" value=""></td></tr>
</table>
<input type="submit" name="submit" value="Send!">
</form>
</body>
</html>
requested.php (where you'll see the requests)
PHP Code:
<?php
// All code is created by Arvin Johansson Arbab
// So all credits to me! HaHaHaHA xD
mysql_connect("server","username","password");
//Change the above line
mysql_select_db("database");
//Change the above line
?>
<html>
<head>
<title>Requested songs</title>
</head>
<body>
<table width="600" border="1">
<tr><td>ID</td><td>Song</td><td>Artist</td><td>Requested by</td><td>IP</td><td>Delete</td></tr>
<?php
if ($_GET['del']) {
$delete $_GET['del'];
$delque "DELETE FROM request_song WHERE id='{$delete}'"
mysql_query($delque);
}
$query "SELECT * FROM request_song ORDER BY id ASC"
$result mysql_query($query);
while (
$row mysql_fetch_assoc($result)) {
$id $row['id'];
$song $row['song'];
$artist $row['artist'];
$name $row['name'];
$ip $row['ip'];
echo 
"<tr><td>".$id."</td><td>".$song."</td><td>".$artist."</td><td>".$name."</td><td>".$ip."</td><td><a href='?del=".$id."'>Delete</a></td></tr>";
}
?>
</table>
</body>
</html>
MySQL Database:
------------------
table name: request_song
id, bigint, auto_increasement, Primary Key
song, longtext
artist, longtext
name, longtext
ip, varchar, 100
------------------

Info:
Ok, one IP-adress can only post ONE request,
but when the DJ's go to requested.php
and delete a request from the table
the IP is allowed to request a new song!
Arvinja is offline   Reply With Quote
Old 18th August 2006, 13:54   #2
Arvinja
Junior Member
 
Join Date: Aug 2006
Posts: 11
Please comment if you find this code useful
I would appreciate that!
Thank you!
Arvinja is offline   Reply With Quote
Old 20th August 2006, 22:21   #3
sargentmike51
Junior Member
 
sargentmike51's Avatar
 
Join Date: Dec 2004
Location: Houston, TX
Posts: 37
Send a message via AIM to sargentmike51 Send a message via Yahoo to sargentmike51
that script doesn't work...i had to rewite it but you added some lame stuff on it.
sargentmike51 is offline   Reply With Quote
Old 26th August 2006, 12:24   #4
henny1
Junior Member
 
Join Date: Aug 2006
Posts: 3
Dear Arvinja,

thank you for the script, i installed and it worked immidiately without any errors. I Created the MYSQL query to run in PHPmyadmin for you. Hope this helps people like Sargentmike51 who clearly have no knowledge about PHP and/or Mysql.
Keep up the good work..

[code]

CREATE TABLE `request_song` (
`id` bigint NOT NULL auto_increment,
`song` longtext NOT NULL default '',
`artist` longtext NOT NULL default '',
`name` longtext NOT NULL default '',
`ip` varchar(100) NOT NULL default '',
PRIMARY KEY (`id`)
) TYPE=MyISAM;

[end code]
henny1 is offline   Reply With Quote
Old 27th August 2006, 19:58   #5
citrusfizz
Junior Member
 
Join Date: May 2004
Posts: 10
at henny1

where do i put your code to creat those tables?
citrusfizz is offline   Reply With Quote
Old 28th August 2006, 13:12   #6
henny1
Junior Member
 
Join Date: Aug 2006
Posts: 3
@citrusfizz,

Open PHPmyadmin
you will see a empty field, just make up a Database name.
Like: request then click create database.

Then you get a screen that the database is created.
in that screen click SQL, then you see a field where you can run the query.
henny1 is offline   Reply With Quote
Old 28th August 2006, 20:36   #7
darkorbit
Junior Member
 
Join Date: Aug 2006
Location: Quincy MA
Posts: 1
I need help T.T

I've tryed the code and it sorta worked but i need help or info about setting up the mysql server..... for the server input on the scipt, I tryed localhost but it won't work.... i've tryed the phpmyadmin script too but i got an error on that... can some one help me? T.T
darkorbit is offline   Reply With Quote
Old 29th August 2006, 00:23   #8
henny1
Junior Member
 
Join Date: Aug 2006
Posts: 3
@darkorbit you have a PM with my MSN add me and i set it up with you
henny1 is offline   Reply With Quote
Old 6th November 2006, 07:07   #9
Arvinja
Junior Member
 
Join Date: Aug 2006
Posts: 11
Thank you, henny1, I'd like to see this around, but I would encourage the people who wants to use this to know, or learn how to use MySQL!
Arvinja is offline   Reply With Quote
Old 6th November 2006, 07:13   #10
seachen
Junior Member
 
Join Date: Nov 2006
Posts: 11
can u show the demo?
seachen is offline   Reply With Quote
Old 8th November 2006, 14:14   #11
xhilaration
Senior Member
 
xhilaration's Avatar
 
Join Date: Jun 2006
Location: Last time I checked, I was on EARTH lol
Posts: 237
Send a message via Skype™ to xhilaration
henny1, I have it up, but how will I know I have a request, do I have to put my e-mail, yahoo id. How will I know I have a song request. Is there a code for me to put in that makes the request go to.

Like you request a song, will it come to my yahoo im?, e-mail. Please help cuz you have save me from using ODDCAST requester lol which is hard as heck to use or understand lol

xhilaration is offline   Reply With Quote
Old 25th November 2006, 14:14   #12
Arvinja
Junior Member
 
Join Date: Aug 2006
Posts: 11
If you have installed it right you should go to "requested.php" and then you'll see it! I will try to upload a demo later.
Arvinja is offline   Reply With Quote
Old 1st December 2006, 22:58   #13
Diablosblizz
Member
 
Join Date: Mar 2006
Posts: 68
THANK YOU SO MUCH, THIS CODE HELPED ME WITH MY RADIO! THANK YOU SO MUCH ARVINJA!
Diablosblizz is offline   Reply With Quote
Old 2nd December 2006, 12:23   #14
xhilaration
Senior Member
 
xhilaration's Avatar
 
Join Date: Jun 2006
Location: Last time I checked, I was on EARTH lol
Posts: 237
Send a message via Skype™ to xhilaration
I wasn't able to get that script to work unfortunally. BUT I did find one at hotscripts tho and it works great. It shows the songs that were requested on a next page. I have them both in a iframe so they are on the same page and refreshed every 30 sec.

But Arvinja, thank you for the script you gave us tho, you are the best Sorry I wasn't able to get it to work with me

xhilaration is offline   Reply With Quote
Old 9th February 2007, 01:31   #15
Arvinja
Junior Member
 
Join Date: Aug 2006
Posts: 11
Well, no-one has asked me how it works on msn, I have no life, so I'll help you almost 24/7 ^^
MSN: threord@hotmail.com
Arvinja is offline   Reply With Quote
Old 9th February 2007, 10:09   #16
xhilaration
Senior Member
 
xhilaration's Avatar
 
Join Date: Jun 2006
Location: Last time I checked, I was on EARTH lol
Posts: 237
Send a message via Skype™ to xhilaration
Quote:
Originally posted by Arvinja
Well, no-one has asked me how it works on msn, I have no life, so I'll help you almost 24/7 ^^
MSN: threord@hotmail.com

Ya know why noone asked you how it worked on msn, cuz YOU NEVER GAVE US YOUR MSN ID till now.

It would have been good to give that to us like your second post from your first one.

Sorry but if you expect for anyone to ask you a question on msn, ya think to supply your msn id at the begining lol

xhilaration is offline   Reply With Quote
Old 10th March 2007, 23:22   #17
gccommunication
Junior Member
 
Join Date: Mar 2007
Location: Pecatonica, IL
Posts: 2
Send a message via AIM to gccommunication Send a message via Yahoo to gccommunication
your script

I used your script, and I do not know what that other user was talking about..the script is small, simple, clean, and easy. Very usefull, and much appreciated. I am writing a website for an online radio station and this script came in handy! and thank you "henny1" for the pre formatted query lol...anything that contributes to my laziness as a web developer is golden lol. I changed a few things in the script to make it easier to plug in to my site...I seperated the request <form> from request.php and slapped it right into the index page of the site, and poited it to request.php which still contained the rest of the script. I varied your error messages to make it less monotone lol..and I added a target="_blank" parameter to the form so it would open in a new window...since I plugged the form in to the index page, I didnt want the visitor to be navigated away from it on submission. I also password protected requested.php, to be sure only the DJ's had access to the file. Those are just a few hints for the users of your script to consider. Thanks alot for the great work!
gccommunication is offline   Reply With Quote
Old 11th March 2007, 02:24   #18
xhilaration
Senior Member
 
xhilaration's Avatar
 
Join Date: Jun 2006
Location: Last time I checked, I was on EARTH lol
Posts: 237
Send a message via Skype™ to xhilaration
Re: your script

Quote:
Originally posted by gccommunication
I used your script, and I do not know what that other user was talking about..the script is small, simple, clean, and easy. Very usefull, and much appreciated. I am writing a website for an online radio station and this script came in handy! and thank you "henny1" for the pre formatted query lol...anything that contributes to my laziness as a web developer is golden lol. I changed a few things in the script to make it easier to plug in to my site...I seperated the request <form> from request.php and slapped it right into the index page of the site, and poited it to request.php which still contained the rest of the script. I varied your error messages to make it less monotone lol..and I added a target="_blank" parameter to the form so it would open in a new window...since I plugged the form in to the index page, I didnt want the visitor to be navigated away from it on submission. I also password protected requested.php, to be sure only the DJ's had access to the file. Those are just a few hints for the users of your script to consider. Thanks alot for the great work!
gccommunication, buddy, next time read ALL of the post b4 typing what other poster(s) are say. I told her first thank you for the script but some of us were having probs and she never gave us her msn id at first till then. WHOOPIE DOO you got the script to work and have it password protected good for you. K other station will have to think about it OR you can simply post the script of how you made it password protected so other posters (station owners like myself) know how to make it password protected or is that confidental? If its confidently then don't say *I don't know the last poster was saying but uh uh uh.
If you notice on this forum, its get frustating if the poster doesn't supply us an e-mail or whats going on with their station so if you haven't READ all the post on the winamp forum then you might want to think b4 you post (I don't know the other poster was saying but) it makes you look you are sucking up.

xhilaration is offline   Reply With Quote
Old 11th March 2007, 03:33   #19
gccommunication
Junior Member
 
Join Date: Mar 2007
Location: Pecatonica, IL
Posts: 2
Send a message via AIM to gccommunication Send a message via Yahoo to gccommunication
wow lol...I did read them all, and I wasn't refering to any of your postings. take these forums kinda personally dont you bud? lol. easy tiger. wow . that's all I can say
gccommunication is offline   Reply With Quote
Old 12th March 2007, 13:07   #20
xhilaration
Senior Member
 
xhilaration's Avatar
 
Join Date: Jun 2006
Location: Last time I checked, I was on EARTH lol
Posts: 237
Send a message via Skype™ to xhilaration
Quote:
Originally posted by gccommunication
wow lol...I did read them all, and I wasn't refering to any of your postings. take these forums kinda personally dont you bud? lol. easy tiger. wow . that's all I can say
For some reason I doubt you read them all

Further more I don't take anything on this board personally. I don't camp out on this board unlike of you, I have what others call a life is something you need to know more.

So I'm done with you child, make sure you DO read all the posts cuz I highly doubt you did in this thread

pathetic nard

xhilaration is offline   Reply With Quote
Old 12th March 2007, 13:28   #21
sputnik radio
Major Dude
 
sputnik radio's Avatar
 
Join Date: Feb 2006
Location: Dallas
Posts: 871
sputnik radio is offline   Reply With Quote
Old 12th March 2007, 22:19   #22
fc*uk
Moderator
 
fc*uk's Avatar
 
Join Date: Dec 2005
Location: Atlantic Beach
Posts: 8,135
^^^^^ Love it.

Fun with Photoshop, eh?
fc*uk is offline   Reply With Quote
Old 12th March 2007, 23:59   #23
sputnik radio
Major Dude
 
sputnik radio's Avatar
 
Join Date: Feb 2006
Location: Dallas
Posts: 871
actually its a website that generates it for you

http://www.says-it.com/
sputnik radio is offline   Reply With Quote
Old 13th March 2007, 07:17   #24
syazani
Junior Member
 
Join Date: Jun 2006
Posts: 1
Yeah that shoutcast scrip it work 100%
syazani is offline   Reply With Quote
Old 30th April 2007, 07:13   #25
Defcon
Junior Member
 
Join Date: Feb 2007
Location: 127.0.0.1
Posts: 4
Yup! it's works!!! Here is my screenshoot

Defcon is offline   Reply With Quote
Old 30th April 2007, 07:23   #26
Defcon
Junior Member
 
Join Date: Feb 2007
Location: 127.0.0.1
Posts: 4
well, i would like to have more information to appear on that script such as Top10 Requested Songs, Who's Currently as DJ , Song Queue and so on.. can some one help me?
Defcon is offline   Reply With Quote
Old 22nd May 2007, 18:47   #27
Arvinja
Junior Member
 
Join Date: Aug 2006
Posts: 11
Well, there's TONS of stuff that could be changed in my code, actually, it's kind of bad, but it works...
And, thank you henny1, once again, for providing database info
Arvinja is offline   Reply With Quote
Old 14th January 2008, 08:13   #28
itsonlyme2
Junior Member
 
itsonlyme2's Avatar
 
Join Date: Jan 2008
Location: manchester
Posts: 2
Warning: mysql_fetch_assoc(): supplied argument is not a valid MySQL result resource in /home/mancunia/public_html/requested.php on line 24

help i get the above error
itsonlyme2 is offline   Reply With Quote
Old 14th January 2008, 08:52   #29
itsonlyme2
Junior Member
 
itsonlyme2's Avatar
 
Join Date: Jan 2008
Location: manchester
Posts: 2
np got it working thanks
itsonlyme2 is offline   Reply With Quote
Old 14th January 2008, 18:36   #30
bladecris
Junior Member
 
Join Date: Sep 2007
Posts: 4
Send a message via Yahoo to bladecris
Hy guys

Please tell me how do I fix this error:
Warning: mysql_result(): supplied argument is not a valid MySQL result resource in /usr/home/leafpile/public_html/request/request.php on line 34
Thanks a lot.
bladecris is offline   Reply With Quote
Old 9th February 2008, 16:58   #31
mymktp1
Junior Member
 
Join Date: Feb 2008
Posts: 2
Hi I got the script to work perfectly...~!

I have to be honest that I'm pretty clueless on writing php script.... so I was wondering if anyone could help me with this....because I tried doing this but failed doing so...

1. I want to create another field when people make a request called a comment to dj box for example :

Song Title:
Artist:
Name:
COMMENT to dj :


2. I was wondering if anyone could help me to add a TIME STAMP to each request so that when a request is made we would know what time the request was made...


if anyone could me with this it would be greatly appreciatd... plus I think it would make this request system even more complete~!

Thank you in Advance
mymktp1 is offline   Reply With Quote
Old 10th February 2008, 03:18   #32
mymktp1
Junior Member
 
Join Date: Feb 2008
Posts: 2
Can anyone help PLZ~
mymktp1 is offline   Reply With Quote
Old 21st March 2008, 19:06   #33
Arvinja
Junior Member
 
Join Date: Aug 2006
Posts: 11
It has come to my attention that "&nbsp;" is inserted to the code at various places when copying + pasting, just remove them, they're destroying the script.

And also, as I said before, it's an old script don't expect it to work without a little tweaking
Arvinja is offline   Reply With Quote
Old 22nd March 2008, 21:13   #34
Arvinja
Junior Member
 
Join Date: Aug 2006
Posts: 11
Quote:
Originally posted by Arvinja
It has come to my attention that "&nbsp;" is inserted to the code at various places when copying + pasting, just remove them, they're destroying the script.

And also, as I said before, it's an old script don't expect it to work without a little tweaking
I meant:
PHP Code:
&nbsp
, remove them...
Arvinja is offline   Reply With Quote
Old 23rd March 2008, 21:06   #35
RemlapDude
Junior Member
 
Join Date: Apr 2007
Location: England, UK
Posts: 17
why not try http://remlapsoftware.com
RemlapDude is offline   Reply With Quote
Old 25th March 2008, 15:04   #36
autospdf
Junior Member
 
autospdf's Avatar
 
Join Date: May 2006
Location: Greece
Posts: 38
It works perfect for me and thank's.Two questions:1)To delete a request i must go to msql data an delete from there.How can i make the <delete> to work?
2)How can i access more than one request pro ip?
autospdf is offline   Reply With Quote
Old 25th March 2008, 15:54   #37
autospdf
Junior Member
 
autospdf's Avatar
 
Join Date: May 2006
Location: Greece
Posts: 38
o.k. i can make to take more one request!An other question:Where in requested.php code,or somewhere else,to add $refresh = '60'; // How often should it refresh? (seconds)
autospdf is offline   Reply With Quote
Old 25th March 2008, 19:08   #38
scorpious
Junior Member
 
Join Date: Mar 2008
Posts: 3
Hi autospdf

You can try the following to refresh your page:
$refreshrate = "100";

I have this at the top of a php script I use.

Visit
Quote:
http://http://www.phoenixinternetservices.com
Download the Center-Block or Side-Block (which are free)and view the code inside with a text editor.

They have a great block where your listener can choose from a pre-defined stations that you can set.

These blocks work with php-nuke or nuke-evo

Arvinja

Your scripts worked first time nice job, see if I can turn them into a modueles for nuke if that ok.

Cheers Scorpious
scorpious is offline   Reply With Quote
Old 25th March 2008, 21:16   #39
autospdf
Junior Member
 
autospdf's Avatar
 
Join Date: May 2006
Location: Greece
Posts: 38
Thank's for your reply.I find this <html>
<head>
<title>Requested songs</title>

<!--
The "refresh" meta-tag's content identifies the number of
seconds to delay before refreshing the current document.
Notice that the URL tag is not specified, indicating that
the current document will be refreshed.
-->
<meta http-equiv="refresh" content="30">


</head> to refresh the page every 30 sec and works fine!The only is that it doesn't work the delete option so i must return in mysql data and delete the requests.
autospdf is offline   Reply With Quote
Old 26th March 2008, 20:59   #40
Arvinja
Junior Member
 
Join Date: Aug 2006
Posts: 11
Quote:
Originally posted by scorpious
Arvinja

Your scripts worked first time nice job, see if I can turn them into a modueles for nuke if that ok.

Cheers Scorpious
Would be awesome!
Arvinja is offline   Reply With Quote
Reply
Go Back   Winamp & Shoutcast Forums > Shoutcast > Shoutcast Discussions

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump