Forum Moderators: coopster
Opened index.php in Dreamweaver to change some post codes (zip codes), then uploaded same back vif FTP.
Now when I open my site all I get is the following:
Fatal error: Call to undefined function: inserteditorjava() in /home/example/public_html/index.php on line 36
The code:
LINE 36 <?php inserteditorjava();?>
<?php
if($blockid!="newaddition"){
metadescription($blockid);
metakeywords($blockid);
}
?>
</head>
Any help will me much appreciated.
Cheers
Mike
[edited by: encyclo at 1:58 am (utc) on Feb. 11, 2007]
[edit reason] no URLs please, see TOS [webmasterworld.com] [/edit]
Basically you need to have the function called "inserteditorjava" included
It should look something like this....
function inserteditorjava()
{
// this could be anything, we are inside a function.
}
I hope i have made some sence, it's almost 2am =)
Del
How should the code look? What should precede the doe for example?
This is how it should look, correct?
<php inserteditorjava(); >
<php
if($blockid!="newaddition"){
metadescription($blockid);
metakeywords($blockid);
}
>
Even though that is how it now appears, it's still not working and the fatal error message remains. I appreciate any help/advice or assistance.
Mike
function inserteditorjava()
{
// this could be anything.
}
It's called a function.
If you removed any lines of code with the following skeleton then you need to re-instate it, if you have not removed anything then you need to put the actual function you are tryin to use in place.
Where did you get the code that you are using from?
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head>
<title>::::</title>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
<script language="JavaScript" type="text/JavaScript">
<!--
function Resize(ID,heightNumber,widthNumber) {
document.getElementById(ID).height=heightNumber;
document.getElementById(ID).width=widthNumber;
}
function MM_preloadImages() { //v3.0
var d=document; if(d.images){ if(!d.MM_p) d.MM_p=new Array();
var i,j=d.MM_p.length,a=MM_preloadImages.arguments; for(i=0; i<a.length; i++)
if (a[i].indexOf("#")!=0){ d.MM_p[j]=new Image; d.MM_p[j++].src=a[i];}}
}
function MM_swapImgRestore() { //v3.0
var i,x,a=document.MM_sr; for(i=0;a&&i<a.length&&(x=a[i])&&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[i][n];
for(i=0;!x&&d.layers&&i<d.layers.length;i++) x=MM_findObj(n,d.layers[i].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[i]))!=null){document.MM_sr[j++]=x; if(!x.oSrc) x.oSrc=x.src; x.src=a[i+2];}
}
funtion inserteditorjava();
if($blockid!="newaddition"){
metadescription($blockid);
metakeywords($blockid);
}
//-->
</script>
<link href="css/default.css" rel="stylesheet" type="text/css">
</head>
<body leftmargin="0" topmargin="0" marginwidth="0" marginheight="0" onLoad="MM_preloadImages('template_images/dm_over.gif')">
<table width="100%" height="100%" border="0" cellpadding="0" cellspacing="0">
<tr>
<td height="266" valign="top" background="template_images/header_bg_tile.jpg"><table width="100%" height="266" border="0" cellpadding="0" cellspacing="0">
<tr>
<td height="266" align="left" valign="top"> <table width="100%" height="266" border="0" cellpadding="0" cellspacing="0">
<tr>
<td colspan="3" align="left" valign="top"> <img src="template_images/bg1.jpg" width="765" height="266"></td>
<td align="left" valign="top" background="template_images/header_big_bg.jpg"><table width="240" border="0" cellspacing="0" cellpadding="0">
<tr>
<td> </td>
</tr>
</table></td>
<td width="100%" align="left" valign="top"> </td>
</tr>
</table></td>
</tr>
</table> </td>
Ok so the php function inserteditorjava() is inside the javascript tags.
e.g.
<script>
funtion inserteditorjava();
if($blockid!="newaddition"){
metadescription($blockid);
metakeywords($blockid);
}
</script>
Whereas it should be inbetween the PHP tags.
<?php
funtion inserteditorjava();
if($blockid!="newaddition"){
metadescription($blockid);
metakeywords($blockid);
}
?>
You also need to correct the spelling of the word "function", it currently reads "funtion".
Once you do this the function will be defined and the error you are seeing will disappear
Del