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

  • submit to reddit

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

if (!mysql_select_db('yub', $link)) {
   echo 'Could not select database';
$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.";
echo "$sendto2";


Snippets Manager replied on Mon, 2012/05/07 - 1: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.