1. Advertising
    y u no do it?

    Advertising (learn more)

    Advertise virtually anything here, with CPM banner ads, CPM email ads and CPC contextual links. You can target relevant areas of the site and show ads based on geographical location of the user if you wish.

    Starts at just $1 per CPM or $0.10 per CPC.

ERROR : Call to undefined function: htmlspecialchars_decode()

Discussion in 'PHP' started by shawnecstacy, Dec 14, 2007.

  1. #1
    Hi i just recently uploaded the Boonex Barracuda website directory to my Hostgator server. When i was creating the category , after filling up the form when i clicked submit , i got this error . Please help me out the problem.

    FULL ERROR
    Fatal error: Call to undefined function: htmlspecialchars_decode() in /home/lazybomb/public_html/utils/cat_add.php on line 42



    Server details :

    Operating system Linux
    Machine Type i686
    Apache version 1.3.39 (Unix)
    PERL version 5.8.8
    PHP version 4.4.4
    MySQL version 4.1.22-standard


    cat_add.php

    function categories_add()
    {
    global $gQueries, $gStatistics, $gParams, $gErrors;
    $rec_arr = array();
    $dir_cat = array();

    for(reset($_POST); list($key, $value) = each($_POST);)
    {
    if(preg_match("/_add_cat_title/i", $key))
    {
    $dir_cat = array();
    $dir_cat[0] = get_param('dir');
    $dir_cat[1] = get_param('cat');
    if(count($dir_cat))
    {
    $params['id_dir'] = $gQueries->get_new_id('las_categories', 'id_dir');
    $params['dir'] = $dir_cat[0];
    $params['parent'] = $dir_cat[1];
    $params['path'] = get_cat_path_by_id($params['parent'], $params['dir'], true);
    //need to correct
    $params['title'] = strip_tags(htmlspecialchars_decode($value)); ERROR IN THIS LINE
    $params['meta'] = htmlspecialchars(htmlspecialchars_decode($_POST['_add_cat_meta']));

    $usr_id = get_user_id();
    $params['owner'] = $usr_id ? $usr_id : 0;
    $params['status'] = is_admin() ? 1 : 2;

    //need to correct
    $params['descr'] = htmlspecialchars(htmlspecialchars_decode($_POST['_add_cat_descr']));
    escape_arr($params);
    if(trim($params['title']) == '')
    $gErrors->addError('error','title_not_specified');



    .....
    .....
    .....

    ....

    Remaining Code
    ?>
     
    shawnecstacy, Dec 14, 2007 IP
  2. Gawk

    Gawk Peon

    Messages:
    427
    Likes Received:
    36
    Best Answers:
    0
    Trophy Points:
    0
    #2
    That function is for PHP5+, you have PHP4.4.4
     
    Gawk, Dec 14, 2007 IP
  3. sunnyverma1984

    sunnyverma1984 Well-Known Member

    Messages:
    342
    Likes Received:
    7
    Best Answers:
    0
    Trophy Points:
    120
    #3
    use html_entity_decode() function it works on php 4
     
    sunnyverma1984, Dec 14, 2007 IP
    shawnecstacy likes this.
  4. shawnecstacy

    shawnecstacy Peon

    Messages:
    456
    Likes Received:
    2
    Best Answers:
    0
    Trophy Points:
    0
    #4
    thanks Gawk and Sunny ..
    despite of being such a big company hostgator is providing such a cheap technology..
    ok i will now try html_entity_decode()

    thanks
     
    shawnecstacy, Dec 14, 2007 IP
  5. config_error

    config_error Well-Known Member

    Messages:
    1,719
    Likes Received:
    18
    Best Answers:
    0
    Trophy Points:
    130
    #5
    thanks for the post..wow...i eneded up here.. thanks..
     
    config_error, Nov 5, 2008 IP