RE: [PHP] Is there any way to get all the function name being called in a process?

2009-10-23 Thread Andrea Giammarchi
> even APD is not up to the task > > xdebug trace http://devzone.zend.com/article/2871 is sufficient, but > the output will be in a separate file. > Thank a lot. > > APD is just doing what I was looking for. > > -- > Satya > Bangalore. Regards

RE: [PHP] Is there any way to get all the function name being called in a process?

2009-10-23 Thread Andrea Giammarchi
> That won't do what the OP asked, it will just return a list of all the > functions defined, which could be a lot more than is actually being used > in a process, such as in the case of included libraries of functions. uhm, right, I guess APD then: http://uk3.php.net/manual/en/book.apd.php Reg

RE: [PHP] Is there any way to get all the function name being called in a process?

2009-10-23 Thread Andrea Giammarchi
http://uk3.php.net/manual/en/function.get-defined-functions.php get_defined_functions Regards > Date: Fri, 23 Oct 2009 11:54:34 +0530 > From: astra.sat...@gmail.com > To: php-general@lists.php.net > Subject: [PHP] Is there any way to get all the function name being called in > aprocess?

RE: [PHP] Create a screenshot of a website

2009-10-22 Thread Andrea Giammarchi
> Hi, > > If a windows web server is being used, we've had very good results with the > activex control (use via COM within PHP5) from > http://www.acasystems.com/en/web-thumb-activex/ > > The developer is very responsive to bug reports / feature suggestions. Full > PHP example code is given fo

RE: [PHP] Create a screenshot of a website

2009-10-22 Thread Andrea Giammarchi
> Given the knowledge (or extremely likely probability) of the > non-existence of a PHP only solution for generating website thumbnails > it follows that my suggestion was absolutely applicable. I have never said the opposite ... I have just said: pure PHP with standard core functions/librari

RE: [PHP] Fun with XSLT

2009-10-22 Thread Andrea Giammarchi
> is > there a way to somehow embed the contents of the xml into the php code > (like using <<< EOF for html), and being able to substitute the > template match string for a variable ? > > Any ideas ? XSLT should be used via modules, as is with match and templates indeed. The only idea is

RE: [PHP] Create a screenshot of a website

2009-10-22 Thread Andrea Giammarchi
> I see you are being rather obtuse :| I use system/shell calls without problems if there is the lib I need. The problem here is that the question was, in my opinion, the classic: how to assign javascript var to php (directly) Indeed he is trying to find a PHP solution, of course with third pa

RE: [PHP] Create a screenshot of a website

2009-10-22 Thread Andrea Giammarchi
> GD is just a library that PHP uses, in a similar way that you'd be > utilising what khtml2png can do through PHP. What you just said doesn't > make much sense. except I cannot find anything in both php.net and pecl websites Regards __

RE: [PHP] Create a screenshot of a website

2009-10-22 Thread Andrea Giammarchi
> > Thanks, > > > > I checked the faq of their website. They say that I must have an an X > > session. I don't host myself my website. > > I want something that I can use only by using cpanel. What i want > > basically is allow the user to enter the url of a website. And the > > script must

RE: [PHP] Create a screenshot of a website

2009-10-22 Thread Andrea Giammarchi
Regards > Date: Thu, 22 Oct 2009 09:40:47 -0400 > From: rob...@interjinn.com > To: an_...@hotmail.com > CC: reseas...@gmail.com; php-general@lists.php.net > Subject: Re: [PHP] Create a screenshot of a website > > Andrea Giammarchi wrote: > > What you see is what a brows

RE: [PHP] Create a screenshot of a website

2009-10-22 Thread Andrea Giammarchi
What you see is what a browser engine renders for your eyes while what you can do with PHP is a snapshot of the source code. Regards > Date: Thu, 22 Oct 2009 09:28:15 -0400 > From: reseas...@gmail.com > To: php-general@lists.php.net > Subject: [PHP] Create a screenshot of a website > > Hi, >

RE: [PHP] how call a variable in a text

2009-10-22 Thread Andrea Giammarchi
> I don't think it is about readability: > > $arr[3] = 'test'; > $test = 3; > > //This prints "$test" > echo "This doesn't work: $$arr[3]"; > > //This prints 3 > echo "This works: ${$arr[3]}"; > > Using the same type way as before in this thread. Above example is a classic one where readabil

RE: [PHP] how call a variable in a text

2009-10-22 Thread Andrea Giammarchi
> So no they are not meant to go around. You can use them this way as well. that has almost the same meaning of $_ = '_POST'; echo count($$_); which again, for readability brackets are suggested to improve maintainability $_ = '_POST'; echo count(${$_}); Regards

