Web design and coding samples, free tools, tips and more..
Untitled Document

PostHeaderIcon Bing Translator – PHP Usage

I’d like to share a php code that you can use for bing translator api. Just add your bing api id into “AppID= ” part.

<?php
echo translate(’Hello World’, ‘en’, ‘da’).”<br>”;
function translate($text, $from, $to) {
$data = file_get_contents(’http://api.bing.net/json.aspx?AppId=31B78D195F4E66D972222136272630A949274973&Sources=Translation&Version=2.2&Translation.SourceLanguage=’ . $from . ‘&Translation.TargetLanguage=’ . $to . ‘&Query=’ . urlencode($text));
$translated = json_decode($data);
if (sizeof($translated) > 0) {
if (isset($translated->SearchResponse->Translation->Results[0]->TranslatedTerm)) {
return $translated->SearchResponse->Translation->Results[0]->TranslatedTerm;
} else {
return false;
}
} else {
return false;
}
}
?>

<?php

echo translate(’Hello World’, ‘en’, ‘fr’);

function translate($text, $from, $to) {

$data = file_get_contents(’http://api.bing.net/json.aspx?AppId=YoutApiIDHere&Sources=Translation&Version=2.2&Translation.SourceLanguage=’ . $from . ‘&Translation.TargetLanguage=’ . $to . ‘&Query=’ . urlencode($text));

$translated = json_decode($data);

if (sizeof($translated) > 0) {

if (isset($translated->SearchResponse->Translation->Results[0]->TranslatedTerm)) {

return $translated->SearchResponse->Translation->Results[0]->TranslatedTerm;

} else {

return false;

}

} else {

return false;

}

}

?>

  • Share/Bookmark

PostHeaderIcon AS2 Domain Lock – Protecting SWF Files

Domain Locking is the simple way to protect your swf files at least from newbies. Here’s what i’ve found for domain locking. Just copy and paste this code into first frame;

urls_allowed = ["www.guidefordesign.com"];
sitelock(urls_allowed);
function sitelock(urls_allowed) {
lock = true;
domain_parts = _url.split(”://”);
real_domain = domain_parts[1].split(”/”);
domain.text = real_domain[0];
for (x in urls_allowed) {
if (urls_allowed[x] == real_domain[0]) {
lock = false;
}
}
if (lock) {
_root._alpha = 0;
}
}

for multiple domain lock just change the line above;

urls_allowed = ["www.guidefordesign.com","www.anotherdomain.com"];

source: emanueleferonato.com

  • Share/Bookmark

PostHeaderIcon 90 Cool Seo Tools

new-logo-1
You should check searchenginegenie.com . There are too many usefull seo and webmaster tools in this site.

  • Share/Bookmark

PostHeaderIcon Best Ways to Earn Money From Your Flash Game

Here’s the best ways to earn money from your flash game;

1. Finding sponsors.

You may sell your game to a sponsor. Some of the sponsors that buy flash games; ArmorGames, CrazyMonkeyGames, Flashrange.com, www.zbeng.ro

2. Markets to sell games or your flash applications;

. Buy Stock Flash
. Flash Juggler
. Flash Marketplace
. Flash Do
. Flash Scope
. Stock Fuel
. Flash Components
. Active Den
. Flash Game License (games only, auction + shop)
. Flashgamelicence.com

3 Game Networks

a) I offer you mochimedia.com. They have free tools and services for monetizing, distributing and tracking your games. You earn money when someone play your game somewhere around the world, sounds great.
b) Gamegum which offers %50 commision revenue sharing. Just upload your game.

  • Share/Bookmark

PostHeaderIcon Cool Online Seo Tools

I’ve found a seo site, seoheap.com. They have pretty seo tools like web site analyzing, backlink checking, keyword suggestion tools,  reciprocal backlink checking tool. i think you should check this site  ;)

  • Share/Bookmark

PostHeaderIcon Removing folder with the files inside with php

Another usefull php function. It removes a folder with the content inside.

//function
function delTree($dir) {
    $files = glob( $dir . ‘*’, GLOB_MARK );
    foreach( $files as $file ){
        if( substr( $file, -1 ) == ‘/’ )
            delTree( $file );
        else
            unlink( $file );
    }
    rmdir( $dir );

}

//usage
delTree(’FolrderName’);

  • Share/Bookmark

PostHeaderIcon php function against sql injection

I’ve began to use this usefull function against sql injection and cleaning other bad characters before inserting data into database.

//function

function clean($str) {
  $str = @trim($str);
  if(get_magic_quotes_gpc()) {
   $str = stripslashes($str);
  }
  return mysql_real_escape_string($str);
 }

// usage:
clean($_POST["data"]);

hope it helps.

  • Share/Bookmark

PostHeaderIcon Free Online Web Site Submission Services

Free online web site submission services that i use regularly. Hope it helps ;)

1. Submit Express

2. Free web submission

3. Add me

Also a helpfull link;

Top free directories & search engines

  • Share/Bookmark

PostHeaderIcon Search Engine List For DoFollow Links

How can we find dofollow links for link building? Here’s the list of search engines for finding dofollow links:

http://www.backlinkmagic.com/
http://w3ec.com/dofollow
http://techmm.com/dofollow
http://www.followtopia.com
http://www.commenthunt.com
http://www.commentlinkbuilding.info
http://bloggtag.com/en/dofollow-search
http://www.inlineseo.com/dofollowdiver
http://www.bestrealincome.com/dofollowsearch.htm
http://www.wmtips.com/tools/dofollow-search-engine
http://www.hippowebsolutions.com/dofollow-search-tool
http://www.ezbusinessneeds.com/dofollow.php

  • Share/Bookmark

PostHeaderIcon Top 70 ajax demos and code examples

For more attractive web sites;

  1. Ajallerix : AJAX, simple, fast Web image gallery demo ; at Novell
  2. AJAX – microlink pattern tutorial : A microlink is a link that opens up content below it.
  3. Ajax BBC News RSS Reader : demo by Nigel Crawley
  4. AJAX Chat in Python with Dojo : at AquaAjax
  5. Ajax Chess : multiplayer chess
    Read the rest of this entry »
  • Share/Bookmark

Search