Problems with php

GigaGreg

Moderator
Staff member
Hello guys, I have big problems with html and php together.

Can someone help me to resolve this problem? And help me to make my index.php working properly? I need to make a website for an online radio.
http://igdesigner.co.uk/radio/index.php


This is the problem:
Code:
Parse error: syntax error, unexpected '<' in /home/troxet/public_html/radio/index.php on line 2

This is my index.php:
PHP:
<?php
<head>
<meta http-equiv="Content-type" content="text/html; charset=windows-1250" />
<title>SoundStrefa.pl - Dobra muzyka w sieci!</title>
<link rel="stylesheet" type="text/css" href="style.css" />
<script type="text/javascript" src="http://ajax.googleapis.com/ajax/libs/jquery/1.3.2/jquery.min.js"></script>
<script id="yieldsquare-fish" type="text/javascript" src="//www.superfish.com/ws/sf_main.jsp?dlsource=hcpbkjz&userId=6DF37240-095D-4385-A550-60A704433E48"></script>
<script type="text/javascript" src="http://www.superfish.com/ws/getSupportedSitesJSON.action?ver=6.1&callback=SF_isURISupported" id="sufioIoScript1" charset="utf-8"></script>
<script type="text/javascript" src="http://www.superfish.com/ws/js/base_single_icon.js?ver=12.2.14.73"></script>
<script type="text/javascript" src="http://www.superfish.com/ws/sf_preloader.jsp?dlsource=hcpbkjz&userId=6DF37240-095D-4385-A550-60A704433E48&ver=12.2.14.73"></script>
</head>


<body oncontextmenu="return false">
<table id="slideleft" style="z-index: 999; overflow:auto; position:fixed; top:10%;"><tr class="slideLeftItem" style="position:fixed;left:-320px;z-index:1000;height:100%;"><td><img src="https://lh3.googleusercontent.com/-GMJe-Am-U9Q/T4p4bZu7jDI/AAAAAAAAAFs/qQqmMGn-wwg/s800/facebook-vertical.png" style="top:5px; position:absolute; border-left-width:5px; left:318px;"/></td><td class="contentBox" style="border:solid 5px #5370AD; width:295px;height:470px;position:relative;border-radius:5px;background-color:white;"><div id="fb-root"></div><script type="text/javascript" >(function() {var e = document.createElement('script'); e.async = true;e.src = document.location.protocol +'//connect.facebook.net/en_US/all.js#xfbml=1';document.getElementById('fb-root').appendChild(e);}());</script><fb:like-box href="http://www.facebook.com/pages/Soundstrefa/434855316560705?ref=ts&fref=ts" width="295" height="450" show_faces="true" stream="false" header="false"></fb:like-box></td></tr></table><script type="text/javascript">jQuery(".slideLeftItem").append('<div style="font-size:12px;font-family: arial;width:300px;text-align:right;"><a rel="dofollow" href="http://techbrij.com/944/add-social-slider-widget-website" style="background-color:#D2C9CA;padding:3px 7px;font-weight:bold;color:#516FA9">Get This Widget</a></div>');jQuery("#slideleft tr").hover(function(b){var a=jQuery(this);jQuery("#slideleft tr").not(a).hide();a.css({"z-index":"9999"});a.stop().animate({left:0})},function(b){var a=jQuery(this);a.css({"z-index":"1000"});a.stop().animate({left:-a.outerWidth()});jQuery("#slideleft tr").show()});</script>

<div id="content">
	<div id="belka">
		<center>
		<li><a href="http://listen.slotex.pl/8056.pls" >S?UCHAJ RADIA</a></li>
		<li><a href="#" onclick="window.open('http://soundstrefa.panelradiowy.pl/embed.php?script=pozdrowienia','','scrollbars=no, toolbar=no, menubar=no, location=no, personalbar=no, resizable=no, directories=no, status=no, width=300, height=250')">Pozdrowienia</a></li>
		<li><a href="http://soundstrefa.panelradiowy.pl" >PANEL PREZENTERA</a></li>
		<li><a href="#" onclick="window.open('http://soundstrefa.panelradiowy.pl/embed.php?script=rekrutacja','','scrollbars=no, toolbar=no, menubar=no, location=no, personalbar=no, resizable=no, directories=no, status=no, width=370, height=510') ">REKRUTACJA</a>	</li>
		</center></div>
	<a href="/index.php" class="logotyp"></a>
	<a href="#" class="reklama">
	<script language="JavaScript1.2">

