Skip to content

Instantly share code, notes, and snippets.

@hemache
Created December 11, 2012 16:06
Show Gist options
  • Select an option

  • Save hemache/4259741 to your computer and use it in GitHub Desktop.

Select an option

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