duplicate function issue problem, please help

Discussion in 'PHP' started by greenworld, Jun 5, 2008.

  1. #1
    Hi ;
    I am having a problem of duplicate function issue, and need help to make it work, I don't know much php, hopfully someone be able to help me out.

    some time ago I got a script from this forum to show rss feed on your page,
    it works fine and no problem at all, here is the link to the script:
    http://forums.digitalpoint.com/showthread.php?t=7354&page=3

    I am working on another web page and got another script on this new page that pulls rss feed based on keywords given, and show them on page, this one also works fine, but i want to have the free script that I got from digital point forum on the very same page also, to get two different results.

    but apparently these two scripts call the "startElement" function and does not work. and when page runs on result shows up, no result from the script that I got from digital point forum show up and give me the following error:


    
    
    Fatal error: Cannot redeclare startelement() (previously declared in /home/aaa/public_html/myfolder/rssfolder/rss.php:5) in http://myweburl/rss/digitalpointrssfile.inc on line 10
    
    Code (markup):
    and here is the the code on line 10:

    
    function startElement($parser, $name, $attrs) {
    
    PHP:
    anyone know how to have them both working?

    thanks
     
    greenworld, Jun 5, 2008 IP
  2. crath

    crath Well-Known Member

    Messages:
    661
    Likes Received:
    33
    Best Answers:
    0
    Trophy Points:
    100
    #2
    why not use a different function name? :p
     
    crath, Jun 5, 2008 IP
  3. EricBruggema

    EricBruggema Well-Known Member

    Messages:
    1,740
    Likes Received:
    28
    Best Answers:
    13
    Trophy Points:
    175
    #3
    or try function_exists?
     
    EricBruggema, Jun 6, 2008 IP
  4. Barti1987

    Barti1987 Well-Known Member

    Messages:
    2,703
    Likes Received:
    115
    Best Answers:
    0
    Trophy Points:
    185
    #4
    Remove duplicate functions.

    Peace,
     
    Barti1987, Jun 6, 2008 IP
  5. Lordo

    Lordo Well-Known Member

    Messages:
    2,082
    Likes Received:
    58
    Best Answers:
    0
    Trophy Points:
    190
    #5
    If they are identical, then remove one and everything will be fine.
    If not, rename one function and then rename it in the calling lines.
     
    Lordo, Jun 6, 2008 IP