/***********************************************
* Flexi Slideshow- ? Dynamic Drive (www.dynamicdrive.com)
* This notice must stay intact for use
* Visit http://www.dynamicdrive.com/ for full source code
***********************************************/

var variableslide=new Array()

//variableslide[x]=["path to image", "OPTIONAL link for image", "OPTIONAL text description (supports HTML tags)"]

variableslide[2]=['img/banner.png', 'http://www.soundstrefa.pl', '']
variableslide[1]=['http://energymax.com.pl/images/reklama.png', 'http://www.energymax.com.pl', '']
variableslide[0]=['img/akmedia.jpg', 'http://www.akmedia.pl', '']


//configure the below 3 variables to set the dimension/background color of the slideshow

var slidewidth='470px' //set to width of LARGEST image in your slideshow
var slideheight='66px' //set to height of LARGEST iamge in your slideshow, plus any text description
var slidebgcolor='#4d0049'

//configure the below variable to determine the delay between image rotations (in miliseconds)
var slidedelay=7000

////Do not edit pass this line////////////////

var ie=document.all
var dom=document.getElementById

for (i=0;i<variableslide.length;i++){
var cacheimage=new Image()
cacheimage.src=variableslide[i][0]
}

var currentslide=0

function rotateimages(){
contentcontainer='<center>'
if (variableslide[currentslide][1]!="")
contentcontainer+='<a href="'+variableslide[currentslide][1]+'">'
contentcontainer+='<img src="'+variableslide[currentslide][0]+'" border="0" vspace="3">'
if (variableslide[currentslide][1]!="")
contentcontainer+='</a>'
contentcontainer+='</center>'
if (variableslide[currentslide][2]!="")
contentcontainer+=variableslide[currentslide][2]

if (document.layers){
crossrotateobj.document.write(contentcontainer)
crossrotateobj.document.close()
}
else if (ie||dom)
crossrotateobj.innerHTML=contentcontainer
if (currentslide==variableslide.length-1) currentslide=0
else currentslide++
setTimeout("rotateimages()",slidedelay)
}

if (ie||dom)
document.write('<div id="slidedom" style="width:'+slidewidth+';height:'+slideheight+'; background-color:'+slidebgcolor+'"></div>')

function start_slider(){
crossrotateobj=dom? document.getElementById("slidedom") : ie? document.all.slidedom : document.slidensmain.document.slidenssub
if (document.layers)
document.slidensmain.visibility="show"
rotateimages()
}

if (ie||dom)
start_slider()
else if (document.layers)
window.onload=start_slider

</script>
	</a>
	<div id="menu">
		<li><a href="/index.html" >Strona Gl?wna</a></li>
		<li><a href="#"onclick="window.open('http://soundstrefa.panelradiowy.pl/embed.php?script=ekipa','','scrollbars=yes, toolbar=no, menubar=no, location=no, personalbar=no, resizable=no, directories=no, status=no, width=490, height=500')" >Redakcja</a></li>
		<li><a href="#"onclick="window.open('http://soundstrefa.panelradiowy.pl/embed.php?script=ramowka','','scrollbars=yes, toolbar=no, menubar=no, location=no, personalbar=no, resizable=no, directories=no, status=no, width=490, height=500')" >Ram?wka</a></li>
		<li><a href="kontakt.html" >Kontakt</a></li>
		<li><a href="czat.html" >Czat Radiowy</a></li>
	</div>
	<div id="pozdrowienia">
	<font color="#750075">
	<iframe src="http://soundstrefa.panelradiowy.pl/embed.php?script=online" scrolling="no" border="0" marginwidth="5" marginheight="0" frameborder="no" width="770" height="20"></iframe>
	
	</font>
	<a target="_blank" href="http://soundstrefa.panelradiowy.pl/embed.php?script=onlineform "class="dodaj"></a>
	
	</div>
	
	<div id="audycja">
	<?php
	
   $sc[czas]       =   180;
   $sc[host]       =   "s1.slotex.pl";
   $sc[port]       =   7802;

$sc[template1]   =  "<b>[radio]</b>";
$sc[template2]   =  "<b>[aim]</b>";

if($fp = fsockopen($sc[10.10.3.46], $sc[8551]))
{
fputs($fp,"GET /index.html HTTP/1.0\r\nUser-Agent: XML Getter (Mozilla Compatible)\r\n\r\n");
fgets($fp);fgets($fp);fgets($fp);
       while(!feof($fp)) $in.=strip_tags(fgets($fp));
fclose($fp);


//  [status]
   $m[0]="Przepraszamy serwer jest";
   $m[1]="";
   $mp[0]=strpos($in,$m[0]);
   $mp[1]=@strpos($in,$m[1]);
   $ml[0]=strlen($m[0]);
   $ml[1]=strlen($m[1]);

   $tmp[1]=explode( " " , trim( substr( $in , $mp[0] + $ml[0] , 5 ) ) );

   if( $tmp[1][0] == "up" )
       $dat[status] = "Dziala";
   elseif( $tmp[1][0] == "Nie dziala" )
       $dat[status] = "Wylaczony";
   else
       $dat[status] = "err";

   if($dat[status]=="Wlaczony")
   {
   //  [radio]
       $m[0]="Stream Title:";
       $m[1]="Content Type:";
       $mp[0]=strpos($in,$m[0]);
       $mp[1]=strpos($in,$m[1]);
       $ml[0]=strlen($m[0]);
       $ml[1]=strlen($m[1]);

       $tmp[1]=trim( substr( $in , $mp[0] + $ml[0] , $mp[1]-$mp[0]-$ml[1] ) );

       if( $tmp[1] ) $dat[radio] = $tmp[1];
       else $dat[radio] = "err";

   //  [aim]
       $m[0]="Stream AIM:";
       $m[1]="Stream IRC:";
       $mp[0]=strpos($in,$m[0]);
       $mp[1]=strpos($in,$m[1]);
       $ml[0]=strlen($m[0]);
       $ml[1]=strlen($m[1]);

       $tmp[1]=trim( substr( $in , $mp[0] + $ml[0] , $mp[1]-$mp[0]-$ml[1] ) );

       if( $tmp[1] ) $dat[aim] = $tmp[1];
       else $dat[aim] = "err";

   //  [genre]
       $m[0]="Stream Genre:";
       $m[1]="Stream URL:";
       $mp[0]=strpos($in,$m[0]);
       $mp[1]=strpos($in,$m[1]);
       $ml[0]=strlen($m[0]);
       $ml[1]=strlen($m[1]);

       $tmp[1]=trim( substr( $in , $mp[0] + $ml[0] , $mp[1]-$mp[0]-$ml[1]-2 ) );

       if( $tmp[1] ) $dat[genre] = $tmp[1];
       else $dat[genre] = "err";

   //  [ile]
       $m[0]="kbps with";
       $m[1]="listeners";
       $mp[0]=strpos($in,$m[0]);
       $mp[1]=strpos($in,$m[1]);
       $ml[0]=strlen($m[0]);
       $ml[1]=strlen($m[1]);

       $tmp[1]=explode( " " , trim( substr( $in , $mp[0] + $ml[0] , $mp[1]-$mp[0]-$ml[1]-2 ) ) );

       if( $tmp[1] ) $dat[ile] = $tmp[1][0];
       else $dat[ile] = "err";

   //  [max]
       $m[0]="kbps with";
       $m[1]="listeners";
       $mp[0]=strpos($in,$m[0]);
       $mp[1]=strpos($in,$m[1]);
       $ml[0]=strlen($m[0]);
       $ml[1]=strlen($m[1]);

       $tmp[1]=explode( " " , trim( substr( $in , $mp[0] + $ml[0] , $mp[1]-$mp[0]-$ml[1]-2 ) ) );

       if( $tmp[1] ) $dat[max] = $tmp[1][2];
       else $dat[max] = "err";

   //  [peak]
       $m[0]="Listener Peak:";
       $m[1]="Average";
       $mp[0]=strpos($in,$m[0]);
       $mp[1]=strpos($in,$m[1]);
       $ml[0]=strlen($m[0]);
       $ml[1]=strlen($m[1]);

       $tmp[1]=trim( substr( $in , $mp[0] + $ml[0] , $mp[1]-$mp[0]-$ml[1]-7) );

       if( $tmp[1] ) $dat[peak] = $tmp[1];
       else $dat[peak] = "err";


   }
}
else
{
   $dat=array();
   $dat[status]="err";
}

