Skip to main content
Known Participant
March 17, 2019
質問

trouble with animate cc html5 and php

  • March 17, 2019
  • 返信数 2.
  • 1922 ビュー

I have a code in animate like this:

$.ajax({

     type: "POST",

     url: stage.path + 'php/s1.php',

     data: "Pippo",

     success: function (data) {

          alert(data)

     }

})

and the file php like this:

<?php

     $var=$_POST["var1"];

     echo $var;

?>

The code never show the alert....

    このトピックへの返信は締め切られました。

    返信数 2

    JoãoCésar17023019
    Community Expert
    Community Expert
    March 17, 2019

    Hi.

    Besides jQuery, as kglad suggested, make sure your server has support to PHP.

    As far as I can tell, the default local server that Animate setups for testing doesn't support PHP.

    So you're gonna have to use another local server like XAMPP or an online server with this kind of support.

    Regards,

    JC

    Chicchi9248作成者
    Known Participant
    March 17, 2019

    That code isn't present on my html code...

    But how to learn this?

    I worked only with flash as3...

    And there are no many articles about this

    kglad
    Community Expert
    Community Expert
    March 17, 2019

    are you initializing jquery before your code executes?

    Chicchi9248作成者
    Known Participant
    March 17, 2019

    Excuse but i don't know very well english....

    I have a code...

    But i don't receive the answer of php...

    It's ever in error...

    but the php work well because if I launch that php with some save he execute that...

    the problem is only the answer... the ECHO of PRINT or PRINT_R don't work as I expect

    And I don't know if jquery is initialized..

    kglad
    Community Expert
    Community Expert
    March 17, 2019

    that's the problem:  you're using jquery and you don't understand how to use it.

    open your html file and check that you have something like

    <script src="http://code.jquery.com/jquery-some_version_number.min.js"></script>

    before your animate js is called