RE: [PHP] how call a variable in a text

2009-10-22 Thread Andrea Giammarchi
> Erm, the braces are meant to go *around* the variable, not around a bit > of it: > > print "Test: {$var[0][0]}"; unrelated, just another usage of curly brackets $_ = 'abc'; $i = 0; echo $_{++$i}; // b Regards __

RE: [PHP] how call a variable in a text

2009-10-22 Thread Andrea Giammarchi
Curly brackets are usually highlighted as well so it is a good practice, generally speaking, to use them for double quoted strings and maintainability increase automatically. Regards > From: esam...@barc.gov.in > To: php-general@lists.php.net > Date: Thu, 22 Oct 2009 11:31:53 +0530 > Subject:

RE: [PHP] Sanitizing potential MySQL strings with no database connection

2009-10-21 Thread Andrea Giammarchi
I so much avoid the silent char that sometimes I even forget this exists. I guess it is worth it for this case. Regards > Date: Tue, 20 Oct 2009 21:28:06 +0200 > From: dotanco...@gmail.com > To: php@emax.dk > CC: a...@ashleysheridan.co.uk; php-general@lists.php.net > Subject: Re: [PHP] Sani

RE: [PHP] Sanitizing potential MySQL strings with no database connection

2009-10-20 Thread Andrea Giammarchi
even better $error_reporting = error_reporting(0); if(mysql_real_escape_string($variable) === false) { error_reporting($error_reporting); // create a default DB connection } else error_reporting($error_reporting); unset($error_reporting); > From: an_...@hotmail.com > To: a...@ash

RE: [PHP] Sanitizing potential MySQL strings with no database connection

2009-10-20 Thread Andrea Giammarchi
> If says: > > Returns the escaped string, or FALSE on error. > > So all you have to do, is have warnings turned off (as it generates an > E_WARNING if you have no active connection) and then look at the return > value of a call to the function: > > if(mysql_real_escape_string($variable) === fa

RE: [PHP] Sanitizing potential MySQL strings with no database connection

2009-10-20 Thread Andrea Giammarchi
> Your only option might be to do something "smart". You can't use the > proper mysql functions without a connection to a database, but you > refuse to connect to a database until after you perform validation... > > You do realise you can have several db connections open at one time, so > you co

RE: [PHP] Built-in Debugging

2009-10-16 Thread Andrea Giammarchi
Specially suited for Ajax interaction, you may be interested into Formaldehyde: http://code.google.com/p/formaldehyde/ Regards > Date: Thu, 15 Oct 2009 17:39:14 -0700 > From: xwis...@yahoo.com > To: php-general@lists.php.net > Subject: [PHP] Built-in Debugging > > Hello, > > Will be ever see b

RE: [PHP] How to bypass (pipe) curl_exec return value directly to a file?

2009-10-13 Thread Andrea Giammarchi
e? > From: larstor...@gmail.com > To: an_...@hotmail.com > CC: magda.hasib...@yahoo.co.uk; php-general@lists.php.net > > 2009/10/13 Andrea Giammarchi : > > > >> > curl_setopt($ch, CURLOPT_CONNECTTIMEOUT, 0); > >> > >> I wouldn't recommend settin

RE: [PHP] How to bypass (pipe) curl_exec return value directly to a file?

2009-10-13 Thread Andrea Giammarchi
> > curl_setopt($ch, CURLOPT_CONNECTTIMEOUT, 0); > > I wouldn't recommend setting this to 0 unless you're very sure that > the connection will succeed; otherwise, your script will hang > indefinitely waiting for the connection to be made. agreed, it's just he set timeout to zero so I guess he m

RE: [PHP] How to bypass (pipe) curl_exec return value directly to a file?

2009-10-13 Thread Andrea Giammarchi
> $ch = curl_init($url); > $fp = fopen('/tmp/curl.out', 'w'); > curl_setopt($ch, CURLOPT_FILE, $fp); > curl_exec($ch); > > Error checking etc. is of course left up to you. :) oops, I sent directly the file name. Let me reformulate the code then: set_time_limit(0); $fp = fopen('stream.

RE: [PHP] How to bypass (pipe) curl_exec return value directly to a file?

2009-10-13 Thread Andrea Giammarchi
I guess this should work set_time_limit(0); $ch = curl_init($siteURL); curl_setopt($ch, CURLOPT_RETURNTRANSFER, false); curl_setopt($ch, CURLOPT_BINARYTRANSFER, true); curl_setopt($ch, CURLOPT_CONNECTTIMEOUT, 0); curl_setopt($ch, CURLOPT_FILE, 'stream.bin'); curl_exec($ch); Regards > From: magd

RE: [PHP] Need unrounded precision

2009-10-12 Thread Andrea Giammarchi
bitwise right shift is probably the fastest cast to int so far ... still in many languages, intval is a function call being a cast in both cases (int) is good as well ... bitwise, casting, works with strings, arrays, boolean, whatever as well. I don't think there is any difference in php, exce

RE: [PHP] Need unrounded precision

2009-10-12 Thread Andrea Giammarchi
> Couldn't this be done with just simple math functions? indeed: $a = 28.56018; $b = $a * 10 % 10 >> 0; Regards _ Windows Live Hotmail: Your friends can get your Facebook updates, right f

RE: [PHP] Need unrounded precision

2009-10-12 Thread Andrea Giammarchi
> Hmmm... Didn't think about this, but % only works with int values it was just future prof precaution since this statement is false for many other languages. In few words I am not sure PHP6 does the same ... never mind so far Regards __

RE: [PHP] Wrighting to $_POST array

2009-10-12 Thread Andrea Giammarchi
> But, first, you need to use get_magic_quotes_gpc() to see if magic_quotes_gpc > is > turned on. If so, you need to run stripslashes() on your variables before you > run the mysql_real_escape_string() on them. > > > if ( get_magic_quotes_gpc() ) { > $_POST = array_map('stripslashes', $_P

RE: [PHP] Correct handling _POST[] and implode. PHP5

2009-10-09 Thread Andrea Giammarchi
> Date: Fri, 9 Oct 2009 02:07:55 -0700 > From: adam.p.reyno...@gmail.com > To: php-general@lists.php.net > Subject: RE: [PHP] Correct handling _POST[] and implode. PHP5 > > > I just realised I have get_magic_quotes_gpc turned on and was not catering > for arrays. > that's why I asked about P

RE: [PHP] Correct handling _POST[] and implode. PHP5

2009-10-09 Thread Andrea Giammarchi
> so it's simple, it's not an array, but your assignment magically makes it an > array since you wrote "iterate over the array" ... very, very clear, isn't it? OK, sarcasm a part, this works perfectly for me, and it's quite obvious Colors IS an array ... Green Yellow Red

RE: [PHP] Correct handling _POST[] and implode. PHP5

2009-10-09 Thread Andrea Giammarchi
> Its very obvious that $_POST["color"] is not an array. > > do something like this and you wil get the values. > > $arr_color = $_POST["colors"]; > > //iterate over the array > foreach($arr_color as $val) > { > $str_color .= ", " . $val; > } so it's simple, it's not an array, but your a

RE: [PHP] Correct handling _POST[] and implode. PHP5

2009-10-09 Thread Andrea Giammarchi
> > echo $_POST['Colors'] . ''; // outputs 'Array' try with echo '', var_dump($_POST['Colors']), ''; to be sure abot the structure. Also, which PHP version? Regards _ Keep your friends

RE: [PHP] Whacky increment/assignment logic with $foo++ vs ++$foo

2009-10-07 Thread Andrea Giammarchi
> Easy there hoss, no need to get worked up. In my opinion, being blamed for natural optimizations is the most ridiculous, hilarious, anti professional behavior I have ever seen ... but you are right, no need to get worked up, so have fun here. Regards

RE: [PHP] Whacky increment/assignment logic with $foo++ vs ++$foo

2009-10-07 Thread Andrea Giammarchi
> This is a great talk / slideshow and definitely is a better way to > drive home the point that PHP execution speed is relatively > meaningless in terms of user experience. Well, at least up to a > point... if it takes 0.1 per response, with 10 users will be 1 second to wait ... if it takes

RE: [PHP] Whacky increment/assignment logic with $foo++ vs ++$foo

2009-10-07 Thread Andrea Giammarchi
I don't get why for you code style means effort, waste of time ... I bloody write code, how do you write a loop? The same as I do ... except I put ++i rather than i++ ... does it change ANYTHING? For you no, for me yes ... whre is the drama here? I cannot spot it, it's like saying: I don't kn

RE: [PHP] Whacky increment/assignment logic with $foo++ vs ++$foo

2009-10-07 Thread Andrea Giammarchi
> > I can write a test[1] that comes out with these results: > String concat time: 0.18807196617126 > String interpolation time: 0.14288902282715 > Where using " is faster than ' ! Common wisdom be damned! where is the test? ... and, is that kind of test where you put 12345678 variables ins

RE: [PHP] Insult my code!

2009-10-07 Thread Andrea Giammarchi
So far I stopped at the first line, the constructor, where I can spot with what I can read SQL injections "everywhere" I hope here is a proper validation there, 'cause as is, sounds truly dangerous, since you are not using bindParams or other PDO related techniques to avoid input problems. Ab

RE: [PHP] Whacky increment/assignment logic with $foo++ vs ++$foo

2009-10-07 Thread Andrea Giammarchi
> So while we can debate computing considerations of today, tomorrow > those will be less important. That was the point I was making. Why > not focus on things that make significant difference and let the > insignificant fade into history. I tendentiously focus on all things able to make, all

RE: [PHP] Whacky increment/assignment logic with $foo++ vs ++$foo

2009-10-06 Thread Andrea Giammarchi
> if used properly, could avoid recursion, and speed up operations ... there is > nothing wrong with goto, everything we write on lowest level is a jump in the > memory (as goto is a jump in the code flow) > > ++goto ... and not goto++ I forgot, I have always used goto in Batch script, which

RE: [PHP] Whacky increment/assignment logic with $foo++ vs ++$foo

2009-10-06 Thread Andrea Giammarchi
> Speaking of starting a conversation, what do you think about the "goto" > construct introduced just recently? if used properly, could avoid recursion, and speed up operations ... there is nothing wrong with goto, everything we write on lowest level is a jump in the memory (as goto is a jump

RE: [PHP] Whacky increment/assignment logic with $foo++ vs ++$foo

2009-10-06 Thread Andrea Giammarchi
> Eddie: > > And thanks for supporting my point. so you think as well that 3 characters, written like this i++, in a careless way, or like this ++i, make the difference about time spent to develop ... interesting Regards

RE: [PHP] Whacky increment/assignment logic with $foo++ vs ++$foo

2009-10-06 Thread Andrea Giammarchi
ah ah ah that's for sure, I've never said that is correct, I said that is illogical ;-) > Subject: RE: [PHP] Whacky increment/assignment logic with $foo++ vs ++$foo > Date: Tue, 6 Oct 2009 12:46:36 -0500 > From: jblanch...@pocket.com > To: an_...@hotmail.com; tedd.sperl...@gmail.com; php-ge

RE: [PHP] Whacky increment/assignment logic with $foo++ vs ++$foo

2009-10-06 Thread Andrea Giammarchi
> Furthermore, the amount > of time micro-optimization takes up (going through old code, I mean) > could be better spent doing something that actually does increase your > performance, like implementing a search engine or memcached. Going > forward, if you're aware that ++i and i++ are the same

RE: [PHP] Whacky increment/assignment logic with $foo++ vs ++$foo

2009-10-06 Thread Andrea Giammarchi
.net > From: tedd.sperl...@gmail.com > Subject: RE: [PHP] Whacky increment/assignment logic with $foo++ vs ++$foo > > At 3:56 PM +0200 10/6/09, Andrea Giammarchi wrote: > > > Does these behaves exactly? > >> for($i=0; $i<10; ++$i) > >> for($i=0; $i<10; $i++) &

RE: [PHP] Whacky increment/assignment logic with $foo++ vs ++$foo

2009-10-06 Thread Andrea Giammarchi
> Does these behaves exactly? > for($i=0; $i<10; ++$i) > for($i=0; $i<10; $i++) different benchmarks showed ++$i is usually faster than $i++ In that loop case, yes, what's happen internally is exactly the same, $i will be from 0 to 9, in the other case obviously is not the same. but pre increm

RE: [PHP] Whacky increment/assignment logic with $foo++ vs ++$foo

2009-10-06 Thread Andrea Giammarchi
> It will be an accident > if you get the results you are expecting. I agree that the operation is illogical, I must disagree about accidents. In PHP that operation will mean assign to the new $a variable the value returned from the other $a variable before the increment. There is no mystery

RE: [PHP] A really wacky design decision

2009-10-06 Thread Andrea Giammarchi
> but is implicitly converted into strings when it is entered. use floatVal($str1) === floatVal($str2) then ... I honestly cannot spot any problem in what you wanna do, I can just spot an error in the root of the process: threat strings as numbers, comparing potatoes and tomatoes ... there a

RE: [PHP] Header problem

2009-10-05 Thread Andrea Giammarchi
> There's a useful function called headers_sent() which checks to see if > the headers have already been sent to the browser. This might be a good > place to throw into your code at various points to check and see if > something is being written which you don't expect. true, check that as well,

RE: [PHP] Header problem

2009-10-05 Thread Andrea Giammarchi
> Sorry, the .phps file wasn't updated, but the page still works as > expected even though I've printed stuff after the header (i tested that > just for fun). I already said magic behavior are not part of my developed code, unrelated output is an error, even if the download work, it is an err

RE: [PHP] SWF Manipulation with PHP

2009-10-05 Thread Andrea Giammarchi
AFAIK, you can create snaps from ActionScript, but you cannot save browser rendered plug-in content via PHP It's more like canvas.toDataURL, it requires to be rendered, unless you don't have InDesign or something similar able to render internally and export as image. Regards > Date: Mon, 5 Oc

RE: [PHP] Developer Question [DOMDocument]

2009-10-05 Thread Andrea Giammarchi
Date: Mon, 5 Oct 2009 13:11:12 +0100 > Subject: RE: [PHP] Developer Question [DOMDocument] > > On Mon, 2009-10-05 at 13:59 +0200, Andrea Giammarchi wrote: > > > > > > search engines aren't case-sensitive! > > > > ... try to search php.net or PHP.NET

RE: [PHP] Developer Question [DOMDocument]

2009-10-05 Thread Andrea Giammarchi
My apologies I read search engines ARE case sensitive ... never mind, still DomDocument and DOMDocument are the same. Regards > From: an_...@hotmail.com > To: a...@ashleysheridan.co.uk; mickael+...@lupusmic.org > CC: php-general@lists.php.net > Date: Mon, 5 Oct 2009 13:59:43 +0200 > Subject: R

RE: [PHP] Developer Question [DOMDocument]

2009-10-05 Thread Andrea Giammarchi
> search engines aren't case-sensitive! ... try to search php.net or PHP.NET in Google and you'll obtain exactly the same result ... in PHP strtolower and strToLower are exactly the same, as the same is DomDocument, DOMDocument, or DOMDOCUMENT, at least in PHP 5.3 If you used an early versio

RE: [PHP] Developer Question [DOMDocument]

2009-10-05 Thread Andrea Giammarchi
saveXML and transform it via XSL It should be simple since basically the only thing you have to do is to replicate everything adding right at the beginning and nothing else. Is this solution suitable for your requirements? Regards > Date: Mon, 5 Oct 2009 01:45:03 -0700 > From: mpet...@mac.c

RE: [PHP] strtotime strangeness

2009-10-04 Thread Andrea Giammarchi
Did the OS update changed the default locale settings or the default date format? > From: fres...@adex-intl.com > To: php-general@lists.php.net > Date: Sun, 4 Oct 2009 14:05:05 -0400 > Subject: [PHP] strtotime strangeness > > For some reason the strtotime is no longer returning the year > por

RE: [PHP] [SOLVED] class to generate Javascript Object ??

2009-10-04 Thread Andrea Giammarchi
> Thank you, worked beautifully. just don't ignore this: PHP 5 >= 5.2.0 if you are trying to create something portable, you should consider a Pear fallback ... if(!function_exists('json_encode')){ require_once 'JSON.phps'; // http://mike.teczno.com/JSON/JSON.phps function json_en

RE: [PHP] Header problem

2009-10-04 Thread Andrea Giammarchi
quot;links" at the end of the page ... Regards > Date: Sun, 4 Oct 2009 19:09:35 +0200 > From: php@emax.dk > To: php-general@lists.php.net > Subject: Re: [PHP] Header problem > > Hello Andrea > > Andrea Giammarchi wrote on 2009-10-04 18:49: > > > > &

RE: [PHP] Header problem

2009-10-04 Thread Andrea Giammarchi
> Afaik, the content length header is not necessary, but it will cause > problems if it's set and it's wrong. correct, missed Content-Length means the classic download with useless progress bar and undefined estimation time, problematic for preloader as well in case of images, swf, generic dat

RE: [PHP] Header problem

2009-10-04 Thread Andrea Giammarchi
> Header must come first (before you output anything) or you get a parse > error I try to better explain ... HTTP works like this: you ask something, you receive something, html and texts are just one option. Your example page mess up html, zip, everything, because when you download a file

RE: [PHP] class to generate Javascript Object ??

2009-10-04 Thread Andrea Giammarchi
> I'm thinking (hoping) there is already a php class somewhere for > generating JavaScript object strings that I can instead of my ugly > easily breakable way of doing it. > > Anyone know of one? json_encode http://uk3.php.net/manual/en/function.json-encode.php Regards

RE: [PHP] A really wacky design decision

2009-10-04 Thread Andrea Giammarchi
> All very messy! there is nothing messy, the logic is well defined and for a loose type language it's absolutely normal behavior. Regards _ Keep your friends updated—even when you’re no

RE: [PHP] A really wacky design decision

2009-10-04 Thread Andrea Giammarchi
> $a = 2260; $b = 226e1; $c = 2.26e3; $d = 2260.0; > > $a==$b==$c==$d, > > and > $b===$c===$d $b , $c, and $d are the same indeed ... they represent the floating point 2260.0 in I think every language ... it's like saying that 1.0 is not 1. ... both floating point numb

RE: [PHP] A really wacky design decision

2009-10-03 Thread Andrea Giammarchi
You introduced the word "suddenly", it's about 10 years I develop in PHP Regards > PHP allows you to do either. If I find myself being more strict in no > way does that mean I'll suddenly jump to another language. It just means > I have a bit of code that requires a bit more strictness. Shoul

RE: [PHP] A really wacky design decision

2009-10-03 Thread Andrea Giammarchi
if we compare via "==" there is an implicit cast to the most primitive form. These are all true, and all have a reason, and make sense: // (int)'abc' is 0 var_dump('abc' == 0); // 'abc' is not an empty string var_dump('abc' == true); // 2 is not 0, which would be casted into false, so it's tru

RE: [PHP] Whacky increment/assignment logic with $foo++ vs ++$foo

2009-10-03 Thread Andrea Giammarchi
> ... and, in fact, that /is/ how C behaves. The following code: > > int a = 2; > a = a++; > printf("a = [%d]\n", a); > > Will output "a = [3]". At least on Ubuntu 9 using gcc 4.3.3. > > So I retract my initial terse reply and apologize for misunderstanding > your question. > > Ben It's not t

RE: [PHP] Header problem

2009-10-03 Thread Andrea Giammarchi
Do you want users download the file or the zip? do you send other headers before the download? It's quite a common error to set a default header in PHP at the beginning of whatever application, while header should be used as last exit point and never in the middle, or at the beginning, of a resp

RE: [PHP] A really wacky design decision

2009-10-03 Thread Andrea Giammarchi
And then you discover === $i = 0; $j = count ($names); while ($i < $j) { if ($names[$i] === $target) { break; } ++$i; } ... regards > To: php-general@lists.php.net > From: clanc...@cybec.com.au > Date: Sat, 3 Oct 2009 21:21:00 +1000 > Subject: [PHP] A really wacky design decision > > D

RE: [PHP] webpage link validation

2009-09-21 Thread Andrea Giammarchi
> Several ways that I can think of: > > * use the file_get_contents() which like you said, could be > overkill > * shell out to wget to retrieve just the headers for the path. > You'd be looking for a 200 return code, which indicates the URI > exists. >

RE: [PHP] wrong time stamp in log filewrong time stamp in log file

2009-09-21 Thread Andrea Giammarchi
> I have updated a php to version 5.2.11. you should update the keyboard as well, it fires CTRL+V twice (subject, and I am joking ..) > When I run the following script: > print date('d M Y, H:i'); > ?> > It's returns a correct time. correct accordingly with your local time zone, 'cause I am

RE: [PHP] Usage of strlen(tuf8_decode()) and "/u" regex modifier

2009-09-21 Thread Andrea Giammarchi
> $the_string = 'Марина > Орлова'; did you actually wrote this or i tis the PHP ml that converted utf-8 chars? I can read only an ASCII string with length 85 ... please tell me you are not confusing HTML entities with UTF-8 encoded characters ... __

RE: [PHP] Touch screen programming help

2009-09-21 Thread Andrea Giammarchi
Unless PHP Gtk has a module able to create an interface able to capture coordinates in a touchscreen device ... PHP is a web server programming language and it usually works in the server specially suited for web based applications. Regards > From: man...@dotzoo.net > To: php-general@lists.ph

RE: [PHP] Best Practice to Create Dynamic URL's- With Username

2009-09-21 Thread Andrea Giammarchi
> > Question I was Asked by Andrea- "mod_reqrite or .htaccess is the answer, but > I wonder why you choose /user/username rather than just /username a la > twitter." > > I will be using many other aspects of my users something like > "/projects/username/"; "/gallery/username/". well, it does

RE: [PHP] Re: PHP Header issue

2009-09-18 Thread Andrea Giammarchi
> I think this sort of issue arises particularly because of the > misconception that PHP is embedded inside HTML pages. Once a person has > that idea in their head, they will start to work with an HTML template > and add PHP as necessary. While that can work, in cases such as this, > it's best to

RE: [PHP] A little slow lately???

2009-09-18 Thread Andrea Giammarchi
> Maybe people really have started to rtfm! > > Ash well, apparently not everybody, somebody put right now a header call in the middle of the page declaring "there're no white space around, I've checked it!" maybe other realized that a search in the manual takes less time than a mail here ..

RE: [PHP] how i assign a js variable to a php variable

2009-09-18 Thread Andrea Giammarchi
> You can not pass this myPHPvar javascript var as an input in a form. if you > want to change its value and maintein it, must to use an static var, and > only can access to this values via javascript functions where an event is > invoked (in case you want to read or write values) with all due

RE: [PHP] how i assign a js variable to a php variable

2009-09-18 Thread Andrea Giammarchi
Actually, it's even more simple ... forgive me: echo 'var myPHPvar='.json_encode($myPHPvar).';'; that's pretty much it > From: an_...@hotmail.com > To: jonathan.desarro...@gmail.com; mail2gautambha...@gmail.com > CC: saeed@gmail.com; php-general@lists.php.net > Date: Fri, 18 Sep 2009 13:01

RE: [PHP] how i assign a js variable to a php variable

2009-09-18 Thread Andrea Giammarchi
> basicly is use hidden inputs as a container for php variables, and transform > through js. really? I though the other way round was extremely simple: echo 'var myPHPvar=eval("('.addslashes(json_encode($myPHPvar)).')");'; why would you use hidden input, plus DOM to get data, etc, etc? _

RE: [PHP] ie6 "memory could not be read" help!

2009-09-17 Thread Andrea Giammarchi
> In a lot of the work I do these days I have to support IE6 because it's > the defacto browser in various government departments. It'll be sometime > before it is completely ousted. Rob, same is for me, I have to deal with this "browser" all problems it has every single day, 'cause financial

RE: [PHP] how i assign a js variable to a php variable

2009-09-17 Thread Andrea Giammarchi
> I have to disagree Ash, you can pass js variable values to PHP but only > through a page load. Then you could use $_REQUEST, $_POST, $_GET to retrieve > it. I have done this before. And I am sure Ash does it on daily basis, the problem is the used therm: I want to *assign* ... not pass, assig

RE: [PHP] ie6 "memory could not be read" help!

2009-09-17 Thread Andrea Giammarchi
> At that point I would consider IE6 "broke". Every standard conformance test can tell you since years that IE6 is broken. At that point, you'll be exactly in the same situation, if your customers do not want to update for same reason they are not doing right now, why would you leave them "al

RE: [PHP] ie6 "memory could not be read" help!

2009-09-17 Thread Andrea Giammarchi
I wonder what should happen if your customers will ask you PHP 3 applications because their internal server is that old ... and I mean your *current* application for PHP3 ... well, IE 6 has the same impact for the Web Development. I am not saying we can dismiss its support, specially if we work

RE: [PHP] APC - Upload progress problem. apc

2009-09-17 Thread Andrea Giammarchi
> I wonder if massive uploads, like the ones you're coding for, really > aren't that common. I can imagine hard-coding that 3600 myself, and > thinking, "no way someone's going to be uploading a single file for > longer than an hour, or even close to it." me too, also because for a silly connect

RE: [PHP] Insert Symbol into Mysql

2009-09-16 Thread Andrea Giammarchi
> Yeah, the rules say to snip out parts of the convo which aren't > pertinent, but I know I don't exactly follow that one either! :-/ > > Thanks, > Ash > http://www.ashleysheridan.co.uk to be honest the problem is that I am in hotmail rather than gmail here, and this page is not clever as gmai

RE: [PHP] Insert Symbol into Mysql

2009-09-16 Thread Andrea Giammarchi
> If he´s really using a any other charset instead of utf8 table, why not > using utf8_decode and utf8_decode in his php files to solve this? let's say PHP could have a different charset than the one defined in that MySQL table so this is not a portable solution, specially if you do not perfe

RE: [PHP] Insert Symbol into Mysql

2009-09-16 Thread Andrea Giammarchi
> I don't recall him saying that a utf8 table was not an option or that he > wasn't using one. I know 'cause he replied directly to me rather than this ML > > Also, try not to top post ;) I usually hate scroll 'till the end to find often a single row as reply ... I'll try though > > Thanks

RE: [PHP] Insert Symbol into Mysql

2009-09-16 Thread Andrea Giammarchi
He has no utf-8 charset in the table, so the first point is valid and htmlentities is the function ( http://uk.php.net/manual/en/function.htmlentities.php ) You need to remember that in this way you need to use htmlentities for *everything*, specially for searches, otherwise ° against ° will b

RE: [PHP] Insert Symbol into Mysql

2009-09-16 Thread Andrea Giammarchi
does JavaScript use the proper way to encode strings as encodeURIComponent is, and for each sent key/value pair? Is MySQL table charset ut8_general_ci ? If not, do you convert sent UTF-8 charset into table charset? In few words we miss the way/library used to send data, the default PHP charset,

RE: [PHP] best function to use ~ file_get_contents or ?

2009-09-16 Thread Andrea Giammarchi
This is what I said, except if you want to grab the content you need to request HEAD first and eventually GET, and this is slower than just GET parsing headers. In any case, curl is the answer, imho. Regards Requesting only the headers is a lot faster than requesting the headers AND the file

RE: [PHP] best function to use ~ file_get_contents or ?

2009-09-16 Thread Andrea Giammarchi
> The way I've always seen this approached before is by using the wget > command, which can be asked to just return the headers for a page. In > your case you'd be looking for all 200 codes, which means that all the > sites are up. This is faster than asking to return a full image each > time.

RE: [PHP] RE: [Formaldehyde] The Most Basic Ajax - PHP Error Debugger

2009-09-14 Thread Andrea Giammarchi
> > While it's a joke, in all fairness, it does work. only because you debugged before server side responses, and now, as I have said, you have an alternative to speed up that process. Finally, Formaldehyde JS had a typo so only today I realized it and I uploaded the version 1.01 of Formalde

RE: [PHP] RE: [Formaldehyde] The Most Basic Ajax - PHP Error Debugger

2009-09-14 Thread Andrea Giammarchi
> > While it's a joke, in all fairness, it does work. only because you debugged before server side responses, and now, as I have said, you have an alternative to speed up that process. Finally, Formaldehyde JS had a typo so only today I realized it and I uploaded the version 1.01 of Formalde

RE: [PHP] PHP GURU NEEDED

2009-09-14 Thread Andrea Giammarchi
I have already said I am sorry and I explained the reason I replied in such joking way. Now, I am sure you can understand, since you say you use this ML for recruitment as well, that it would be nice to leave this "subject" as clear as possible. I would even suggest authors to create a new

RE: [PHP] APC - Upload progress problem. apc

2009-09-14 Thread Andrea Giammarchi
e other thing, I looked at a canned media management web app ($875 > US) that will do this uploading, and it doesn't require APC, so there > definitely is some way to do this with basic PHP. > > Thanks, Phred > > > > On Sep 14, 2009, at 1:55 PM, Andrea Gia

RE: [PHP] PHP GURU NEEDED

2009-09-14 Thread Andrea Giammarchi
Wht is exactly your problem? If I am that bad I have simply removed myself from the list of possible candidates, if I ever had a chance. Keep blaming other feeling the ruler here does not put you in a better position than a troll. I am sorry for the original message 'cause I thought recruiters

RE: [PHP] PHP GURU NEEDED

2009-09-14 Thread Andrea Giammarchi
people, you need somehow to discuss with them, > creating a relationship based on trust. > > Best, > > On Mon, Sep 14, 2009 at 12:09 PM, Andrea Giammarchi > wrote: > > > > I guess I got instantly fired with "than" rather than "then" ... nevermind &

RE: [PHP] PHP GURU NEEDED

2009-09-14 Thread Andrea Giammarchi
I guess I got instantly fired with "than" rather than "then" ... nevermind > From: an_...@hotmail.com > To: jer...@cyber-duck.co.uk; php-general@lists.php.net > Date: Mon, 14 Sep 2009 20:56:59 +0200 > Subject: RE: [PHP] PHP GURU NEEDED > > > You are looking for me than, cool! > > > Date: Mon,

RE: [PHP] PHP GURU NEEDED

2009-09-14 Thread Andrea Giammarchi
You are looking for me than, cool! > Date: Mon, 14 Sep 2009 18:38:17 +0100 > From: jer...@cyber-duck.co.uk > To: php-general@lists.php.net > Subject: [PHP] PHP GURU NEEDED > > Hi All, > > > > Cyber-Duck are looking for a highly motivated PHP / CSS Guru to join our > award-winning, London bas

RE: [PHP] APC - Upload progress problem. apc

2009-09-14 Thread Andrea Giammarchi
The concept of my last link is this: the instant before you do the upload you ask PHP to scan the tmp folder, or the folder used to upload files (often the tmp) and you snap number of files, then the upload starts, and it will create a temp file with a PHP predefined prefix, you array_diff the

RE: [PHP] APC - Upload progress problem. apc

2009-09-14 Thread Andrea Giammarchi
reat, perhaps you have some > insight into my narrow APC problem. > > One other thing, Eddie was talking about APC not being thread-safe. I > have heard this before, but also heard it refuted. Do you have any > insight on this? > > I am going insane, so any help you can toss

RE: [PHP] APC - Upload progress problem. apc

2009-09-14 Thread Andrea Giammarchi
I am not sure why you ended up with Flash, but here there is a good old example with APC: http://webreflection.blogspot.com/2007/10/upload-progress-bar-with-php5-apc-and.html Regards > CC: php-general@lists.php.net > From: phpl...@planetphred.com > To: oorza...@gmail.com > Date: Mon, 14 Sep 200

  1   2   >