28, May 2012

encoding url for blinklist - webmaster forum

 
Webdigity webmaster forums
[ Home | Help | Search | Forum's Shop | Archive | Login | Register | Webmaster Directory ]
Webdigity Webmaster Forums  >  Web Development  >  PhP
Topic: encoding url for blinklist
« previous next »
Pages: [1] Print
Instabuck - The easy way to sell digital products online

Author Topic: encoding url for blinklist  (Read 989 times)
Global Moderator
Community Supporter ?
Jedai Sword Master
*****
Gender: Male
Posts: 6691
34714 credits
Members referred : 374


It's time to use PHP5!


« on: Apr 25, 2006, 12:38:20 am »

Hello,

I added the some buttons to my site to make it possible to add a link to sites like blinklist, example:
http://www.finalwebsites.com/snippets.php?id=32

because the links must be dynamic I have this code for the blink list button:
Code:
<a href="http://blinklist.com/index.php?Action=Blink/addblink.php&amp;Description=
<?php echo urlencode(htmlentities($row_selected['short_descr'], ENT_QUOTES)); ?>
&amp;Url=<?php echo "http://www.finalwebsites.com/snippets.php?id=".$row_selected['id']; ?>
&amp;Title=<?php echo urlencode($opti_alt_txt); ?>" target="_blank">
<img src="images/Blink_Small_Button.gif" alt="Blink it! <?php echo $opti_alt_txt?>" width="80" height="18" /></a>
this code is w3 valid and works partly at blink list except the name field looks like this:
DB_cart Class %28shopping cart%29

I played already with lots of encoding functions, what next?

I am a metal monkey!
Administrator
Community Supporter ?
Jedai Sword Master
*****
Gender: Male
Posts: 5799
46391 credits
Members referred : 3



« Reply #1 on: Apr 25, 2006, 10:18:30 am »

Maybe write your own Smiley

Something like :

Code:
<?php
myUrlencode 
$txt )
{
 return 
str_replace '%28''('str_replace'%29'')'urlencode$txt ) ) );
}

?>


I think this would work.

Trial and Error my two best teachers Cool
Join us @ facebook or twitter

Last blog : Butterfly Marketing 2.0
Global Moderator
Community Supporter ?
Jedai Sword Master
*****
Gender: Male
Posts: 6691
34714 credits
Members referred : 374


It's time to use PHP5!


« Reply #2 on: Apr 25, 2006, 10:37:26 am »

hmm...
of course this is possible but what about other characters (like ? and others), is there a way to convert a ? to &euro; ?
(with a function not with replace)

I am a metal monkey!
Administrator
Community Supporter ?
Jedai Sword Master
*****
Gender: Male
Posts: 5799
46391 credits
Members referred : 3



« Reply #3 on: Apr 25, 2006, 11:03:00 am »

I am afraid that there is no function for this except if something like utf8encode can do that (I am not too familliar with those functions).

Trial and Error my two best teachers Cool
Join us @ facebook or twitter

Last blog : Butterfly Marketing 2.0
Global Moderator
Community Supporter ?
Jedai Sword Master
*****
Gender: Male
Posts: 6691
34714 credits
Members referred : 374


It's time to use PHP5!


« Reply #4 on: Apr 25, 2006, 11:58:04 am »

Its' strange that this happens only for blinklist, the other furl, del.icio are working wel...

Global Moderator
Community Supporter ?
Jedai Sword Master
*****
Gender: Male
Posts: 6691
34714 credits
Members referred : 374


It's time to use PHP5!


« Reply #5 on: Apr 25, 2006, 11:58:53 am »

but you gave me an idea (utf-8)... thanks

Global Moderator
Community Supporter ?
Jedai Sword Master
*****
Gender: Male
Posts: 6691
34714 credits
Members referred : 374


It's time to use PHP5!


« Reply #6 on: Apr 25, 2006, 10:19:09 pm »

I tried a little bit more, also the javascript link provided by blinklist. All with the same result the brackets are changed into "%28 %29"

look like to be a bug or maybe I have to encode my own site into utf-8... :-(

by the way utf8_encode is a good and often used function but in this case it will not work...

Trackback URI for this entry : http://www.webdigity.com/trackback.php?topic=2355
Tags : javascript furl Bookmark this thread : Digg Del.icio.us Dzone more....

Pages: [1] Print 
Webdigity Webmaster Forums  >  Web Development  >  PhP
Topic: encoding url for blinklist
« previous next »
Jump to:
User Area
Welcome, Guest. Please login or register.
Did you miss your activation email?
May 28, 2012, 11:47:52 am





Login with username, password and session length

Donate to our community, and get a permanent link back to your site!

Donate to our community, and get a permanent link back to your site!






Web Design Gallery · Whois Lookup · Pagerank · Tag Browsing · Lo-fi version · Syndication · Webmaster forum history · Advertise
Developed by HumanWorks © 2005 - 2012 Webdigity webmaster community · sublime directory
Webdigity Webmaster Forums | Powered by SMF 1.0.12. © 2001-2005, Lewis Media. All Rights Reserved.