TECHiE TALKS

Just another techie stuff

Posts Tagged ‘Programming’

Simple PHP Date Function

PHP has a function date where you can specify different ways on how to display the date.  How do you generate current date and display only month and date like ‘September 2010′.  Here is a simple php howto, function curDate() { return date(“Y-m-d”,mktime(date(“h”)+8, date(“i”), date(“s”), date(“m”)  , date(“d”), date(“Y”))); } $now = substr(curDate(),0,7); echo date(“F Y”, [...]

No Comments

Bubble Sort and Graphics.h in Dev C++

Lately I have been searching  this post on the net about graphics.h in dev c++ and found few resources about it .  So I decided to write how to use graphics.h in dev-c++.  I am expecting that you have already installed bloodshed dev-cpp on your machine.  Graphics.h is a header file found in borlan c [...]

2 Comments

Change a String or Character in MySQL

Knowing the right MySQL statement is the most important part in having thousands of data in your database, one false move and you can’t undo things.    If you want to change a string or character in your database and doing it manually in thousands or millions of entries then that should consume all of your [...]

No Comments

Getting Main Domain

Do you want to extract the main domain of a URL?  Here is a function that works well and can be modified easily.  I found this function while searching for a good Regular Expression to fulfill such result. <?php function get_base_domain($url)  { $debug = 0; $base_domain = ”; $G_TLD = array( ‘biz’,'com’,'edu’,'gov’,'info’,'int’,'mil’,'name’,'net’,'org’,'aero’,'asia’,'cat’,'coop’,'jobs’,'mobi’,'museum’, ‘pro’,'tel’,'travel’,'arpa’,'root’,'berlin’,'bzh’,'cym’,'gal’,'geo’,'kid’,'kids’,'lat’,'mail’,'nyc’,'post’,'sco’,'web’,'xxx’, ‘nato’,'example’,'invalid’,'localhost’,'test’,'bitnet’,'csnet’,'ip’,'local’,'onion’,'uucp’, ‘co’ [...]

3 Comments

Translation Services

Google has provided web developers foreign language translation api. Web content translation is not a problem anymore, with google’s Google Translate, research from different countries is now made possible. This is a big help especially for researchers on the net, we can now easily understand web contents and even text from outside sources which also [...]

4 Comments

Code Igniter Query

Code Igniter is one of the best PHP framework available today.  It is free to download and user guide can be found together with the package. In Code Igniter the class that has the database queries or the methods that deals with getting the data on the database is placed inside the MODEL folder.  Just [...]

2 Comments

Session Authentication

One problem in creating a PHP Session Authentication is that when you are logged in and suddenly logs out and click the back button you will be returned to the page where you kast visited.   Isn’t this a problem especially when you have important data in that page.  So if you have problem with this [...]

2 Comments
Rss Feeds