emediastudios Posted April 5, 2008 Share Posted April 5, 2008 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>"; ?> Quote Link to comment https://forums.phpfreaks.com/topic/99683-fatal-error-call-to-undefined-function-htmlspecialchars_decode/ Share on other sites More sharing options...
PFMaBiSmAd Posted April 5, 2008 Share Posted April 5, 2008 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. Quote Link to comment https://forums.phpfreaks.com/topic/99683-fatal-error-call-to-undefined-function-htmlspecialchars_decode/#findComment-509998 Share on other sites More sharing options...
emediastudios Posted April 5, 2008 Author Share Posted April 5, 2008 I should of explained better, its on my home apache server, the only thing i have done recently is a defrag, i havent altered my pc in any way other than this, could my php.ini file got corrupted? Quote Link to comment https://forums.phpfreaks.com/topic/99683-fatal-error-call-to-undefined-function-htmlspecialchars_decode/#findComment-510239 Share on other sites More sharing options...
wildteen88 Posted April 6, 2008 Share Posted April 6, 2008 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. Quote Link to comment https://forums.phpfreaks.com/topic/99683-fatal-error-call-to-undefined-function-htmlspecialchars_decode/#findComment-510631 Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.