3

I have a jQuery ajax function which queries a php file (carousel.php) and does some stuff with the result. This all works fine on our development server, but on our live server the script seems to fail and returns the content of the PHP file (the raw code). So the PHP isn't even executed. What could be the case here?

        $.ajax({
        url: 'carousel.php',
        dataType: 'json',
        cache: false,
        success: function(result){
            if(result.success){
                if (result.numRows == 0) {
                    $('#insert').css('display','none');
                }
                $('#selectBox').html(result.html);
            } 
        }
    })
7
  • 2
    When you run the file within the broswer, does it execute or it return raw code ? Commented Mar 26, 2012 at 14:56
  • Hmmm... It presents me with the options to open or download the file. Commented Mar 26, 2012 at 15:05
  • Ok so the solution I see is map the .php extension to the PHP file type or check the extension .. is it php3 or something ? Commented Mar 26, 2012 at 15:10
  • Also, try to create a PHP file with an error in it and try to open it in your browser. Also try a different broswer / PC. Commented Mar 26, 2012 at 15:10
  • tutorialdash.com/tutorial/website-development/web-servers/view/… Commented Mar 26, 2012 at 15:18

1 Answer 1

3

You probably use <? tag in your php file and short open tag is not enabled on your server.

Sign up to request clarification or add additional context in comments.

3 Comments

Do people still use it? If that really is the case OP deserves it, but I doubt it (at least I hope not :0 ).
I don't know, that's why I wrote "probably" :)
Thanks, good hint (I'm aware). Nope don't use short open tag here.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.