Skip to content

Instantly share code, notes, and snippets.

@bytefade
Created January 31, 2015 14:21
Show Gist options
  • Save bytefade/ab5952af40b387c40b8b to your computer and use it in GitHub Desktop.
Save bytefade/ab5952af40b387c40b8b to your computer and use it in GitHub Desktop.
Mensagem de sucesso com session
<?php
session_start();
//The second parameter on print_r returns the result to a variable rather than displaying it
$RequestSignature = md5($_SERVER['REQUEST_URI'].$_SERVER['QUERY_STRING'].print_r($_POST, true));
if ($_SESSION['LastRequest'] == $RequestSignature)
{
echo 'This is a refresh.';
}
else
{
echo 'This is a new request.';
$_SESSION['LastRequest'] = $RequestSignature;
// echo '<div class="success">'.$_SESSION['msg_status'].'</div>';
}
?>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment