PHP include causing problems

Discussion in 'PHP' started by imwebdev, Nov 19, 2008.

  1. #1
    Hi Everyone,
    I seem to have a problem with a PHP include file in a form I have created.

    I have a form that is using Ajax. When a user enters a Zip Code, it is supposed to trigger an Onblur update City and State code. The code works fine, But now I would like to create a template around this code.
    So I had to use a PHP Include ( <?php require("XXXX.html"); ?> ). The problem is, as soon as I add this line, the Ajax stops working!
    When I remove nothing else but this PHP include line, it works again!

    Can someone please tell me if there is any issues with using the PHP include with Ajax code?

    I can include the snippet of code if necessary.

    Thanks
     
    imwebdev, Nov 19, 2008 IP
  2. imwebdev

    imwebdev Peon

    Messages:
    65
    Likes Received:
    2
    Best Answers:
    0
    Trophy Points:
    0
    #2
    Hi I have found the cause, but not a solution.

    I am trying to make a PHP includes call to a file that contains the code needed for a site called Sitepal. It places a video on my site, using a Java script.

    Would there be any reason my Ajax code wouldnt work with this sitepal java script code?
    Thanks
     
    imwebdev, Nov 19, 2008 IP
  3. EricBruggema

    EricBruggema Well-Known Member

    Messages:
    1,740
    Likes Received:
    28
    Best Answers:
    13
    Trophy Points:
    175
    #3
    Give more scripting codes, maby add this script above the ajax requests? or after?
     
    EricBruggema, Nov 19, 2008 IP
  4. ads2help

    ads2help Peon

    Messages:
    2,142
    Likes Received:
    67
    Best Answers:
    1
    Trophy Points:
    0
    #4
    One of the reason is:

    The included file contains javascript too and the javascript function's name or variable name is the same as the another ajax function you used.

    Try viewing the Tools > Error Console of your browser and see whats the error
     
    ads2help, Nov 19, 2008 IP
  5. AdultProfiles

    AdultProfiles Peon

    Messages:
    54
    Likes Received:
    0
    Best Answers:
    0
    Trophy Points:
    0
    #5
    Can you paste some code? It will be more easier for all of us to see if there's an error into your code
     
    AdultProfiles, Nov 20, 2008 IP