Advertisement
vladgen

Untitled

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