PDA

Click to See Complete Forum and Search --> : [Resolved]Call to undefined function Help


308holes
Jun 21st, 2008, 02:39 PM
Hello need a little help I keep getting an error "Fatal error: Call to undefined function rating_avg()"

The function is in rating.php

<?php
function rating_avg($id)
{
//sample code
$A = $id;
$B = "rating ";
$C = $A + $B;
return $C;
}
?>


The call page

<?php require('rating.php');//header
echo rating_avg($RPID);
?>

dclamp
Jun 21st, 2008, 07:54 PM
try using include() instead.

308holes
Jun 22nd, 2008, 05:51 PM
Yea tried that too as well still same thing

penagate
Jun 22nd, 2008, 10:34 PM
I cannot see any reason why that code should not work. Can you zip up your files and attach them here?