php

RestFul Web Services with PHP Mysqli

  • Pingback: Working with routes in angular.js and php - TrinityTuts()

  • oswaldo

    I had problems with PUT and GET, for me they were not useful in my work and I decided to modify them and as a result I got this(the first one is with POST and the second one is with GET): <?php
    include 'conexion.php';
    $name = isset($_POST['name'])==true?$_POST['name']:"";
    $email = isset($_POST['email']) ==true?$_POST['email']:"";
    $status = isset($_POST['status'])==true?$_POST['status']:"";

    $sql = "INSERT INTO modelo.usuarios(name,email,status)VALUES ('$name','$email','$status');";

    echo "SALIDA: "." ".$name." ".$email." ".$status."”;

    $qur = mysqli_query($conexion,$sql);

    if($name!=”” && $email!=”” && $status!=””){
    if ($qur) {
    $json = array(“estatus”=>1, “mensaje”=> “Insertado correctamente”);
    header(‘content-type:application/json’);
    echo json_encode($json);
    }

    }
    @mysqli_close($conexion);

    ?>
    $r[‘name’], “email” => $r[’email’], “status” => $r[‘status’]);
    }
    $json = $msg;

    header(‘content-type: application/json’);
    echo json_encode($json);
    }

    @mysqli_close($conn);

    ?>

  • Evelyn Lima

    r = { “name”: “Jatin”, “email”: “[email protected]”, “status”: “active” }

  • sumit kumawat

    $get = json_decode(stripcslashes($_POST[‘r’]));
    in which r is what…is it json object name…..

  • Gagan Verma

    Awesome tutorial..Thank you soo much for such a great tutorial..

  • Adrian Rivera

    Thanks! This seems to answer my question, “Is there a useful web app REST pattern that accommodates angularJS/PHP-MySqli/MySQL?” <-or something like that.

ABOUT
Trinity tuts is one of the best place for beginners to learn android, php, google and web design tutorial and tips. - Maintained by Aneh Thakur
Subscribe to Blog via Email

Join 3,874 other subscribers