[PHP] How to correctly validate url?

2012-01-18 Thread Tanel Tammik
Hello, how to correctly validate url? now the special local characters like ÜÕÖÄ etc are allowed as well... Br, Tanel -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php

Re: [PHP] How to correctly validate url?

2012-01-18 Thread Tanel Tammik
it doesn't work. please see the results: var_dump(filter_var('http://example.com', FILTER_VALIDATE_URL)); var_dump(filter_var('http://example', FILTER_VALIDATE_URL)); var_dump(filter_var('http://exämple.com', FILTER_VALIDATE_URL)); http://example should be false http://exämple.com should be

[PHP] $_SERVER['REMOTE_ADDR'] and sql injection

2010-06-23 Thread Tanel Tammik
Hi, is there a vulnerability with using $_SERVER['REMOTE_ADDR'] in sql queries? Br Tanel -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php

Re: [PHP] $_SERVER['REMOTE_ADDR'] and sql injection

2010-06-23 Thread Tanel Tammik
vulnerabilities, imho. On Wed, Jun 23, 2010 at 8:53 AM, Tanel Tammik keevit...@gmail.com wrote: Hi, is there a vulnerability with using $_SERVER['REMOTE_ADDR'] in sql queries? Br Tanel -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php

Re: [PHP] $_SERVER['REMOTE_ADDR'] and sql injection

2010-06-23 Thread Tanel Tammik
Michael Shadle mike...@gmail.com wrote in message news:aanlktildd_gdnlffpuwdx5acwwk45jbu4i6ybbmgj...@mail.gmail.com... On Wed, Jun 23, 2010 at 12:06 AM, Rene Veerman rene7...@gmail.com wrote: unlikely. it's a apache delivered ip address.. very little chance of insert vulnerabilities, imho.

[PHP] Re: Delete File With Any File Extension

2010-06-15 Thread Tanel Tammik
Shaun Thornburgh shaunthornbu...@hotmail.com wrote in message news:bay148-w43caac3698e0134dfacc28ab...@phx.gbl... Hi, I need to delete a file with any file extension where i know the name of the file, is it possible to use regular expressions with the unlink function? Thanks

[PHP] array key's: which is correct?

2010-06-08 Thread Tanel Tammik
Hi, which one is correct or better? $array[3] = ''; or $array['3'] = ''; $i = 7; $array[$i] = ''; or $array[$i] = ''; Br Tanel -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php

[PHP] finding the web root

2010-06-08 Thread Tanel Tammik
Hi, i like to find the web root where the current file is. is there a better solution? it must work both on linux and windows machines... ?php $root = explode('/', $_SERVER['DOCUMENT_ROOT']); $cwd = explode(DIRECTORY_SEPARATOR, __DIR__); $web_root = '/' . implode('/', array_diff($cwd, $root));

Re: [PHP] finding the web root

