Search found 197 matches

by chris
Wed Feb 13, 2013 8:10 pm
Forum: General
Topic: Resize script for gimp
Replies: 3
Views: 28429

Re: Resize script for gimp

Some people had problems with GIMP 2.6. So here is the updated version: (define (gimp_test_resize pattern img-width dir prefix) (let* ((filelist (cadr (file-glob pattern 1)))) ;Get list of files (while (not (null? filelist)) (let* ((filename (car filelist)) (new_filename (string-append dir prefix fi...
by chris
Thu Jan 31, 2013 7:04 pm
Forum: General
Topic: Test websites Windows 8with modern.ie
Replies: 0
Views: 61599

Test websites Windows 8with modern.ie

Microsoft has launched a new tool
that test you site for common problems.

Most importantly it check for compatibility issues with Internet Explorer 9 and 10 (and windows 8)

http://www.modern.ie
by chris
Mon Jan 07, 2013 9:14 pm
Forum: HTML
Topic: Difference between DIV-tag and SPAN-tag
Replies: 1
Views: 23139

Re: Difference between DIV-tag and SPAN-tag

<DIV> is more like a paragraph and <SPAN> is not. The DIV element gives you the chance to define the style of whole sections of the HTML. You can define a division of your page as a call out and give that area a different style from the surrounding text. Because the CENTER element has been deprecate...
by chris
Sun Jan 06, 2013 1:52 pm
Forum: MySQL
Topic: Solved: mysqldump: Got errno 28 on write
Replies: 2
Views: 28127

Re: mysqldump: Got errno 28 on write

Basically it means you run out of disk-space.

Liberate some space and try again.
by chris
Tue Nov 13, 2012 8:26 pm
Forum: PHP
Topic: PHP Warning: preg_match(): Compilation failed: missing ) at
Replies: 5
Views: 30974

Re: PHP Warning: preg_match(): Compilation failed: missing

If you still have problems even with

Code: Select all

$pattern="/\b".preg_quote($c_line[1])."\b/i";
Try
$pattern="/\b".preg_quote($c_line[1],'/')."\b/i";
It should escape any 'bad' character.
by chris
Mon Nov 05, 2012 8:39 pm
Forum: SQL
Topic: How to get the id inserted by Auto increment
Replies: 2
Views: 23330

Re: How to get the id inserted by Auto increment

I have good results with mysql_query("INSERT INTO table (product,date_1) values ('item','$today')"); $lastid=mysql_insert_id(); Basically it gets the id generated from the previous insert. If it doesn't work, You can try to get it from table status: $result=mysql_query("SHOW TABLE STA...
by chris
Fri Sep 28, 2012 12:44 pm
Forum: PHP
Topic: Solved: Regular expression for url
Replies: 3
Views: 24190

Re: Regular expression for url

On this site you get a good overview of several patterns,
with there pro's and con's:
http://mathiasbynens.be/demo/url-regex
by chris
Fri Sep 28, 2012 12:00 pm
Forum: PHP
Topic: Solved: Regular expression for url
Replies: 3
Views: 24190

Re: Regular expression for url

I find the following pattern works well for me "@((https?://|ftp://)([-\w\.]+)+(:\d+)?(/([\w/_\.\-\+\~\=\:]*(\?\S+)?)?)?)@" $pattern=array("@((https?://|ftp://)([-\w\.]+)+(:\d+)?(/([\w/_\.\-\+\~\=\:]*(\?\S+)?)?)?)@"); $replace=array("[Somtehing]\\1"); $str=preg_replace(...
by chris
Wed Sep 26, 2012 7:34 pm
Forum: PHP
Topic: php convert text date
Replies: 1
Views: 20199

Re: php convert text date

strtotime() does its job well, but it need to be in the correct order. day month year Use a function to switch the dates: function switch_date($str) { //split string $arr=explode(' ',$str); //put in correct order $new_str=$arr[2].$arr[1].$arr[0].$arr[3]; return date('Y-m-d', strtotime($new_str)); }
by chris
Fri Sep 21, 2012 7:23 pm
Forum: PHP
Topic: PHP Warning: preg_match(): Compilation failed: missing ) at
Replies: 5
Views: 30974

Re: PHP Warning: preg_match(): Compilation failed: missing

There is probably a character in $c_line[1] that breaks your regular expression ($pattern). You can use preg_quote() to escape special characters. Your code should look something like this: $pattern="/\b".preg_quote($c_line[1])."\b/i"; if(preg_match($pattern,$text)) $countries[]=...