TECHiE TALKS

Just another techie stuff

Archive for the ‘PHP’ Category

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

Slackware PHP GD Error

In the past months I was able to handle a LAMP server, this is my second time to handle a UNIX based web server but this time its a lot different because I will will be the one to install and configure the web server.  Our System administrator was the one who installed the latest [...]

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

PHPMyAdmin Importing Large Data

By Default phpmyadmin can import data on your mysql database up to 2MB of data and beyond that will be an error.  This has been a big problem  by most webmasters and sometimes this can be a barrier to stop improving the sites.  Before I kept on searching what to use to import a large [...]

No Comments

PHP Curl

If you are a web developer and having problems on Installing PHP Curl on Apache with PHP installed on Windows Operating System, below is my version of tonyspecer’s “cURL with PHP and Apache on Windows“.  The steps are simple and direct to the point. I have windows apache version 2.2.14 and PHP Version 5.2.10 installed [...]

No Comments

PHPMailer

Sending E-Mail with PHP can be simple, or it can be very complex depending on what you want to do.  PHPmailer is a free PHP software used for sending emails or should I say used for “spamming”.  Though the software has been provided for free, many developers has gone beyond its real purpose.  With a [...]

2 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
Rss Feeds