2010-06-08 Thread Tanel Tammik
Jim Lucas li...@cmsws.com wrote in message news:4c0e99d9.20...@cmsws.com... Tanel Tammik wrote: Hi, i like to find the web root where the current file is. is there a better solution? it must work both on linux and windows machines... ?php $root = explode('/', $_SERVER['DOCUMENT_ROOT

[PHP] empty() and method return values

2010-06-07 Thread Tanel Tammik
Hi, empty() cannot check the return value of the method or function. which would be the best workaround? empty($class-method()) // gets an error i could do $method_return_value = $class-method() and then run empty() on $method_return_value or is there an better option? i would like to do

Re: [PHP] regular expression

2010-06-07 Thread Tanel Tammik
Peter Lind peter.e.l...@gmail.com wrote in message news:aanlktilqkz8dnc0zacfv70tctf2wqkgpzojccqtuw...@mail.gmail.com... On 1 June 2010 17:33, Ashley Sheridan a...@ashleysheridan.co.uk wrote: On Tue, 2010-06-01 at 16:31 +0100, Richard Quadling wrote: $re1 = '/^[a-z]++$/i'; $re2 = '/^[a-z

Re: [PHP] empty() and method return values

2010-06-07 Thread Tanel Tammik
Ashley Sheridan a...@ashleysheridan.co.uk wrote in message news:1275940320.2248.40.ca...@localhost... On Mon, 2010-06-07 at 22:40 +0300, Tanel Tammik wrote: Hi, empty() cannot check the return value of the method or function. which would be the best workaround? empty($class-method

Re: [PHP] empty() and method return values

2010-06-07 Thread Tanel Tammik
Peter Lind peter.e.l...@gmail.com wrote in message news:aanlktinmvaqv-hdgjlq_dwoquvojbbmbfrixnxvqk...@mail.gmail.com... On 7 June 2010 21:52, Ashley Sheridan a...@ashleysheridan.co.uk wrote: On Mon, 2010-06-07 at 22:40 +0300, Tanel Tammik wrote: Hi, empty() cannot check the return value

Re: [PHP] Re: convert files utf8

2010-06-04 Thread Tanel Tammik
Ashley Sheridan a...@ashleysheridan.co.uk wrote in message news:1275607105.2217.31.ca...@localhost... On Fri, 2010-06-04 at 00:38 +0300, Tanel Tammik wrote: OP win xp pro Tanel Tammik keevit...@gmail.com wrote in message news:91.07.07323.be028...@pb1.pair.com... Hi, does anyone know

[PHP] Mysql search html tags excluded

2010-06-04 Thread Tanel Tammik
Hello, if there is some webpage content with html tags in database is it possible to search it without tags? data : 'div style=you need some styling!/div' when i now search for 'you style' i don't want to get any rows! is it possible? when i search 'you styling' i get the row! Br Tanel

Re: [PHP] Mysql search html tags excluded

2010-06-04 Thread Tanel Tammik
Ashley Sheridan a...@ashleysheridan.co.uk wrote in message news:1275651371.2217.46.ca...@localhost... On Fri, 2010-06-04 at 14:12 +0300, Tanel Tammik wrote: Hello, if there is some webpage content with html tags in database is it possible to search it without tags? data : 'div style

Re: [PHP] Mysql search html tags excluded

2010-06-04 Thread Tanel Tammik
Ashley Sheridan a...@ashleysheridan.co.uk wrote in message news:1275652342.2217.51.ca...@localhost... On Fri, 2010-06-04 at 14:44 +0300, Tanel Tammik wrote: Ashley Sheridan a...@ashleysheridan.co.uk wrote in message news:1275651371.2217.46.ca...@localhost... On Fri, 2010-06-04 at 14:12

Re: [PHP] Mysql search html tags excluded

2010-06-04 Thread Tanel Tammik
Ashley Sheridan a...@ashleysheridan.co.uk wrote in message news:1275652880.2217.54.ca...@localhost... On Fri, 2010-06-04 at 14:54 +0300, Tanel Tammik wrote: Ashley Sheridan a...@ashleysheridan.co.uk wrote in message news:1275652342.2217.51.ca...@localhost... On Fri, 2010-06-04 at 14:44

[PHP] constant from variable

2010-06-04 Thread Tanel Tammik
Hi, define('MYCONST', 'something'); $my = 'my'; $const = 'const'; is it possible to get the value of MYCONST using variables $my and $const_ Br Tanel -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php

[PHP] convert files utf8

2010-06-03 Thread Tanel Tammik
Hi, does anyone know how to convert all files in a directory and in it's subdirectories into utf8 encoding? i am using komodo edit as text-editor. may it has a feature which i cannot find... Br Tanel -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit:

[PHP] Re: convert files utf8

2010-06-03 Thread Tanel Tammik
OP win xp pro Tanel Tammik keevit...@gmail.com wrote in message news:91.07.07323.be028...@pb1.pair.com... Hi, does anyone know how to convert all files in a directory and in it's subdirectories into utf8 encoding? i am using komodo edit as text-editor. may it has a feature which i cannot

[PHP] regular expression

2010-06-01 Thread Tanel Tammik
How to check with regular expression (preg) if string has: 1. only letters 2. only letters and spaces Br Tanel -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php

Re: [PHP] get classname without namespace

2010-05-30 Thread Tanel Tammik
Adam Richardson simples...@gmail.com wrote in message news:aanlktin0wqqlgwgm2lowcdv4i0c6bzsbfxhjwxv_j...@mail.gmail.com... On Sat, May 29, 2010 at 4:20 PM, Tanel Tammik keevit...@gmail.com wrote: Hi, is there a way to get the called classname without the namespace? ?php //PHP 5.3.x

[PHP] MVC logic

2010-05-29 Thread Tanel Tammik
Hello, i'm trying to break this thing down for my self. i made little application for that. could someone please take a look and let me know if what i wrote resembles MVC inviroment or not. http://keevitaja.com/kool http://keevitaja.com/kool/kool.rar Idea is to create it from scratch for

[PHP] get classname without namespace

2010-05-29 Thread Tanel Tammik
Hi, is there a way to get the called classname without the namespace? ?php //PHP 5.3.x namespace some\where; abstract class ParentClass { public static function name() { return strtolower(get_called_class()); } public static function get_name() { echo 'name: ' . static::name();