Jump to content

Fatal error: Call to undefined function htmlspecialchars_decode()


emediastudios

Recommended Posts

Hi everyone.

This code worked fine and i havent changed it, bu tnow i get this error

 

Fatal error: Call to undefined function htmlspecialchars_decode() in C:\Program Files\Apache Group\Apache2\htdocs\worldgym\penrith\display_resumes.php on line 18

 

Is strange, this is the code, but like i said, it used to work but now it doesnt.

 

<?php
if($secret == "56"){
$q = "SELECT * FROM resume WHERE email <> ''";
$r = mysql_query($q) or die(mysql_error());
$i = " class='td2'";
if(mysql_num_rows($r) > 0)
{
  while($result = mysql_fetch_array($r)){
    $content .= "<left><table width='300px' cellspacing='0' cellpadding='5'>";
     $content .= "<tr><td colspan=2 $i><a href='admin.php?p=delete&email=".$result[email]."'><left>Delete this Application</left></a></td></tr>";
    foreach($result as $key => $value){
     if(!is_int($key)){
      if($key == "file"){ 
       if(file_exists($value) === TRUE){
        $content .=  "<tr><td style='text-transform: capitalize;'".$i.">".$key . ":</td><td".$i."><a href='" . $value ."'>Download Resume</a></td></tr>";
       }
      }
      else if($key == "address" || $key == "history") $content .= "<tr><td colspan=2 style='text-align:left; text-transform: capitalize;'".$i.">".$key."</td></tr><tr><td colspan=2".$i.">".htmlspecialchars_decode($value)."</td></tr>";
      else $content .= "<tr><td style='text-transform: capitalize;'".$i.">".$key . ":</td><td".$i."> " . nl2br($value) ."</td></tr>";
      if($i == " class='td2'") $i = "";
      else $i = " class='td2'";
     }
    }
    $content .= "</table></left><br><br>";
  }
} else $content .= "No one at the moment. <br /><a href=\"admin.php\">Click here to return to admin menu</a>";
} else $content .= "You Must Be Logged In To Do That. <br /><a href=\"admin.php\">Click here to return to admin menu</a>";
?>

Check your php version using a phpinfo() statement. The function should exist in php5.1 or higher (PHP 5 >= 5.1.0).

 

If it was working but is not now, either the php version got changed to a lower version that does not support that function or that function was disabled (or perhaps php was rebuilt without including support for that function.) Perhaps they moved your account to a different server with a lower version of php.

 

In any case, you should probably be asking your hosting company what was changed.

This has nothing to do with your php.ini htmlspecialchars_decode is a core PHP function. There is not an extension/setting in the php.ini to enable in order for PHP to recognise this function. Check that your PHP version is 5.1.0 or greater by running the phpinfo() function in a script. htmlspecialchars_decode() is only available from PHP5.1.0 or greater.

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.