A few weeks ago I started using AngularJs for an application of the typical management style.
My doubt is the following:
I use it with PHP, by using the method
$http.post sent the parameters to a file 'archivo.php' who takes the variables and run a query on MySQL.
I also use
$http.get to receive arrays from another file .php.
Now the question, how do I use a
$http.get in the same function?
Let's say that in php I need to do something like this:
<?php include('conn.php'); $data = json_decode(file_get_contents('php://input')); $variable = $conn->real_escape_string($data->variable); $query = 'INSERT INTO datos VALUES ("'.$variable.'")'; $conn->query($query); print $query; ?>
I need to pass parameters to php, than php I run what I need, and that returns to me something "x" by means of