PHP and Web Technologies Freak
CSS designers allways have same problem; when the page is short there is no scroll in firefox but there is in ie. We can’t remove IE’s scrolls but we can put scrolls to Firefox.
Here we go;
html { overflow: -moz-scrollbars-vertical; }
Simple and clear;
substr_replace($string ,"",-1);
Here is the list of some free feed directories;
http://www.feedest.com/feedAdd.cfm
http://www.2rss.com/index.php
http://www.fybersearch.com/add-url.php
we’ll go it with get_defined_vars() function. get_defined_vars returns multidimensional array with all defiend variables in PHP
here we go ; Read the rest of this entry »
I am going to divide each part as follows
1. Plan the layout of the filesystem with the new drive
2. Partition the new hard drive
3. Format the new partitions
4. Test the new space
5. Copy data from old to new partition (optional)
6. Edit /etc/fstab
7. Reboot
8. Remove old data (optional)
Here is the details about each one.
Read the rest of this entry »
if you want to backup and restore your big MySQL databases you need better solution than phpmyadmin
So here we go;
To dump all databases to a file:
$ mysqldump -u dbuser -pdbpass --all-databases > all-databases.sql
To dump a single database to a file:
$ mysqldump -u dbuser -pdbpass somedb > somedb.sql
Dump InnoDB in a single transaction:
$ mysqldump -u dbuser -pdbpass --single-transaction somedb > somedb.sql
To restore:
$ mysql -u dbuser -pdbpass somedb < somedb.sql
There are several methods get a file extension using PHP:
<? $filename = 'myfile.jpg'; // 1. The "explode/end" method $ext = end(explode('.', $filename)); // 2. The "strrchr" method $ext = substr(strrchr($filename, '.'), 1); // 3. The "strrpos" method $ext = substr($filename, strrpos($filename, '.') + 1); // 4. The "preg_replace" method $ext = preg_replace('/^.*\.([^.]+)$/D', '$1', $filename); // 5. The "never use this" method // From: http://php.about.com/od/finishedphp1/qt/file_ext_PHP.htm $exts = split("[/\\.]", $filename); $n = count($exts)-1; $ext = $exts[$n]; ?>
1 – Blog & Portfolio Themes(1-35)
2 – Magazine & Corporate Themes(36-57)
3 – Photo blogs & Gallery Themes(58-68)
4 – Minimal & Clean Themes Themes(69-84)
5 – Smashing Magazine Themes(85-98)
6 – Something different… (99-104)
Debian uses a Sys-V like init system for executing commands when the system runlevel changes – for example at bootup and shutdown time.
If you wish to add a new service to start when the machine boots you should add the script to the directory /etc/init.d/. Many of the scripts already present in that directory will give you an example of the kind of things that you can do.
Here’s a very simple script which is divided into two parts, code which always runs, and code which runs when called with “start” or “stop”. Read the rest of this entry »
I spend a lot of time lurking in the channel # PHP (EFnet and freenode, please – no flame wars) and this issue is a frequently asked that the rule is a simple answer in the form of the use of strpos (), or best to ip2long () in a more than less than reply.
Unfortunately, although the people in the rule that an IP address is just an unsigned 32-bit integer, and is easy to determine, usually with $ _SERVER [ "REMOTE_ADDR"], where the real challenge – is in defining the range within which it must decide whether the IP address. IP ranges are usually divided into three categories (in increasing complexity):
1. Wild Card: 192.168.10 .*
2. Start-end: 10.1.0.0-10.1.255.255
3. * CIDR: 172.16.1.0/24
* Classless Inter-Domain Routing
Read the rest of this entry »