Created
February 23, 2012 13:26
-
-
Save brianyang/1892780 to your computer and use it in GitHub Desktop.
indentify name from random string with F3
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
<F3:repeat group="{{@DB->result}}" value="{{@item}}"> | |
<span>{{@item.site}}</span> | |
</F3:repeat> |
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
$main->route('GET /v1/user/@rand', | |
function() { | |
$rand = F3::get('PARAMS["rand"]'); | |
DB::sql("SELECT `site` FROM `hashReg` WHERE `key` = '$rand'"); | |
echo Template::serve('identify-site.html'); | |
} | |
); |
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
-- -------------------------------------------------------- | |
-- | |
-- Table structure for table `hashReg` | |
-- | |
CREATE TABLE IF NOT EXISTS `hashReg` ( | |
`key` varchar(155) NOT NULL, | |
`site` varchar(255) NOT NULL, | |
KEY `key` (`key`) | |
) ENGINE=MyISAM DEFAULT CHARSET=latin1; | |
-- | |
-- Dumping data for table `hashReg` | |
-- | |
INSERT INTO `hashReg` (`key`, `site`) VALUES | |
('ha0okhj5kka', 'sitename.com'); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment