Host generated code
Posted: Thu Oct 30, 2003 1:22 pm
I have auto generated an XML document from text entered in a HTML form's textarea using PHP4. (by using regular expressions to specify the tags). I then have another script that parse the saved XML into an array ....
the structure of the XML is like this.
The problem now is that my free host Lycos is automatically appending some javascript to the end of the XML like this
Thereby voiding it as an XML document.
How can i tackle this problem?
the structure of the XML is like this.
Code: Select all
<?xml version="1.0" encoding="UTF-8"?>
<questions>
<item>
<questionId>1a</questionId>
<question>How many days in a leap year?</question>
<choice>336</choice>
<choice>356</choice>
<choice>365</choice>
<choice>400</choice>
<answer>B</answer>
</item>
<item>
<questionId>2a</questionId>
<question>How many inches in a foot?</question>
<choice>11</choice>
<choice>12</choice>
<choice>13</choice>
<choice>30</choice>
<answer>B</answer>
</item>
</questions>Code: Select all
<?xml version="1.0" encoding="UTF-8"?>
<questions>
<item>
<questionId>1a</questionId>
<question>How many days in a leap year?</question>
<choice>336</choice>
<choice>356</choice>
<choice>365</choice>
<choice>400</choice>
<answer>B</answer>
</item>
<item>
<questionId>2a</questionId>
<question>How many inches in a foot?</question>
<choice>11</choice>
<choice>12</choice>
<choice>13</choice>
<choice>30</choice>
<answer>B</answer>
</item>
</questions>
</pre></xmp></noscript>
<!-- START RedMeasure V4 - Java v1.1 $Revision: 1.9 $ -->
<!-- COPYRIGHT 2000 Red Sheriff Limited -->
<script language="JavaScript"><!--
var pCid="uk_lycos-uk_0";
var w0=1;
var refR=escape(document.referrer);
if (refR.length>=252) refR=refR.substring(0,252)+"...";
//--></script>
<script language="JavaScript1.1"><!--
var w0=0;
//--></script>
<script language="JavaScript1.1" src="http://lycos-eu.imrworldwide.com/a1.js">
</script>
<script language="JavaScript"><!--
if(w0){
var imgN='<img src="http://lycos-eu.imrworldwide.com/cgi-bin/count?ref='+
refR+'&cid='+pCid+'" width=1 height=1>';
if(navigator.userAgent.indexOf('Mac')!=-1){document.write(imgN);
}else{
document.write('<applet code="Measure.class" '+
'codebase="http://lycos-eu.imrworldwide.com/"'+'width=1 height=2>'+
'<param name="ref" value="'+refR+'">'+'<param name="cid" value="'+pCid+
'"><textflow>'+imgN+'</textflow></applet>');
}
}
document.write("<COMMENT>");
//-->
</script>
<noscript>
<img src="http://lycos-eu.imrworldwide.com/cgi-bin/count?cid=uk_lycos-uk_0" width=1 height=1>
</noscript>
</COMMENT>
<!-- END RedMeasure V4 -->
<script language="javascript" src="http://ads.tripod.lycos.co.uk/ad/test_frame_size.js"></script>
<script language="javascript">
if (!AD_clientWindowSize()) {
document.write("<NOSC"+"RIPT>");
}
</script>
<script type="text/javascript">
function setCookie(name, value, expires, path, domain, secure) {
var curCookie = name + "=" + escape(value) +
((expires) ? "; expires=" + expires.toGMTString() : "") +
((path) ? "; path=" + path : "") +
((domain) ? "; domain=" + domain : "") +
((secure) ? "; secure" : "");
document.cookie = curCookie;
}
var ad_url = "http://ads.tripod.lycos.co.uk/ad/google/frame.php?_url="+escape(self.location);
var ref=window.document.referrer;
if(parent.LycosAdFrame) {
if(parent.memberPage && parent.memberPage.document.title ) {
parent.document.title=parent.memberPage.document.title;
}
if(parent.LycosAdFrame && parent.LycosAdFrame.location && (ref != "" && (ref+"?" != window.location) && (ref.substr(ref.length-1,1) != "/")) ) {
//parent.LycosAdFrame.location.href=ad_url;
parent.LycosAdFrame.location.replace(ad_url);
}
setCookie("adFrameForcePHP",0,0," ");
parent.document.body.cols = "*,140";
}
else if(top.LycosAdFrame && top.LycosAdFrame.location) {
if ((ref != "" && (ref+"?" != top.window.location) && (ref.substr(ref.length-1,1) != "?"))) {
//top.LycosAdFrame.location.href=ad_url;
top.LycosAdFrame.location.replace(ad_url);
}
setCookie("adFrameForcePHP",0,0," ");
top.document.body.cols = "*,140";
}
else {
if (!window.opener) {
setCookie("adFrameForcePHP",1,0," ");
}
else {
setCookie("adFrameForcePHP",0,0," ");
}
}
</script>
<script type="text/javascript" src="http://ads.tripod.lycos.co.uk/ad/ad.php?cat=noref&mkw=&CC=uk&ord=3fa15aec&adpref="></script>How can i tackle this problem?