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>";
?>

Link to comment
Share on other sites

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.

Link to comment
Share on other sites

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.

Link to comment
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • 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.