Updates from March, 2010 Toggle Comment Threads | Keyboard Shortcuts

  • Shafiul Azam 11:44 am on March 30, 2010 Permalink | Reply
    Tags: automatically shorten my web site link, easy method to use bit.ly, how to dynamically shorten my links, how to short any link of my site, how to shorten a dynamic link of my site, how to shorten my links by javascript, how to shorten my website easily, how to use bit.ly by ajax, how to use bit.ly by javascript, how to use bit.ly in my site   

    Auto Shorten dynamic URL by javascript 

    Live Demo

    Thinking of using bit.ly Url Shortening service in your site? You can use a simple javascript code in any page of your site, specially if it is a dynamic page. For example, look at a dynamic page of my online code compiling site:

    The link of a dynamic page is somewhat this: http://shafiul.progmaatic.com/hostcode/compiled.php?i=wRZWM&c=252&ext=11

    The link is too long. So, I automatically shortened the links, and gifted it to the viewers! ;)

    how to use bit.ly in your site

    How to use bit.ly service in your site

    First, you need an account on http://bit.ly. To create one, go to the site and register.

    Once you’ve registered, login and go to your Account page. There, you will find your API key.

    Now, we’ve all the resources. Let’s go to the code section

    The Code

    Between the <HEAD> and </HEAD> tag of your page, place the following code:

    	
  • <script type="text/javascript" charset="utf-8" src="http://bit.ly/javascript-api.js?version=latest&login=******&apiKey=*****************"></script>
  • Replace the first ***** by your bit.ly username and second ************** by your bit.ly API key!

    Now, place the following code anywhere of your page. It is nothing but a text-input field, where shortened link will be placed. You can use anything instead of a text area, perhaps a <div>tag to display the shortened link!

    <h3>Link to this page</h3><br>
    Use this link to tell others about this page! <input onclick = "this.select()" type = 'text' id = "qlink" style = "width:100%;">
    
    <br><br>
    
    

    Now, the final task. Place the following code just before </BODY> the tag of you page:

    <script>
    	// Bit.ly API
    	BitlyCB.shortenResponse = function(data) {
    			var sss = '';
    			var first_result;
    			// Results are keyed by longUrl, so we need to grab the first one.
    			for     (var r in data.results) {
    					first_result = data.results[r]; break;
    			}
    			sss = first_result["shortUrl"].toString();
    			document.getElementById("qlink").value = sss;
    	}
    	BitlyClient.shorten(window.location, 'BitlyCB.shortenResponse');
    </script>
    
    

    Yeah, you’re done! Now anyone entering the page with any query string, the link of the page with the query string will be automatically shortened :D

     
    • Ali 11:59 am on December 15, 2010 Permalink | Reply

      Nice Article,

      Is this only for one URL or we can use multiple, if we want multiple then do we have to code like this for each URL?

      Thanks

      • Shafiul Azam 7:15 pm on December 15, 2010 Permalink | Reply

        This works for multiple urls – the code automatically detects the page’s url and shortens it.

    • Shafiul Azam 1:41 pm on December 27, 2010 Permalink | Reply

      Code for the broke.

      
      
  • Shafiul Azam 11:33 am on March 25, 2010 Permalink | Reply
    Tags: automatic sitemap ping, automatic sitemap submission, automatic sitemap submit by server, automatic sitemap updater, how to automatic update sitemap, how to update sitemap by cron job, one click sitemap updater, sitemap updater, update sitemap in bing.com, update sitemap in google, update sitemap in yahoo   

    PHP Auto Sitemap Submit Script for Google Bing Yahoo or Other Search Engines 

    Sitemaps are useful to tell search engines about different pages of your website. Once you submit a sitemap to a search engine, they can crawl all the links which you provided in your sitemap. So generating a sitemap for your website is very important. If you don’t have a sitemap for your site, create one by Google Codes or manually create one by Learning how to create a sitemap (it’s nothing but a simple XML file!)

    Now, there are two ways for making a scheduled update for your sitemap:

    Automatic: By PHP & Cron Job

    Download this PHP file. Give it a name, like “sitemap_updater.php”. Edit it to type in it the correct location of your sitemap. Now upload it to your server, suppose in /public_html/cron_jobs/ directory. Give the file a name, for example, sitemap_updater.php

    Now, go to Cron job section of your server from the Control Panel/Admin account of your hosting. If you’ve acces to Cpanel, you may click cron jobs like following:

    Next, click a option that suits you most. If you’re new, click standard

    Cron job - how to select method

    Cron job - how to select method

    Next we’re on the main panel. Select your schedule – how often you want to run the code. Then in the command to run box, type the following command:

    php -f /home/your-username/public_html/cron_jobs/sitemap_updater.php
    
    

    Look at the URL: /home/your-username/public_html/ replace it with appropritae location of your root directory.

    If you have a different location for the sitemap_updater.php file, type it accordingly. The following screen-shot might be helpful (ignore the command given in the image)!

    Cpanel how to execute PHP file as a Cron job

    More details on Cron jobs here

    Download the Sitemap_Updater.php file


    Manually Updating Site-maps

    Well, if you don’t have access to PHP/Cron jobs, you can manually update sitemaps. The trick is, we will create a HTML file, save it in our local disk, and run the file manually whenever we need to update the sitemap!

    1. Download this HTML file
    2. Rename it like something.html
    3. Open the file for editing, edit line # 5, give here your sitemap address. Save it
    4. Now whenever you need to update your sitemap, just open the HTML file in your brower! :)

    Well, that’s all. Rock with your sitemaps :D

     
    • Webamster support 1:58 pm on April 29, 2010 Permalink | Reply

      Thanks for smart way from cron i was looking for it.

      • eduardo 6:21 am on May 25, 2010 Permalink | Reply

        The cron job is every 5 min?

        • bdhacker 7:10 am on May 25, 2010 Permalink

          The image shown here gives instruction on how to run cron every 5 minutes. You can set an interval that suits your site best :)

    • uzer 12:30 pm on April 12, 2011 Permalink | Reply

      This is very useful!

    • Nick 3:36 pm on October 10, 2011 Permalink | Reply

      Hi, Nice post.

      I want to make news site like http://101blogs.com and want that it should be update automatically.

      Is there any way?

    • mobile phones 9:24 pm on April 23, 2012 Permalink | Reply

      I need a dynamic sitemap code for php. Can give me any reference ?

  • Shafiul Azam 8:17 pm on March 23, 2010 Permalink | Reply
    Tags: code blogg site, code hosting, code shareing, direct code execution service, free code blog, free code compiler, free code execute, free code hosting, free code shareing, online code compile, online code execute, online code hosting, online code hosting download   

    Online Code Compile, Sharing Site – Host, Compile & Download your Codes 

    :) Say hello to…

    HostCode.SF.net

    Online free code hosting

    Whoa! At long last, I’ve finished my Code Sharing/Download/Hosting Project! And with bonus -  with the features to Compile & Execute your codes! :D Yummy, huh? Yes, I was looking for a online code storage so that I can demostrate my codes to others, with perfect syntax highlighting, direct one click download facilities etc. I dreamt of a site that would be handy, no registration will be required, just hit the site and paste your code. To spice up everything, I’ve also implemented comment from viewer facility – yes I know you want comment from your viewers! ;) And lastly, online compilation of your code! Just hit the compile button, provide some input or not, and submit, you find your output that is permanent, share your code/compilation information with anyone on the web!

    So you can share your code here, compile it online, provide links at your blogs & it would be simply superb. Okay enough talking, now let’s see some eXclusive features of the site:

    Now what? Just try the site. If you like it, please recommend to others, I spent a significant amount of site in the development :( It’s totally free, and always will be. Please give me feedback, I will definitely take them seriously and implement ASAP……..

    Take care.

     
    • rushafi 11:55 pm on March 23, 2010 Permalink | Reply

      great job Shafiul. keep it up.

      • bdhacker 11:59 pm on March 23, 2010 Permalink | Reply

        Thanks vaiya for taking a look. Please help me by suggesting how to improve it, & if you like it also recommend to others! :)

  • Shafiul Azam 10:20 am on March 17, 2010 Permalink | Reply
    Tags: ওয়েব ফাইল ব্রাউজার, পিএইচপি বাংলা ফাইল ম্যানেজার, বাংলা ফাইল ব্রাউজার, বাংলা ফাইল ম্যানেজার, bangla directory browser, bangla file browser, bangla file manager, bangla file manager script, bangla web browser, free bengali file uploader, free web file browser, php web file manager   

    Bangla/Bengali Web File Manager by PHP বাংলা ফাইল ম্যানেজার 

    Hello, everybody! Today I’m going to share one of my little but proud contributions to the Bengali language – A Complete Bangla File Manager written in PHP. No, I didn’t write the core file manager script, as there are plenty of scripts available written by professional coders. So I chose File Thingie, a singe-file open source PHP based file manager script. The next thing I did, translated it to my mother lagnguage Bengali :)

    Check out the screenshots:

    So what you need to do?

    1. Download latest copy of File Thingie from here (recommended 2.5.3)
    2. Download Bangla Translation extension from here. Rename it to “ft_lang_bn.php” & put it in the same folder where your downloaded copy of File Thingie resides.
    3. Edit the file thingie script, select Bangla as the default language. All you need to do, is simply edit the File Thingie script, find the line containing $ft["settings"]["LANG"] and set it to bn:

    $ft["settings"]["LANG"]              = “bn”;

    Now it should be working properly, as working properly in my servers:

    Anyway, I think your tasks are simplified, since translating is not that kind of job for a programmer :( Anyway, some of my translations are spelled incorrectly, some of them might not be suitable. Please let me know about them. And you’re always at your freedom to modify the code as you need!

    Note: My translation also stays in the translation packages-download page of File thingie. But i recommend to download it from the hostcode-site, as i may update the script later.

    So fire up your bangla file manager now!!!

     
    • Ori 5:43 pm on January 25, 2011 Permalink | Reply

      Hi
      I was using FileThingie 2.5.3 as you do (on upload.toddgee.com), and I was hacked.
      There is a newer version 2.5.7 which fixed this security issue.
      Please update your version.
      Good luck,
      Ori

  • Shafiul Azam 4:41 am on March 17, 2010 Permalink | Reply
    Tags: download files from remote server, enable ftp by php, free php ftp uploader, free php uploader, ftp by php, ftp remote copier, how to copy files from other server to my server, how to upload files by ftp and php, how to use ftp by php, php based ftp file uploader, php ftp download, php ftp upload, php ftp uploader, php ftp uploader script   

    Free PHP FTP Uploader Script 

    As many of you already know, & rest will be known by the end of the post that you can make FTP connections and actions by PHP, we can create a simple one-page FTP based File Uploader running in PHP :)

    Well, are you wondering, what’s the need of this heck when we can already upload files by simple PHP calls? Well, many of us run our files on Free Hosting Providers, and they dont allow us to write files. They simply restrict opening files in Write mode, so though we can read the file from a remote location, we can’t write it safely in our server :(

    So if we want to copy some files from another server to our server, & if you’re allowed to make FTP connections (that means you have an FTP username & password) we can use the script below. This is a one file PHP script, Put it in the directory where you want to upload files, and use it with simple efforts.

    The Script

    Yes, it’s free :) Grab it from here

    The code is pretty self-explanatory, so if you’re going to modify it, you’ll find it a piece of cake!

    Screenshot

    Really simple huh?

    Issues

    • If FTP is not enabled in your server configuration, this will not work. Check your PHP configuration by phpinfo();
    • If your server configuration restricts remote opening file (reading files hosted in other server) , this will not work.
     
c
compose new post
j
next post/next comment
k
previous post/previous comment
r
reply
e
edit
o
show/hide comments
t
go to top
l
go to login
h
show/hide help
shift + esc
cancel
Follow

Get every new post delivered to your Inbox.