Skip to content

Instantly share code, notes, and snippets.

@hemache
Created December 11, 2012 16:04
Show Gist options
  • Save hemache/4259698 to your computer and use it in GitHub Desktop.
Save hemache/4259698 to your computer and use it in GitHub Desktop.
redirect after login
/* page.php?xxxx */
$next = $_SERVER['PHP_SELF'].'?'.$_SERVER['QUERY_STRING'];
printf('<a href="login.php?next=%s">login</a>', $next);
/* login.php */
$next = $_GET['next'];
/* ... */
// حول المتسخدم الى الرابط الذي جاء منه
header('Location: '. $next);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment