iUnknown
04-07-2008, 10:36 PM
Hello,
This is part of my PHP code:
<?php
if($port != !$port)
{
$port = $_POST['port'];
$handle = fopen('/home/XXXXXXXXXXX/public_html/players/'. $port .'.asx', "x+");
$line1 = '<ASX version="3.0">'
$line2 = '<title>Radio</title>'
$line3 = '<entry>'
$line4 = ' <title>Radio</title>'
$line5 = ' <author>Tech-Hosts.co.uk</author>'
$line6 = ' <ref href="http://shoutcasts.tech-hosts.com:'. $port .'/"/>'
$line7 = '</entry>'
$line8 = '</ASX>'
fwrite($handle, $line1."\n")
fwrite($handle, $line2."\n")
fwrite($handle, $line3."\n")
fwrite($handle, $line4."\n")
fwrite($handle, $line5."\n")
fwrite($handle, $line6."\n")
fwrite($handle, $line7."\n")
fwrite($handle, $line8."\n")
fclose($handle);
I get this error when simply opening the document ($port is nothing/not defined).
Parse error: syntax error, unexpected T_VARIABLE in /home/XXXXXXXX/public_html/playercode.php on line 45
Line 45 is:
$line2 = '<title>Radio</title>'
I'm not very good at PHP, I just pick things up as I go along and I've never spent time learning it. I'm trying to code a simple PHP script so I knew I'd need some real help along the way.
+rep to the first person to give a correct solution.
Thanks.
This is part of my PHP code:
<?php
if($port != !$port)
{
$port = $_POST['port'];
$handle = fopen('/home/XXXXXXXXXXX/public_html/players/'. $port .'.asx', "x+");
$line1 = '<ASX version="3.0">'
$line2 = '<title>Radio</title>'
$line3 = '<entry>'
$line4 = ' <title>Radio</title>'
$line5 = ' <author>Tech-Hosts.co.uk</author>'
$line6 = ' <ref href="http://shoutcasts.tech-hosts.com:'. $port .'/"/>'
$line7 = '</entry>'
$line8 = '</ASX>'
fwrite($handle, $line1."\n")
fwrite($handle, $line2."\n")
fwrite($handle, $line3."\n")
fwrite($handle, $line4."\n")
fwrite($handle, $line5."\n")
fwrite($handle, $line6."\n")
fwrite($handle, $line7."\n")
fwrite($handle, $line8."\n")
fclose($handle);
I get this error when simply opening the document ($port is nothing/not defined).
Parse error: syntax error, unexpected T_VARIABLE in /home/XXXXXXXX/public_html/playercode.php on line 45
Line 45 is:
$line2 = '<title>Radio</title>'
I'm not very good at PHP, I just pick things up as I go along and I've never spent time learning it. I'm trying to code a simple PHP script so I knew I'd need some real help along the way.
+rep to the first person to give a correct solution.
Thanks.