PDA

View Full Version : Auto Dj



HabboListenFM
20-01-2010, 10:12 AM
I am getting the following error message when trying to add php code to my site, can anyone help?

"Parse error: syntax error, unexpected T_VARIABLE in /home/habboli1/public_html/housekeepingguy/staff/autodj.php on line 12"

The following is the php code:

<html>
<head>
<title>Check and modify auto DJ</title>
</head>
<body>
Current Status:
<?php
$adminpassword = "xxxxxxxx"; // modify to your SHOUTcast server admin
password
$shoutcastport = "xxxx"; // modify to your SHOUTcast server port
$nameoffile = "autodj.php (http://habbolistenfm.com/housekeepingguy/staff/autodj.php)" //
modify to the name of the file you put this in
$checkstatus =
file_get_contents("http://shoutcasts.tech-hosts.com/castcontrol/control.php?action
=status&portbase=" . $shoutcastport . "&adminpassword=" . $adminpassword . "");
if($checkstatus == "AutoDJ is online.") { echo "<font
color='green'>Online!</font>"; }
else { echo "<font color='red'>Offline!</font>"; }
?><br>
<br>
<?php
$action = $_GET['action'];
if(!isset($action)) { ?>
Please use the links below to control the Auto DJ:<br><br>
<center>
<a href="" . $nameoffile . "?action=start">Start Auto DJ</a>
<br>
<br>
<a href="" . $nameoffile . "?action=stop">Stop Auto DJ</a>
</center>
<?php } elseif($action == "start")
{
$start =
file_get_contents("http://shoutcasts.tech-hosts.com/castcontrol/control.php?action
=start&portbase=" . $shoutcastport . "&adminpassword=" . $adminpassword . "");
echo "<b>" . $start . "</b>";
}
else {
$stop =
file_get_contents("http://shoutcasts.tech-hosts.com/castcontrol/control.php?action
=stop&portbase=" . $shoutcastport . "&adminpassword=" . $adminpassword . "");
echo "<b>" . $stop . "</b>";
}
?>
</body>
</html>

I have noticed that there are quotation marks inside quotation marks which as i understand would mess the whole thing up but i didnt write this code but i do need help to fix it. Thanks for anyones help

Moved by Tomm (Forum Moderator): From Forum Designing.

Scriptermone
20-01-2010, 10:44 AM
I think you should change all the F's to Z's then that should help your problem.

Randomme
20-01-2010, 12:07 PM
we are currently having that problem also at checkhabbo DJ Panel radio stats. However i dunno the php code :) im just a head dj :)

HabboListenFM
20-01-2010, 01:40 PM
I think you should change all the F's to Z's then that should help your problem.

Im not sure what you mean, If you mean change literally every F to a Z i dont think that would help. In fact knowing my luck it would probebly mess it up even more :rolleyes_ Thank you both for your help though and i hope i can get it sorted.

Randomme
20-01-2010, 02:36 PM
I am GUESSING there is something wrong with
<br>
<br> section of the code maybe only one is ment to be there. or the last one be like <br/>

Maybe change it to Ask the Habbox Staff? hope i atleast helped a little

EDIT - I know habboemotion is auto DJ you could contact one of their owners (:
hope i helped

HabboListenFM
20-01-2010, 02:44 PM
I am GUESSING there is something wrong with
<br>
<br> section of the code maybe only one is ment to be there. or the last one be like <br/>

Maybe change it to Ask the Habbox Staff? hope i atleast helped a little

EDIT - I know habboemotion is auto DJ you could contact one of their owners (:
hope i helped

Thanks for all the help but i dont think its to do with the line breaks cus obviously it would just move the texts down to the next line and habboemotion are streaming from defjay.com (I used to steam from them on my site too lol) But again thanks a lot for your help :)

Blob
20-01-2010, 06:58 PM
<html>
<head>
<title>Check and modify auto DJ</title>
</head>
<body>
Current Status:
<?php
$adminpassword = "xxxxxxxx"; // modify to your SHOUTcast server admin
password
$shoutcastport = "xxxx"; // modify to your SHOUTcast server port
$nameoffile = "autodj.php"; //
modify to the name of the file you put this in
$checkstatus =
file_get_contents("http://shoutcasts.tech-hosts.com/cas...rol.php?action
=status&portbase=" . $shoutcastport . "&adminpassword=" . $adminpassword . "");
if($checkstatus == "AutoDJ is online.") { echo "<font
color='green'>Online!</font>"; }
else { echo "<font color='red'>Offline!</font>"; }
?><br>
<br>
<?php
$action = $_GET['action'];
if(!isset($action)) { ?>
Please use the links below to control the Auto DJ:<br><br>
<center>
<a href="" . $nameoffile . "?action=start">Start Auto DJ</a>
<br>
<br>
<a href="" . $nameoffile . "?action=stop">Stop Auto DJ</a>
</center>
<?php } elseif($action == "start")
{
$start =
file_get_contents("http://shoutcasts.tech-hosts.com/cas...rol.php?action
=start&portbase=" . $shoutcastport . "&adminpassword=" . $adminpassword . "");
echo "<b>" . $start . "</b>";
}
else {
$stop =
file_get_contents("http://shoutcasts.tech-hosts.com/cas...rol.php?action
=stop&portbase=" . $shoutcastport . "&adminpassword=" . $adminpassword . "");
echo "<b>" . $stop . "</b>";
}
?>
</body>
</html>

Edit; after trying to clear this code up to a working state, there is no file at "http://shoutcasts.tech-hosts.com/cas...rol.php" so it won't work. Give me the right file and I'll clear up the code.

Randomme
20-01-2010, 07:00 PM
It mentioned something about line 12 (I AM NO EXPERT) but the below is line 12 lol. maybe HabboListen is ment to be in there? :S



''modify to the name of the file you put this in''

HabboListenFM
20-01-2010, 07:18 PM
Sorry I dont know why it put the ... where the rest of that file name should be. This is the correct script. Thank you everyone for you help.



<html>
<head>
<title>Check and modify auto DJ</title>
</head>
<body>
Current Status:
<?php
$adminpassword = "plr6a1w2"; // modify to your SHOUTcast server admin
password
$shoutcastport = "9046"; // modify to your SHOUTcast server port
$nameoffile = "http://habbolistenfm.com/housekeepingguy/staff/autodj.php" //
modify to the name of the file you put this in
$checkstatus =
file_get_contents("http://shoutcasts.tech-hosts.com/castcontrol/control.php?action
=status&portbase=" . $shoutcastport . "&adminpassword=" . $adminpassword . "");
if($checkstatus == "AutoDJ is online.") { echo "<font
color='green'>Online!</font>"; }
else { echo "<font color='red'>Offline!</font>"; }
?><br>
<br>
<?php
$action = $_GET['action'];
if(!isset($action)) { ?>
Please use the links below to control the Auto DJ:<br><br>
<center>
<a href="" . $nameoffile . "?action=start">Start Auto DJ</a>
<br>
<br>
<a href="" . $nameoffile . "?action=stop">Stop Auto DJ</a>
</center>
<?php } elseif($action == "start")
{
$start =
file_get_contents("http://shoutcasts.tech-hosts.com/castcontrol/control.php?action
=start&portbase=" . $shoutcastport . "&adminpassword=" . $adminpassword . "");
echo "<b>" . $start . "</b>";
}
else {
$stop =
file_get_contents("http://shoutcasts.tech-hosts.com/castcontrol/control.php?action
=stop&portbase=" . $shoutcastport . "&adminpassword=" . $adminpassword . "");
echo "<b>" . $stop . "</b>";
}
?>
</body>
</html>

Jxhn
20-01-2010, 08:29 PM
the comments need to be on the same lines as the //s

Scriptermone
21-01-2010, 11:54 AM
Im not sure what you mean, If you mean change literally every F to a Z i dont think that would help. In fact knowing my luck it would probebly mess it up even more :rolleyes_ Thank you both for your help though and i hope i can get it sorted.

Oh wait, I think I found the problem, you don't change the F's to Z's, you change the R's to Z's I realised this last night, I was trying to figure out the Da Vinci Code.

Hope this helps, I really really do.

PS: Good luck.

HabboListenFM
26-01-2010, 03:00 PM
unfortuanatly that didnt work either -.-' i guess the whole script is messed up. Thank you everyone for helping though. :)

Want to hide these adverts? Register an account for free!