By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
438,664 Members | 1,669 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 438,664 IT Pros & Developers. It's quick & easy.

PHP Error

P: n/a
Im getting an error:

Error: unterminated string literal
Source File: http://98.214.38.110/allfours/site_flash/2.php
Line: 75, Column: 37
Source Code:
if (_ie == true) document.writeln('

___________________________________
with this code:

<?php
session_start();

return code();

function code() {
$user_id = $_SESSION['myusername'];
$tournament_id = $_SESSION['tournament_id'];
$game_id = $_SESSION['game_id'];
$roomNo = $_SESSION['roomNo'];
$portNo = (($roomNo - 1) * 10) + 5000;

return '

<!-- The following code is specified at the beginning of the <BODY>
tag. -->
<SCRIPT LANGUAGE="JavaScript">
<!--
function closeWindow() {
window.opener = "";
window.close();
}

var _info = navigator.userAgent;
var _ns = false;
var _ie = (_info.indexOf("MSIE") 0 && _info.indexOf("Win") 0
&& _info.indexOf("Windows 3.1") < 0);
//--></SCRIPT>

<COMMENT>
<SCRIPT LANGUAGE="JavaScript1.1">
<!--
function closeWindow() {
window.opener = "";
window.close();
}
var _ns = (navigator.appName.indexOf("Netscape") >= 0
&& ((_info.indexOf("Win") 0 && _info.indexOf("Win16") < 0
&& java.lang.System.getProperty("os.version").indexOf ("3.5") < 0)
|| _info.indexOf("Sun") 0));
//--></SCRIPT></COMMENT>

<!-- The following code is repeated for each APPLET tag -->
<SCRIPT LANGUAGE="JavaScript">
<!--
function closeWindow() {
window.opener = "";
window.close();
}

if (_ie == true) document.write(\'
<OBJECT
classid="clsid:8AD9C840-044E-11D1-B3E9-00805F499D93"
width="500" height="500" align="baseline"

codebase="http://java.sun.com/products/plugin/autodl/
jinstall-1_5_0-windows-i586.cab#Version=1,5,0,0">

<param name = "mayscript" value = "true">
<param name="ARCHIVE"
value="client.jar,activation.jar,smtp.jar,mailapi. jar" >
<PARAM NAME="server" VALUE="98.214.38.110:' . $portNo . '" >
<PARAM NAME="bg-pic" VALUE="res/bgrounds/bg' .
$_SESSION['roomNo'] . '.jpg" >
<PARAM NAME="tournamentId" VALUE="' . $tournament_id . '" >
<PARAM NAME="tournamentGameId" VALUE="' . $game_id . '" >
<PARAM NAME="user" VALUE="' . $user_id . '" >
<NOEMBED><XMP>\');

else if (_ns == true) document.write(\'
<EMBED
type="application/x-java-applet;version=1.5.0" width="100"
height="100"
align="baseline"
code="com.caribbeancardsonline.allfours.client.Roo mClient"
ARCHIVE="client.jar","activation.jar","smtp.jar"," mailapi.jar"
codebase="http://98.214.38.110/allfours/"
server="98.214.38.110:' . $portNo . '" bg-pic="res/bgrounds/bg' .
$roomNo . '.jpg" user= "' . $user_id . '"
tournamentId="' . $tournament_id . '"
tournamentGameId="' . $game_id . '"
pluginspage="http://java.sun.com/products/plugin/autodl/
jinstall-1_5_0-windows-i586.cab#Version=1,5,0,0">
<NOEMBED><XMP>
\');
//--></SCRIPT>

<APPLET code="com.caribbeancardsonline.allfours.client.Roo mClient"
ARCHIVE="client.jar,activation.jar,smtp.jar,mailap i.jar"
codebase="http://98.214.38.110/allfours/" align="baseline"
WIDTH=500 HEIGHT=500>

</XMP>

<param name = "mayscript" value = "true">
<PARAM NAME="java_code"
VALUE="com.caribbeancardsonline.allfours.client.Ro omClient">
<PARAM NAME="java_type" VALUE="application/x-java-
applet;version=1.5.0">
<PARAM NAME="server" VALUE="98.214.38.110:' . $portNo . '">
<PARAM NAME="bg-pic" VALUE="res/bgrounds/bg' . $roomNo . '.jpg">
<PARAM NAME="tournamentId" VALUE="' . $tournament_id . '" >
<PARAM NAME="tournamentGameId" VALUE="' . $game_id . '" >
<PARAM NAME="user" VALUE="' . $user_id . '">
<PARAM name="autostart" value="true">
<PARAM NAME="scriptable" VALUE="true">
No Java 2 SDK, Standard Edition v 1.5 support for APPLET!!
</APPLET></NOEMBED></EMBED></OBJECT>

<!--
<APPLET CODE="com.caribbeancardsonline.allfours.client.Roo mClient"
ARCHIVE="client.jar,activation.jar,smtp.jar,mailap i.jar"
<PARAM NAME="server" VALUE="98.214.38.110:' . $portNo . '">
<PARAM NAME="bg-pic" VALUE="res/bgrounds/bg' . $roomNo . '.jpg">
<PARAM NAME="tournamentId" VALUE="' . $tournament_id . '" />
<PARAM NAME="tournamentGameId" VALUE="' . $game_id . '" />
<PARAM NAME="user" VALUE="' . $user_id . '">
<PARAM name="autostart" value="true">
No Java 2 SDK, Standard Edition v 1.5 support for APPLET!!
</APPLET>
-->
';
}

?>

Sep 16 '08 #1
Share this Question
Share on Google+
7 Replies


P: n/a
It's a bit strange because it seems that you have correctly escaped the ' in
the code
Sep 16 '08 #2

P: n/a
ad****************@gmail.com wrote:
Im getting an error:

Error: unterminated string literal
Source File: http://98.214.38.110/allfours/site_flash/2.php
Line: 75, Column: 37
Source Code:
if (_ie == true) document.writeln('

___________________________________
with this code:
<code snipped>

No problem here with the code you posted. Is this ALL the code in your
file?

--
==================
Remove the "x" from my email address
Jerry Stuckle
JDS Computer Training Corp.
js*******@attglobal.net
==================

Sep 16 '08 #3

P: n/a
ad****************@gmail.com wrote:
Im getting an error:

Error: unterminated string literal
Source File: http://98.214.38.110/allfours/site_flash/2.php
Line: 75, Column: 37
Source Code:
if (_ie == true) document.writeln('
This seems to me like a perfect use for a nowdoc or even a heredoc.

Why bother with escaping when you don't have to?

return <<<'mystring'

'''' single or """" double quote away

mystring;

You may wish to check syntax, I still write a bit of perl when I
should be writing php.

Jeff
>
___________________________________
with this code:

<?php
session_start();

return code();

function code() {
$user_id = $_SESSION['myusername'];
$tournament_id = $_SESSION['tournament_id'];
$game_id = $_SESSION['game_id'];
$roomNo = $_SESSION['roomNo'];
$portNo = (($roomNo - 1) * 10) + 5000;

return '

<!-- The following code is specified at the beginning of the <BODY>
tag. -->
<SCRIPT LANGUAGE="JavaScript">
<!--
function closeWindow() {
window.opener = "";
window.close();
}

var _info = navigator.userAgent;
var _ns = false;
var _ie = (_info.indexOf("MSIE") 0 && _info.indexOf("Win") 0
&& _info.indexOf("Windows 3.1") < 0);
//--></SCRIPT>

<COMMENT>
<SCRIPT LANGUAGE="JavaScript1.1">
<!--
function closeWindow() {
window.opener = "";
window.close();
}
var _ns = (navigator.appName.indexOf("Netscape") >= 0
&& ((_info.indexOf("Win") 0 && _info.indexOf("Win16") < 0
&& java.lang.System.getProperty("os.version").indexOf ("3.5") < 0)
|| _info.indexOf("Sun") 0));
//--></SCRIPT></COMMENT>

<!-- The following code is repeated for each APPLET tag -->
<SCRIPT LANGUAGE="JavaScript">
<!--
function closeWindow() {
window.opener = "";
window.close();
}

if (_ie == true) document.write(\'
<OBJECT
classid="clsid:8AD9C840-044E-11D1-B3E9-00805F499D93"
width="500" height="500" align="baseline"

codebase="http://java.sun.com/products/plugin/autodl/
jinstall-1_5_0-windows-i586.cab#Version=1,5,0,0">

<param name = "mayscript" value = "true">
<param name="ARCHIVE"
value="client.jar,activation.jar,smtp.jar,mailapi. jar" >
<PARAM NAME="server" VALUE="98.214.38.110:' . $portNo . '" >
<PARAM NAME="bg-pic" VALUE="res/bgrounds/bg' .
$_SESSION['roomNo'] . '.jpg" >
<PARAM NAME="tournamentId" VALUE="' . $tournament_id . '" >
<PARAM NAME="tournamentGameId" VALUE="' . $game_id . '" >
<PARAM NAME="user" VALUE="' . $user_id . '" >
<NOEMBED><XMP>\');

else if (_ns == true) document.write(\'
<EMBED
type="application/x-java-applet;version=1.5.0" width="100"
height="100"
align="baseline"
code="com.caribbeancardsonline.allfours.client.Roo mClient"
ARCHIVE="client.jar","activation.jar","smtp.jar"," mailapi.jar"
codebase="http://98.214.38.110/allfours/"
server="98.214.38.110:' . $portNo . '" bg-pic="res/bgrounds/bg' .
$roomNo . '.jpg" user= "' . $user_id . '"
tournamentId="' . $tournament_id . '"
tournamentGameId="' . $game_id . '"
pluginspage="http://java.sun.com/products/plugin/autodl/
jinstall-1_5_0-windows-i586.cab#Version=1,5,0,0">
<NOEMBED><XMP>
\');
//--></SCRIPT>

<APPLET code="com.caribbeancardsonline.allfours.client.Roo mClient"
ARCHIVE="client.jar,activation.jar,smtp.jar,mailap i.jar"
codebase="http://98.214.38.110/allfours/" align="baseline"
WIDTH=500 HEIGHT=500>

</XMP>

<param name = "mayscript" value = "true">
<PARAM NAME="java_code"
VALUE="com.caribbeancardsonline.allfours.client.Ro omClient">
<PARAM NAME="java_type" VALUE="application/x-java-
applet;version=1.5.0">
<PARAM NAME="server" VALUE="98.214.38.110:' . $portNo . '">
<PARAM NAME="bg-pic" VALUE="res/bgrounds/bg' . $roomNo . '.jpg">
<PARAM NAME="tournamentId" VALUE="' . $tournament_id . '" >
<PARAM NAME="tournamentGameId" VALUE="' . $game_id . '" >
<PARAM NAME="user" VALUE="' . $user_id . '">
<PARAM name="autostart" value="true">
<PARAM NAME="scriptable" VALUE="true">
No Java 2 SDK, Standard Edition v 1.5 support for APPLET!!
</APPLET></NOEMBED></EMBED></OBJECT>

<!--
<APPLET CODE="com.caribbeancardsonline.allfours.client.Roo mClient"
ARCHIVE="client.jar,activation.jar,smtp.jar,mailap i.jar"
<PARAM NAME="server" VALUE="98.214.38.110:' . $portNo . '">
<PARAM NAME="bg-pic" VALUE="res/bgrounds/bg' . $roomNo . '.jpg">
<PARAM NAME="tournamentId" VALUE="' . $tournament_id . '" />
<PARAM NAME="tournamentGameId" VALUE="' . $game_id . '" />
<PARAM NAME="user" VALUE="' . $user_id . '">
<PARAM name="autostart" value="true">
No Java 2 SDK, Standard Edition v 1.5 support for APPLET!!
</APPLET>
-->
';
}

?>
Sep 16 '08 #4

P: n/a
ad****************@gmail.com wrote:
Im getting an error:

Error: unterminated string literal
Source File: http://98.214.38.110/allfours/site_flash/2.php
Line: 75, Column: 37
Source Code:
if (_ie == true) document.writeln('

___________________________________
with this code:

<?php
session_start();

return code();

function code() {
$user_id = $_SESSION['myusername'];
$tournament_id = $_SESSION['tournament_id'];
$game_id = $_SESSION['game_id'];
$roomNo = $_SESSION['roomNo'];
$portNo = (($roomNo - 1) * 10) + 5000;

return '

<!-- The following code is specified at the beginning of the <BODY>
tag. -->
<SCRIPT LANGUAGE="JavaScript">
<!--
function closeWindow() {
window.opener = "";
window.close();
}

var _info = navigator.userAgent;
var _ns = false;
var _ie = (_info.indexOf("MSIE") 0 && _info.indexOf("Win") 0
&& _info.indexOf("Windows 3.1") < 0);
//--></SCRIPT>

<COMMENT>
<SCRIPT LANGUAGE="JavaScript1.1">
<!--
function closeWindow() {
window.opener = "";
window.close();
}
var _ns = (navigator.appName.indexOf("Netscape") >= 0
&& ((_info.indexOf("Win") 0 && _info.indexOf("Win16") < 0
&& java.lang.System.getProperty("os.version").indexOf ("3.5") < 0)
|| _info.indexOf("Sun") 0));
//--></SCRIPT></COMMENT>

<!-- The following code is repeated for each APPLET tag -->
<SCRIPT LANGUAGE="JavaScript">
<!--
function closeWindow() {
window.opener = "";
window.close();
}

if (_ie == true) document.write(\'
<OBJECT
classid="clsid:8AD9C840-044E-11D1-B3E9-00805F499D93"
width="500" height="500" align="baseline"

codebase="http://java.sun.com/products/plugin/autodl/
jinstall-1_5_0-windows-i586.cab#Version=1,5,0,0">

<param name = "mayscript" value = "true">
<param name="ARCHIVE"
value="client.jar,activation.jar,smtp.jar,mailapi. jar" >
<PARAM NAME="server" VALUE="98.214.38.110:' . $portNo . '" >
<PARAM NAME="bg-pic" VALUE="res/bgrounds/bg' .
$_SESSION['roomNo'] . '.jpg" >
<PARAM NAME="tournamentId" VALUE="' . $tournament_id . '" >
<PARAM NAME="tournamentGameId" VALUE="' . $game_id . '" >
<PARAM NAME="user" VALUE="' . $user_id . '" >
<NOEMBED><XMP>\');

else if (_ns == true) document.write(\'
<EMBED
type="application/x-java-applet;version=1.5.0" width="100"
height="100"
align="baseline"
code="com.caribbeancardsonline.allfours.client.Roo mClient"
ARCHIVE="client.jar","activation.jar","smtp.jar"," mailapi.jar"
codebase="http://98.214.38.110/allfours/"
server="98.214.38.110:' . $portNo . '" bg-pic="res/bgrounds/bg' .
$roomNo . '.jpg" user= "' . $user_id . '"
tournamentId="' . $tournament_id . '"
tournamentGameId="' . $game_id . '"
pluginspage="http://java.sun.com/products/plugin/autodl/
jinstall-1_5_0-windows-i586.cab#Version=1,5,0,0">
<NOEMBED><XMP>
\');
//--></SCRIPT>

<APPLET code="com.caribbeancardsonline.allfours.client.Roo mClient"
ARCHIVE="client.jar,activation.jar,smtp.jar,mailap i.jar"
codebase="http://98.214.38.110/allfours/" align="baseline"
WIDTH=500 HEIGHT=500>

</XMP>

<param name = "mayscript" value = "true">
<PARAM NAME="java_code"
VALUE="com.caribbeancardsonline.allfours.client.Ro omClient">
<PARAM NAME="java_type" VALUE="application/x-java-
applet;version=1.5.0">
<PARAM NAME="server" VALUE="98.214.38.110:' . $portNo . '">
<PARAM NAME="bg-pic" VALUE="res/bgrounds/bg' . $roomNo . '.jpg">
<PARAM NAME="tournamentId" VALUE="' . $tournament_id . '" >
<PARAM NAME="tournamentGameId" VALUE="' . $game_id . '" >
<PARAM NAME="user" VALUE="' . $user_id . '">
<PARAM name="autostart" value="true">
<PARAM NAME="scriptable" VALUE="true">
No Java 2 SDK, Standard Edition v 1.5 support for APPLET!!
</APPLET></NOEMBED></EMBED></OBJECT>

<!--
<APPLET CODE="com.caribbeancardsonline.allfours.client.Roo mClient"
ARCHIVE="client.jar,activation.jar,smtp.jar,mailap i.jar"
<PARAM NAME="server" VALUE="98.214.38.110:' . $portNo . '">
<PARAM NAME="bg-pic" VALUE="res/bgrounds/bg' . $roomNo . '.jpg">
<PARAM NAME="tournamentId" VALUE="' . $tournament_id . '" />
<PARAM NAME="tournamentGameId" VALUE="' . $game_id . '" />
<PARAM NAME="user" VALUE="' . $user_id . '">
<PARAM name="autostart" value="true">
No Java 2 SDK, Standard Edition v 1.5 support for APPLET!!
</APPLET>
-->
';
}

?>
I have always found it much simpler to do things in little pieces rather
than try to swallow something whole.

I would suggest building a string for what you want to return. That is:

$str = '<!-- The following code is specified at the beginning of the
<BODYtag. -->';
$str .= some_more_stuff
and so on
and then
return $str;

That way what you are writing becomes clearer, much easier to read, and
also you will receive php errors for any line that is not correctly done.
Sep 16 '08 #5

P: n/a
ad****************@gmail.com wrote:
Im getting an error:

Error: unterminated string literal
Source File: http://98.214.38.110/allfours/site_flash/2.php
Line: 75, Column: 37
Source Code:
if (_ie == true) document.writeln('

___________________________________
with this code:

<?php
session_start();

return code();

function code() {
$user_id = $_SESSION['myusername'];
$tournament_id = $_SESSION['tournament_id'];
$game_id = $_SESSION['game_id'];
$roomNo = $_SESSION['roomNo'];
$portNo = (($roomNo - 1) * 10) + 5000;

return '

<!-- The following code is specified at the beginning of the <BODY>
tag. -->
<SCRIPT LANGUAGE="JavaScript">
<!--
function closeWindow() {
window.opener = "";
window.close();
}

var _info = navigator.userAgent;
var _ns = false;
var _ie = (_info.indexOf("MSIE") 0 && _info.indexOf("Win") 0
&& _info.indexOf("Windows 3.1") < 0);
//--></SCRIPT>

<COMMENT>
<SCRIPT LANGUAGE="JavaScript1.1">
<!--
function closeWindow() {
window.opener = "";
window.close();
}
var _ns = (navigator.appName.indexOf("Netscape") >= 0
&& ((_info.indexOf("Win") 0 && _info.indexOf("Win16") < 0
&& java.lang.System.getProperty("os.version").indexOf ("3.5") < 0)
|| _info.indexOf("Sun") 0));
//--></SCRIPT></COMMENT>

<!-- The following code is repeated for each APPLET tag -->
<SCRIPT LANGUAGE="JavaScript">
<!--
function closeWindow() {
window.opener = "";
window.close();
}

if (_ie == true) document.write(\'
<OBJECT
classid="clsid:8AD9C840-044E-11D1-B3E9-00805F499D93"
width="500" height="500" align="baseline"

codebase="http://java.sun.com/products/plugin/autodl/
jinstall-1_5_0-windows-i586.cab#Version=1,5,0,0">

<param name = "mayscript" value = "true">
<param name="ARCHIVE"
value="client.jar,activation.jar,smtp.jar,mailapi. jar" >
<PARAM NAME="server" VALUE="98.214.38.110:' . $portNo . '" >
<PARAM NAME="bg-pic" VALUE="res/bgrounds/bg' .
$_SESSION['roomNo'] . '.jpg" >
<PARAM NAME="tournamentId" VALUE="' . $tournament_id . '" >
<PARAM NAME="tournamentGameId" VALUE="' . $game_id . '" >
<PARAM NAME="user" VALUE="' . $user_id . '" >
<NOEMBED><XMP>\');

else if (_ns == true) document.write(\'
<EMBED
type="application/x-java-applet;version=1.5.0" width="100"
height="100"
align="baseline"
code="com.caribbeancardsonline.allfours.client.Roo mClient"
ARCHIVE="client.jar","activation.jar","smtp.jar"," mailapi.jar"
codebase="http://98.214.38.110/allfours/"
server="98.214.38.110:' . $portNo . '" bg-pic="res/bgrounds/bg' .
$roomNo . '.jpg" user= "' . $user_id . '"
tournamentId="' . $tournament_id . '"
tournamentGameId="' . $game_id . '"
pluginspage="http://java.sun.com/products/plugin/autodl/
jinstall-1_5_0-windows-i586.cab#Version=1,5,0,0">
<NOEMBED><XMP>
\');
//--></SCRIPT>

<APPLET code="com.caribbeancardsonline.allfours.client.Roo mClient"
ARCHIVE="client.jar,activation.jar,smtp.jar,mailap i.jar"
codebase="http://98.214.38.110/allfours/" align="baseline"
WIDTH=500 HEIGHT=500>

</XMP>

<param name = "mayscript" value = "true">
<PARAM NAME="java_code"
VALUE="com.caribbeancardsonline.allfours.client.Ro omClient">
<PARAM NAME="java_type" VALUE="application/x-java-
applet;version=1.5.0">
<PARAM NAME="server" VALUE="98.214.38.110:' . $portNo . '">
<PARAM NAME="bg-pic" VALUE="res/bgrounds/bg' . $roomNo . '.jpg">
<PARAM NAME="tournamentId" VALUE="' . $tournament_id . '" >
<PARAM NAME="tournamentGameId" VALUE="' . $game_id . '" >
<PARAM NAME="user" VALUE="' . $user_id . '">
<PARAM name="autostart" value="true">
<PARAM NAME="scriptable" VALUE="true">
No Java 2 SDK, Standard Edition v 1.5 support for APPLET!!
</APPLET></NOEMBED></EMBED></OBJECT>

<!--
<APPLET CODE="com.caribbeancardsonline.allfours.client.Roo mClient"
ARCHIVE="client.jar,activation.jar,smtp.jar,mailap i.jar"
<PARAM NAME="server" VALUE="98.214.38.110:' . $portNo . '">
<PARAM NAME="bg-pic" VALUE="res/bgrounds/bg' . $roomNo . '.jpg">
<PARAM NAME="tournamentId" VALUE="' . $tournament_id . '" />
<PARAM NAME="tournamentGameId" VALUE="' . $game_id . '" />
<PARAM NAME="user" VALUE="' . $user_id . '">
<PARAM name="autostart" value="true">
No Java 2 SDK, Standard Edition v 1.5 support for APPLET!!
</APPLET>
-->
';
}

?>
Your error is with the JavaScript. It's a syntax error when splitting
document.writeln's argument over multiple lines (not unlike printf in
C). Instead, use

document.writeln('Text text'
+ 'More text'
+ '...');

or multiple calls to document.writeln.

In addition to this, some of your JS is quite outdated, such as use of
the navigator object for browser detection.

Try checking out:

comp.lang.javascript
<URL:http://www.quirksmode.org>

--
Curtis
Sep 16 '08 #6

P: n/a
On Sep 16, 11:35 am, Curtis <dye...@gmail.comwrote:
adrian.bartholo...@gmail.com wrote:
Im getting an error:
Error: unterminated string literal
Source File:http://98.214.38.110/allfours/site_flash/2.php
Line: 75, Column: 37
Source Code:
if (_ie == true) document.writeln('
___________________________________
with this code:
<?php
session_start();
return code();
function code() {
$user_id = $_SESSION['myusername'];
$tournament_id = $_SESSION['tournament_id'];
$game_id = $_SESSION['game_id'];
$roomNo = $_SESSION['roomNo'];
$portNo = (($roomNo - 1) * 10) + 5000;
return '
<!-- The following code is specified at the beginning of the <BODY>
tag. -->
<SCRIPT LANGUAGE="JavaScript">
<!--
function closeWindow() {
window.opener = "";
window.close();
}
var _info = navigator.userAgent;
var _ns = false;
var _ie = (_info.indexOf("MSIE") 0 && _info.indexOf("Win") 0
&& _info.indexOf("Windows 3.1") < 0);
//--></SCRIPT>
<COMMENT>
<SCRIPT LANGUAGE="JavaScript1.1">
<!--
function closeWindow() {
window.opener = "";
window.close();
}
var _ns = (navigator.appName.indexOf("Netscape") >= 0
&& ((_info.indexOf("Win") 0 && _info.indexOf("Win16") < 0
&& java.lang.System.getProperty("os.version").indexOf ("3.5") < 0)
|| _info.indexOf("Sun") 0));
//--></SCRIPT></COMMENT>
<!-- The following code is repeated for each APPLET tag -->
<SCRIPT LANGUAGE="JavaScript">
<!--
function closeWindow() {
window.opener = "";
window.close();
}
if (_ie == true) document.write(\'
<OBJECT
classid="clsid:8AD9C840-044E-11D1-B3E9-00805F499D93"
width="500" height="500" align="baseline"
codebase="http://java.sun.com/products/plugin/autodl/
jinstall-1_5_0-windows-i586.cab#Version=1,5,0,0">
<param name = "mayscript" value = "true">
<param name="ARCHIVE"
value="client.jar,activation.jar,smtp.jar,mailapi. jar" >
<PARAM NAME="server" VALUE="98.214.38.110:' . $portNo . '" >
<PARAM NAME="bg-pic" VALUE="res/bgrounds/bg' .
$_SESSION['roomNo'] . '.jpg" >
<PARAM NAME="tournamentId" VALUE="' . $tournament_id . '" >
<PARAM NAME="tournamentGameId" VALUE="' . $game_id . '" >
<PARAM NAME="user" VALUE="' . $user_id . '" >
<NOEMBED><XMP>\');
else if (_ns == true) document.write(\'
<EMBED
type="application/x-java-applet;version=1.5.0" width="100"
height="100"
align="baseline"
code="com.caribbeancardsonline.allfours.client.Roo mClient"
ARCHIVE="client.jar","activation.jar","smtp.jar"," mailapi.jar"
codebase="http://98.214.38.110/allfours/"
server="98.214.38.110:' . $portNo . '" bg-pic="res/bgrounds/bg' .
$roomNo . '.jpg" user= "' . $user_id . '"
tournamentId="' . $tournament_id . '"
tournamentGameId="' . $game_id . '"
pluginspage="http://java.sun.com/products/plugin/autodl/
jinstall-1_5_0-windows-i586.cab#Version=1,5,0,0">
<NOEMBED><XMP>
\');
//--></SCRIPT>
<APPLET code="com.caribbeancardsonline.allfours.client.Roo mClient"
ARCHIVE="client.jar,activation.jar,smtp.jar,mailap i.jar"
codebase="http://98.214.38.110/allfours/" align="baseline"
WIDTH=500 HEIGHT=500>
</XMP>
<param name = "mayscript" value = "true">
<PARAM NAME="java_code"
VALUE="com.caribbeancardsonline.allfours.client.Ro omClient">
<PARAM NAME="java_type" VALUE="application/x-java-
applet;version=1.5.0">
<PARAM NAME="server" VALUE="98.214.38.110:' . $portNo . '">
<PARAM NAME="bg-pic" VALUE="res/bgrounds/bg' . $roomNo . '.jpg">
<PARAM NAME="tournamentId" VALUE="' . $tournament_id . '" >
<PARAM NAME="tournamentGameId" VALUE="' . $game_id . '" >
<PARAM NAME="user" VALUE="' . $user_id . '">
<PARAM name="autostart" value="true">
<PARAM NAME="scriptable" VALUE="true">
No Java 2 SDK, Standard Edition v 1.5 support for APPLET!!
</APPLET></NOEMBED></EMBED></OBJECT>
<!--
<APPLET CODE="com.caribbeancardsonline.allfours.client.Roo mClient"
ARCHIVE="client.jar,activation.jar,smtp.jar,mailap i.jar"
<PARAM NAME="server" VALUE="98.214.38.110:' . $portNo . '">
<PARAM NAME="bg-pic" VALUE="res/bgrounds/bg' . $roomNo . '.jpg">
<PARAM NAME="tournamentId" VALUE="' . $tournament_id . '" />
<PARAM NAME="tournamentGameId" VALUE="' . $game_id . '" />
<PARAM NAME="user" VALUE="' . $user_id . '">
<PARAM name="autostart" value="true">
No Java 2 SDK, Standard Edition v 1.5 support for APPLET!!
</APPLET>
-->
';
}
?>

Your error is with the JavaScript. It's a syntax error when splitting
document.writeln's argument over multiple lines (not unlike printf in
C). Instead, use

document.writeln('Text text'
+ 'More text'
+ '...');

or multiple calls to document.writeln.

In addition to this, some of your JS is quite outdated, such as use of
the navigator object for browser detection.

Try checking out:

comp.lang.javascript
<URL:http://www.quirksmode.org>

--
Curtis
Thank you so much. It worked!
I used the "+'...') thing.
Have not yet checked out the navigator object workaround but I will.
The quirksome site is awesome and I will have many pleasurable hours
perusing it for my specific task.
Thanks again.
Sep 17 '08 #7

P: n/a
ad****************@gmail.com wrote:
On Sep 16, 11:35 am, Curtis <dye...@gmail.comwrote:
>adrian.bartholo...@gmail.com wrote:
>>Im getting an error:
Error: unterminated string literal
Source File:http://98.214.38.110/allfours/site_flash/2.php
Line: 75, Column: 37
Source Code:
if (_ie == true) document.writeln('
___________________________________
with this code:
[code snipped]
>Your error is with the JavaScript. It's a syntax error when splitting
document.writeln's argument over multiple lines (not unlike printf in
C). Instead, use

document.writeln('Text text'
+ 'More text'
+ '...');

or multiple calls to document.writeln.

In addition to this, some of your JS is quite outdated, such as use of
the navigator object for browser detection.

Try checking out:

comp.lang.javascript
<URL:http://www.quirksmode.org>

--
Curtis

Thank you so much. It worked!
I used the "+'...') thing.
Have not yet checked out the navigator object workaround but I will.
The quirksome site is awesome and I will have many pleasurable hours
perusing it for my specific task.
Thanks again.
Glad it helped, good luck to you.

--
Curtis
Sep 17 '08 #8

This discussion thread is closed

Replies have been disabled for this discussion.