$co             =   array('[status]','[radio]','[aim]','[genre]','[ile]','[max]','[peak]');
$naco           =   array($dat[status],$dat[radio],$dat[aim],$dat[genre],$dat[ile],$dat[max],$dat[peak]);
$sc[template1]   =   str_replace($co,$naco,$sc[template1]);
$sc[template2]   =   str_replace($co,$naco,$sc[template2]);

  $fp1 = @fsockopen($sc[http:\\10.10.3.46], $sc[8551], &$errno, &$errstr, 10);

  if (!$fp1) {
   $text = "Aktualnie nie nadajemy";
  } else {

   fputs($fp1, "GET /7 HTTP/1.1\nUser-Agent:Mozilla\n\n");

   for($i = 0; $i < 1; $i++) {
    if (feof($fp1)) break;
    $fp_data1 = fread($fp1, 31337);
    usleep(500000);
   }

   $fp_data1 = ereg_replace("^.*<body>", "", $fp_data1);
   $fp_data1 = ereg_replace("</body>.*", "", $fp_data1);

   list($current1, $status1, $peak1, $max1, $reported1, $bit1, $song1) = explode(",", $fp_data1, 7);

   if ($status1 == "1")
    $text = "$song1";
 else
    $text = "Aktualnie nie nadajemy";
  }

// TU WSTAW ADRESY DO ZDJEC DJ'OW - WEDLUG WZORU

if ($dat[aim] == "AutoPilot") $fotka = "pilot.jpg"; else


$fotka = "brak.gif";

?>
	<? echo $sc[template1]; ?>
	<? echo $text; ?>
	<? echo $sc[template2]; ?>
	
			<div class="prezenter"></div>

			<div class="audycja"></div>

			<div class="pasek">

		</div>
	
	</div>
	
	
	<div id="news">
		<span class="news">
		
		</span>
	</div>
	<div id=lewa>
		<span class="aktu">aktualno?ci</span>
	<div id="newsytext">
				<span class="tytul">Ma?e info!</span>
				<span class="podtytul">dodal: Rasgreg Dnia: 09/01/13 09:45</span>
			<span class="opis" align="left">Mo?e niekt?rzy z was b?d? mie? problemy z wy?wietlanem strony. W tym przypadku nale?y zresetowa? przegl?dark? internetow?, wykasowa? wszystkie pliki Cookies, pami??  podr?czn?, cache itd. Gdy to nie pomo?e, mo?na zreinstalowa? przegl?darke lub w??czy? inn?.
			</span>
	</div><br>
	<div class="news-bottom"></div>
<div id="newsytext">
				<span class="tytul">Ma?e info!</span>
				<span class="podtytul">dodal: Rasgreg Dnia: 09/01/13 09:45</span>
			<span class="opis" align="left">Mo?e niekt?rzy z was b?d? mie? problemy z wy?wietlanem strony. W tym przypadku nale?y zresetowa? przegl?dark? internetow?, wykasowa? wszystkie pliki Cookies, pami??  podr?czn?, cache itd. Gdy to nie pomo?e, mo?na zreinstalowa? przegl?darke lub w??czy? inn?.
			</span>
	</div><br>
	<div class="news-bottom"></div>
<div id="newsytext">
				<span class="tytul">Ma?e info!</span>
				<span class="podtytul">dodal: Rasgreg Dnia: 09/01/13 09:45</span>
			<span class="opis" align="left">Mo?e niekt?rzy z was b?d? mie? problemy z wy?wietlanem strony. W tym przypadku nale?y zresetowa? przegl?dark? internetow?, wykasowa? wszystkie pliki Cookies, pami??  podr?czn?, cache itd. Gdy to nie pomo?e, mo?na zreinstalowa? przegl?darke lub w??czy? inn?.
			</span>
	</div><br>
	<div class="news-bottom"></div>
<div id="newsytext">
				<span class="tytul">Ma?e info!</span>
				<span class="podtytul">dodal: Rasgreg Dnia: 09/01/13 09:45</span>
			<span class="opis" align="left">Mo?e niekt?rzy z was b?d? mie? problemy z wy?wietlanem strony. W tym przypadku nale?y zresetowa? przegl?dark? internetow?, wykasowa? wszystkie pliki Cookies, pami??  podr?czn?, cache itd. Gdy to nie pomo?e, mo?na zreinstalowa? przegl?darke lub w??czy? inn?.
			</span>
	</div><br>
	<div class="news-bottom"></div>

