url - PHP $_GET request not working -


i'm new php , answer might easy after several search didn't manage fix simple issue.

so i'm trying params url using $_get, here sample code:

<?php  $ee = $_get["search"]; $fp = fopen('results.json', 'w'); fwrite($fp, "ee : [" . $ee . "]"); fclose($fp);  ?>   

the url use following: http://localhost:63342/friend-s-app/sources/home.html?search=test

the json file contains: ee : []

from understood should : ee: [test]

here's code i'm calling (angularjs)

$http.post("../datas/getprojects.php").         success(function() {             $http.get("../datas/results.json")                 .success(function (response) {                     $scope.tiles = response.records;                 });         }); 

any idea on how fix it?

the php code you've provided needs live in file you're accessing url. since that's case, needs "home.php", not "home.html".


Comments

Popular posts from this blog

python - TypeError: start must be a integer -

c# - DevExpress RepositoryItemComboBox BackColor property ignored -

django - Creating multiple model instances in DRF3 -