Partage
  • Partager sur Facebook
  • Partager sur Twitter

execute php file onpage load

    26 mars 2015 à 0:57:03

    I have a PHP file create_json.php that creates a json file from a table in my database i want my app to load that file in order to recreate the json file every time i start it 

    here is what i tried to do 

    <script language="javascript" type="text/javascript">
    
        window.onload = function(){  
    
               $.ajax({
    
                    type: "GET",
    
                    url: "create_json.php" ,
    
                    success : function() { 
    
                       alert("created");
    
                    }
    
                }).error(function(){
    
                alert('error... ohh no!');
    
              });
    
            }
    
    </script>



    I have no error i get the "created alert but the file is not created and i'm sure that my create_json.php file works it works perfectly when i execute it on a browser it just dont work on my app help please 

    -
    Edité par silverblack37 26 mars 2015 à 14:14:00

    • Partager sur Facebook
    • Partager sur Twitter
      26 mars 2015 à 8:52:23

      Hi,

      You are in the html and css forum. For your question, you can try this php section or the js/ajax one.

      A last thing, please use the "code" button to insert you code in the message. this is this button :  </>

      Have a nice day.

      • Partager sur Facebook
      • Partager sur Twitter

      execute php file onpage load

      × Après avoir cliqué sur "Répondre" vous serez invité à vous connecter pour que votre message soit publié.
      × Attention, ce sujet est très ancien. Le déterrer n'est pas forcément approprié. Nous te conseillons de créer un nouveau sujet pour poser ta question.
      • Editeur
      • Markdown