Last active
October 20, 2015 00:11
-
-
Save indrakaw/0110af62cc7c6e1af29a to your computer and use it in GitHub Desktop.
Convert $_GET array variable to main key.
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 | |
// $_GET to main key. | |
if (!empty($_GET['name'])) header('Location: '. '.?' .$_GET['name']); // rediriction $_GET's array. | |
if (!empty($_GET)) die("Hello, ". key($_GET) ."!"); // print end exit the process. | |
?> | |
<form method="get"><input type="text" name="name" placeholder="Enter your name..." required></form> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment