Created
November 10, 2019 23:55
-
-
Save parzibyte/160ea6828bb4984730321fe4aa201e62 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
include_once "cors.php"; | |
$persona = json_decode(file_get_contents("php://input")); | |
$mensaje = "El nuevo nombre de la persona es: " . $persona->nombre; | |
echo json_encode($mensaje); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
/* | |
Programado por Luis Cabrera Benito | |
____ _____ _ _ _ | |
| _ \ | __ \ (_) | | | | |
| |_) |_ _ | |__) |_ _ _ __ _____| |__ _ _| |_ ___ | |
| _ <| | | | | ___/ _` | '__|_ / | '_ \| | | | __/ _ \ | |
| |_) | |_| | | | | (_| | | / /| | |_) | |_| | || __/ | |
|____/ \__, | |_| \__,_|_| /___|_|_.__/ \__, |\__\___| | |
__/ | __/ | | |
|___/ |___/ | |
Blog: https://parzibyte.me/blog | |
Ayuda: https://parzibyte.me/blog/contrataciones-ayuda/ | |
Contacto: https://parzibyte.me/blog/contacto/ | |
*/ | |
$dominioPermitido = "https://servicio-http-angular.stackblitz.io"; | |
header("Access-Control-Allow-Origin: $dominioPermitido"); | |
header("Access-Control-Allow-Headers: content-type"); | |
header("Access-Control-Allow-Methods: OPTIONS,GET,PUT,POST,DELETE"); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
include_once "cors.php"; | |
$idPersona = $_GET["id"]; | |
$mensaje = "Ok se elimina a la persona con id $idPersona"; | |
echo json_encode($mensaje); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
include_once "cors.php"; | |
$personas = [ | |
[ | |
"nombre"=>"Luis", | |
"edad" => 22 | |
], | |
[ | |
"nombre"=>"Fernando", | |
"edad" => 50 | |
], | |
]; | |
echo json_encode($personas); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
include_once "cors.php"; | |
$persona = json_decode(file_get_contents("php://input")); | |
$mensaje = "El nombre de la persona es: " . $persona->nombre; | |
echo json_encode($mensaje); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment