Last active
August 29, 2015 14:01
-
-
Save jorgeguberte/9b982f3d1cade06d8aa8 to your computer and use it in GitHub Desktop.
This file contains hidden or 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 | |
$token_input = $_GET['key'];// Variável que acomoda a key vinda da url. | |
$base_url = 'http://localhost/mrp/'; //URL base do site atual. | |
$outbound_url = ''; //Variável que acomoda a url de destino. | |
if(!$token_input) | |
header('Location: index.php'); | |
switch($token_input){ | |
case 'page': //Mudar esse case e os outros pras chaves certas. | |
$post_url = $base_url.'nome-do-post'; | |
$outbound_url = $post_url.'?key='.$token_input; //colocar de destino url certa, lembre-se de colocar a key no fim. | |
break; | |
case 'page2': | |
$post_url = $base_url.'nome-do-post'; | |
$outbound_url = $post_url.'?key='.$token_input; | |
break; | |
default: | |
$outbound_url = 'index.php'; //Redireciona pra home caso nenhuma chave tenha batido com as chaves pré-definidas. | |
break; | |
} | |
header('Location: '.$outbound_url); | |
?> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment