Never been to DZone Snippets before?

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

Yubnub "echoshortcut" to display text stored for alias (See related posts)

<?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 on this post

shantanuo posts on Nov 30, 2006 at 05:21
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.

You need to create an account or log in to post comments to this site.


Click here to browse all 5147 code snippets

Related Posts