DZone Snippets is a public source code repository. Easily build up your personal collection of code snippets, categorize them with tags / keywords, and share them with the world

Snippets has posted 5883 posts at DZone. View Full User Profile

Yubnub "echoshortcut" To Display Text Stored For Alias

11.07.2005
| 3577 views |
  • submit to reddit
        <?php

if (!$link = mysql_connect('', '', '')) {
   echo 'Could not connect to mysql';
   exit;
}

if (!mysql_select_db('yub', $link)) {
   echo 'Could not select database';
   exit;
}
$sendto1 = mysql_query("select email from yubmail where mail_alias = '$path'");
$sendto2 = mysql_result($sendto1, 0);

if (!$sendto2) {
   echo "The alias does not exist! Use the command shortcut to create one.";
exit;
}
echo "$sendto2";
?>
    

Comments

Snippets Manager replied on Mon, 2012/05/07 - 2:16pm

I have changed the last line echo "$sendto2"; to the following one. header("Location: $sendto2"); So instead of displaying the full URL stored for the shortcut, it actually visits the site. This will create the second level of bookmarking hosted on my site instead of wasting yubnub keywords.