# PHP/ JavaSript Problem

**URL:** <https://forum.kirupa.com/t/php-javasript-problem/108718>\
**Category:** Uncategorized\
**Created:** [April 28, 2004, 4:03am UTC](https://forum.kirupa.com/t/php-javasript-problem/108718 "2004-04-28T04:03:58Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![b\_rich](https://avatars.discourse-cdn.com/v4/letter/b/53a042/32.png) [@b\_rich](https://forum.kirupa.com/u/b_rich)\
**Post date:** [April 28, 2004, 4:03am UTC](https://forum.kirupa.com/t/php-javasript-problem/108718/1 "2004-04-28T04:03:58Z")

</div>

hey,

I am making a site in which everything is loaded from a funtions.php file… that way when i change one thing it changes it on the whole site…

anyway everything works fine… i understand when using the echo feature you must change the “” to ‘’ but when i put some javascript in there it doesnt work!!!

please help!

```php
echo "<html xmlns='http://www.w3.org/1999/xhtml' xml:lang='en' lang='en'>
<HEAD>
<script language='JavaScript' type='text/JavaScript'>

<!--
function MM_swapImgRestore() { //v3.0
  var i,x,a=document.MM_sr; for(i=0;a&&i<a.length&&(x=a*)&&x.oSrc;i++) x.src=x.oSrc;
}

function MM_findObj(n, d) { //v4.01
  var p,i,x; if(!d) d=document; if((p=n.indexOf('?'))>0&&parent.frames.length) {
    d=parent.frames[n.substring(p+1)].document; n=n.substring(0,p);}
  if(!(x=d[n])&&d.all) x=d.all[n]; for (i=0;!x&&i<d.forms.length;i++) x=d.forms*[n];
  for(i=0;!x&&d.layers&&i<d.layers.length;i++) x=MM_findObj(n,d.layers*.document);
  if(!x && d.getElementById) x=d.getElementById(n); return x;
}

function MM_swapImage() { //v3.0
  var i,j=0,x,a=MM_swapImage.arguments; document.MM_sr=new Array; for(i=0;i<(a.length-2);i+=3)
   if ((x=MM_findObj(a*))!=null){document.MM_sr[j++]=x; if(!x.oSrc) x.oSrc=x.src; x.src=a[i+2];}
}
//-->
</script>
<title>$title</title>
</head>

```

and i know i am missing the end tags but i didnt want to past the whole code in here… the javascript part is the only thing that doesnt work…

thanks-
