143 posts
  • Has referred 1+ members
  • Has sold $100+ on Envato Market
  • Has collected 100+ items on Envato Market
  • Has been part of the Envato Community for over 5 years
+3 more
vanRijswijk says

Hello everybody,

I am currently working on an API system for a short url service, at this moment iam working on the QRcode section. Now heres my question:

If you look at bit.ly the have the following url for there qrcode.

http://bit.ly/#HASH_CODE#.qrcode

How do i filter .qrcode out of a url, i have searched many sites but could not find a solution.

Hope someone can help me with this. :)

296 posts
  • Has referred 1+ members
  • Has sold $10,000+ on Envato Market
  • Has collected 50+ items on Envato Market
  • Made it to the Authors' Hall of Fame
+3 more
CodeFusion says

Im not sure I understand you very well.

If you want to drop the qrcode
$original = "http://bit.ly/4nXvaN.qrcode";
echo '<a href="'.$original.'">'.$original.'</a><br />';

$new = str_replace(".qrcode","",$original);
echo '<a href="'.$new.'">'.$new.'</a><br />';

If you are wanting to get just the qrcode, it is not hidden in the url they give you. It is more likely in the database along side the original url. The ”.qrcode” attachment is most likely a trigger object.

I can imagine that they probably have a small script that reads the url, if .qrcode is present, then they return the qrcode instead of redirecting you to the original website.

Google offers a free qrcode service

http://code.google.com/apis/chart/docs/gallery/qr_codes.html

$your_link = "http://www.fremonttech.com";
echo '<a href="http://chart.apis.google.com/chart?chs=200x200&cht=qr&chl='.urlencode($your_link).'&choe=UTF-8">QR Code</a><br />';
echo '<img src="http://chart.apis.google.com/chart?chs=200x200&cht=qr&chl='.urlencode($your_link).'&choe=UTF-8" /><br />';
BTW , you can alter the size of the qrcode from bit.ly as well
http://bit.ly/4nXvaN.qrcode?s=800
143 posts
  • Has referred 1+ members
  • Has sold $100+ on Envato Market
  • Has collected 100+ items on Envato Market
  • Has been part of the Envato Community for over 5 years
+3 more
vanRijswijk says

Thanks for the reply i am looking into it.

Helpful Information

  • Please read our community guidelines. Self promotion and discussion of piracy is not allowed.
  • Open a support ticket if you would like specific help with your account, deposits or purchases.
  • Item Support by authors is optional and may vary. Please see the Support tab on each item page.

Most of all, enjoy your time here. Thank you for being a valued Envato community member.

Post Reply

Format your entry with some basic HTML. Read the Full Details, or here is a refresher:

<strong></strong> to make things bold
<em></em> to emphasize
<ul><li> or <ol><li> to make lists
<h3> or <h4> to make headings
<pre></pre> for code blocks
<code></code> for a few words of code
<a></a> for links
<img> to paste in an image (it'll need to be hosted somewhere else though)
<blockquote></blockquote> to quote somebody

:grin: :shocked: :cry: Complete List of Smiley Codes

by
by
by
by
by
by