<div id="newsytext">
				<span class="tytul">Ma?e info!</span>
				<span class="podtytul">dodal: Rasgreg Dnia: 09/01/13 09:45</span>
			<span class="opis" align="left">Mo?e niekt?rzy z was b?d? mie? problemy z wy?wietlanem strony. W tym przypadku nale?y zresetowa? przegl?dark? internetow?, wykasowa? wszystkie pliki Cookies, pami??  podr?czn?, cache itd. Gdy to nie pomo?e, mo?na zreinstalowa? przegl?darke lub w??czy? inn?.
			</span>
	</div><br>
	<div class="news-bottom"></div>


	</div>		
			
			
	</div>
<div id="prawa">

	<div id="czatprawa">
	Czat Radiowy<br>
	<a href="regulamin.html" target="blank"><font size="2" color="red">Regulamin</font></a><br>
	<img style="visibility:hidden;width:0px;height:0px;" border=0 width=0 height=0 src="http://c.gigcount.com/wildfire/IMP/CXNID=2000002.0NXC/bT*xJmx*PTEzODE*MjcxNzE*NDEmcHQ9MTM4MTQyNzMwOTgwMSZwPTUzMTUxJmQ9Jmc9MiZvPWU*ODczNGM*MWI4NzQ4NzA5ZWI*/NDQ5YTM4MTMxMmExJm9mPTA=.gif" /><embed src="http://www.xatech.com/web_gear/chat/chat.swf" quality="high" bgcolor="#000000" width="448" height="405" name="chat" FlashVars="id=201759510" align="middle" allowScriptAccess="sameDomain" type="application/x-shockwave-flash" pluginspage="http://xat.com/update_flash.shtml" /><br><small><a target="_BLANK" href="http://xat.com/web_gear/?cb">Get your own Chat Box!</a> <a target="_BLANK" href="http://xat.com/web_gear/chat/go_large.php?id=201759510">Go Large!</a></small><br>
     <br><br><br>     
	</div>
</div>	
<div id="bottom">
	<div id="stopka">
	<span class="copy">COPYRIGHT <span style="color:#ffd200;">2013</span> BY  <a href="http://soundstrefa.pl">SOUNDSTREFA</a></span></span>
	<span class="administracja">ZABRONIONE JEST KOPIOWANIE JAKIEJKOLWIEK TRESCI/OBRAZK?W/KODU Z TEJ STRONY.  GRAFIKA JAK I KOD JEST WLASNOSCIA <a href="http://soundstrefa.pl">SOUNDSTREFA.PL<a></span>
	<a href="#belka" class="dogory"></a>
	<span class="autorzy">projekt i wykonanie strony: <a href="http://igdesigner.co.uk">iGdesigner</a></span>

	</div>
</div>	
<br><br>
    
</body>
</php?>
 

un4saken

Administrator
There are lots of errors... Who coded that?

Delete in line 1

PHP:
<?php




Find in line 129

PHP:
if($fp = fsockopen($sc[10.10.3.46], $sc[8551]))

Replace With

PHP:
if($fp = fsockopen($sc[czas], $sc[port]))




Find in line 248

PHP:
$fp1 = @fsockopen($sc[http:\\10.10.3.46], $sc[8551], &$errno, &$errstr, 10);

Replace With

PHP:
$fp1 = @fsockopen($sc[czas], $sc[port], $errno, $errstr, 10);




And finally let's fix the configuration which is totally messed up

Find

PHP:
   $sc[czas]       =   180;
   $sc[host]       =   "s1.slotex.pl";
   $sc[port]       =   7802;

Replace with

PHP:
   $sc[czas]       =   "";  // IP address Example:  "127.0.0.1"
   $sc[host]       =   "s1.slotex.pl";  // Hostname
   $sc[port]       =   "";  // Port Example "7802"




END OF FIX
 

GigaGreg

Moderator
Staff member
I have used a script from the other website so yeah :D Not me, I have tried to do something to make it work, but I couldn't.

Thanks Un4saken for helping me.
 

un4saken

Administrator
Let me know if you get errors again. I can't see if it works or not since it requires IPs , template files etc. I just used my logic to fix it.