Advertisement
vladgen

Untitled

Nov 13th, 2019
126
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.41 KB | None | 0 0
  1. <?
  2. if(empty($_GET['key'])){}
  3. else{
  4. $db= mysql_connect('localhost','root','') or die ('error');
  5. mysql_select_db('new')or die ('error');
  6. $key=htmlspecialchars($_GET['key']);
  7. @$select= mysql_fetch_assoc(mysql_query("SELECT * FROM 'short' WHERE url = '$key' "));
  8. if ($select){
  9. $result=[
  10. 'url'=>$select['url'],
  11. 'key'=>$select['short_key']
  12. ];
  13. header('location:'.$select['url']);
  14. }
  15.  
  16. }
  17.  
  18. ?>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement