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

2009-06-12 Thread Robin Vickery
Hello Mr HELP! 2009/6/12 HELP! izod...@gmail.com I can not get the stream_get_contents() to work.  it's returning empty. Is that simply because there's nothing to read from the socket? If you have a login details ALOGINPASS 1A cant you just fwrite($ft, ALOGINPASS 1A); or do you need to add

Re: [PHP] order by what?

2009-06-11 Thread Robin Vickery
2009/6/11 PJ 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 problem for both caps normal letters. Depends on the database. If you're using mysql, the order is governed by the collation

Re: [PHP] order by what?

2009-06-11 Thread Robin Vickery
2009/6/11 PJ af.gour...@videotron.ca Robin Vickery wrote: 2009/6/11 PJ af.gour...@videotron.ca 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 problem for both

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

2009-06-10 Thread Robin Vickery
2009/6/8 HELP! izod...@gmail.com opening of the sorket is ok and writting LOGIN packet to the sorket is also ok but reading the response to know if the login is accepted or rejected is a not OK. Don't use fread() to read from sockets, use stream_get_contents(). Example 3 on the fread()

Re: [PHP] Show the entire browser request

2009-06-10 Thread Robin Vickery
2009/6/10 Dotan Cohen dotanco...@gmail.com 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 sent the original message? The individual headers are as they always

Re: [PHP] Show the entire browser request

2009-06-10 Thread Robin Vickery
2009/6/10 Robin Vickery rob...@gmail.com 2009/6/10 Dotan Cohen dotanco...@gmail.com 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 sent the original message

Re: [PHP] PCI compliance issue

2009-06-02 Thread Robin Vickery
2009/6/2 Skip Evans s...@bigskypenguin.com Hey all, The original programmer created the following in the system's .htaccess file: RewriteCond %{REQUEST_FILENAME} !-f RewriteCond %{REQUEST_FILENAME} !-d RewriteRule .* index.php ...which sends any incorrect URL to the home page, correct?

Re: [PHP] return language of a word

2008-09-29 Thread Robin Vickery
2008/9/29 shahrzad khorrami [EMAIL PROTECTED]: hi all, is there any function to return us the lanuage of a word in the sentence? for example : My name is شهرزاد . when it sees شهرزاد notice that is a persian language. As others have said, you can check what unicode block the characters are

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

2008-09-01 Thread Robin Vickery
2008/8/30 Per Jessen [EMAIL PROTECTED]: tedd wrote: What some browser developers did was to NOT make the conversion from PUNYCODE to the correct code-points but rather show the PUNYCODE as-is, which was never the intent of the IDNS WG. This act defeated the entire process of allowing

Re: [PHP] If Column Exists

2008-08-13 Thread Robin Vickery
2008/8/12 VamVan [EMAIL PROTECTED]: Hello, I am working on data migration for one mysql db to another using PHP. How do I check if a particular table has a particular column. If not alter... Thanks Use the information_schema: SELECT COUNT(*) AS column_exists FROM

Re: [PHP] Math Weirdness

2008-07-15 Thread Robin Vickery
2008/7/15 tedd [EMAIL PROTECTED]: I said: Round-off errors normally don't enter into things unless your doing multiplication and division operations. And that is not Bull -- it's true. You can add and subtract all the floating point numbers (the one's we are talking about here) you want

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

2008-07-09 Thread Robin Vickery
2008/7/9 Aschwin Wesselius [EMAIL PROTECTED]: tedd wrote: Hi gang: I'm running a Mac (so I know mine is a bit different size wise) but I'm currently using Veranda at 14 point for coding. Just out of curiosity, what font and size do you ppls use for your programming? Cheers, tedd 6pt

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: /cruelWorld or /Dan or ?php function dan($dateOfDeath)

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) yet. And while you might get tech support out of hours

Re: [PHP] UK PHP Host/Developer Required

2008-06-13 Thread Robin Vickery
2008/6/13 Iv Ray [EMAIL PROTECTED]: 2. It's useful if the host company and the client keep the same office hours. If you have a hosting company with 9 to 5 office hours, you are dead, even if it is next door. Out of hours technical support often gets billed at a punitive rate. Which is a

Re: [PHP] validating # sign in php

2008-05-30 Thread Robin Vickery
2008/5/29 Sudhakar [EMAIL PROTECTED]: my question is about validation using php. i am validating a username which a user would enter and clicks on a image to find if that username is available. example if a user enters abc#123 php file is reading this value as abc ONLY which i do not want

Re: [PHP] looking a regular expresion

2008-05-28 Thread Robin Vickery
2008/5/27 Manuel Pérez López [EMAIL PROTECTED]: Hello: I need to include a pair of negations with two complete word into a regular expresion for preg_replace. How to do this? I want to replace I want to be a SUN and a SIR with FRIKI FRIKI FRIKI FRIKI FRIKI SUN FRIKI FRIKI SIR ie. the words

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

2008-05-22 Thread Robin Vickery
2008/5/21 Stut [EMAIL PROTECTED]: I was going to ignore this, but I'm in a confrontational mood today, so please accept my apologies for the noise. On 21 May 2008, at 14:08, Michelle Konzack wrote: Am 2008-05-12 15:40:54, schrieb Stut: Note: I am working for the french Ministry of Defense.

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

2008-05-22 Thread Robin Vickery
2008/5/22 Philip Thompson [EMAIL PROTECTED]: I'm sure Stut (and others) have said enough, but I can no longer resist... On May 21, 2008, at 8:08 AM, Michelle Konzack wrote: Am 2008-05-12 15:40:54, schrieb Stut: I do not know, what this urchinTacker() does, but since it is named

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.php.net/) To

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 character

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

2008-05-14 Thread Robin Vickery
2008/5/14 Per Jessen [EMAIL PROTECTED]: All, not really PHP related, but I figured someone here would already have solved this problem. I've got a page with a single img. I change the src attribute dynamically using javascript. Although the images being served all have long expiry

Re: [PHP] Re: A Little Something.

2008-05-13 Thread Robin Vickery
2008/5/13 Stut [EMAIL PROTECTED]: On 13 May 2008, at 09:04, Peter Ford wrote: I think the onus is on the coders of Urchin to document how to avoid errors when Javascript is disabled, not the site developer who uses it. Just to repeat a point I made yesterday which was clearly either

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 the coders of Urchin to document how to avoid errors when Javascript is disabled

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

2008-05-01 Thread Robin Vickery
2008/5/1 Richard Luckhurst [EMAIL PROTECTED]: Hi Chris, In perl ther is the concept of @_ which is the list of incoming parameter to a subroutine. It is possible to have something like my $sock = shift; As I understand this the first parameter of the @_ list would be shifted. I

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 (see converting

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 Subject: Re: [PHP] What is the practical use of abstract

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

2008-04-16 Thread Robin Vickery
On 16/04/2008, Jay Blanchard [EMAIL PROTECTED] wrote: [snip] What about encapsulation? Interfaces have nothing to do with encapsulation for the smple reason that I can have encapsulation without using interfaces. Unique use of logic there. By similar reasoning; swimming trunks have

Re: [PHP] Evaluating math without eval()

2008-04-11 Thread Robin Vickery
On 10/04/2008, Jason Norwood-Young [EMAIL PROTECTED] wrote: On Thu, 2008-04-10 at 13:15 +0100, Richard Heyes wrote: First post to this list! I'm trying to figure out how to evaluate a string with a mathematical expression and get a result, but without using eval() as I'm accepting

Re: [PHP] PHP GD library installing

2008-04-10 Thread Robin Vickery
On 10/04/2008, Thijs Lensselink [EMAIL PROTECTED] wrote: Quoting Luca Paolella [EMAIL PROTECTED]: How do I install/activate the GD library with my existing PHP version? I'm quite sure it isn't already, since I got this error: Fatal error: Call to undefined function imagecreate() in

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]: How do I install/activate the GD library with my existing PHP version? I'm

Re: [PHP] Re: Quick email address check

2008-03-28 Thread Robin Vickery
On 28/03/2008, Bastien Koert [EMAIL PROTECTED] wrote: On Thu, Mar 27, 2008 at 10:23 PM, Bill Guion [EMAIL PROTECTED] wrote: At 1:28 PM -0400 3/26/08, Al wrote: I'm scripting a simple registry where the user can input their name and email address. I'd like to do a quick

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 =

Re: [PHP] Possible using XPath?

2008-03-27 Thread Robin Vickery
On 27/03/2008, Christoph Boget [EMAIL PROTECTED] wrote: Let's say I have the following structure: ?xml version=1.0 encoding=UTF-8? root child id=c1 child id=gc1 child id=ggc1/ child id=ggc2/ /child

Re: [PHP] Possible using XPath?

2008-03-27 Thread Robin Vickery
On 27/03/2008, Christoph Boget [EMAIL PROTECTED] wrote: Is that possible? Or is this something I'd have to do programatically using the nodes returned by the XPath query? Basically, I'm just trying to get a fragment of the larger xml document... //[EMAIL

[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

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}'); I would use:

[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 interpolate an array element within a string, the index

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 tested the script and it worked,

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 where

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} applies to the space character. -robin -- PHP

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/Memoization). -robin -- PHP General Mailing List

Re: [PHP] Generating Random Numbers with Normal Distribution

2007-12-12 Thread Robin Vickery
On 12/12/2007, Daniel Brown [EMAIL PROTECTED] wrote: On Dec 12, 2007 9:00 AM, tedd [EMAIL PROTECTED] wrote: At 3:04 PM -0500 12/10/07, Daniel Brown wrote: Unfortunately, because computers are logical, there's no such thing (at least as of yet) as a truly random number being generated

Re: [PHP] Generating Random Numbers with Normal Distribution

2007-12-11 Thread Robin Vickery
On 10/12/2007, Nathan Nobbe [EMAIL PROTECTED] wrote: On Dec 10, 2007 5:29 PM, Robert Cummings [EMAIL PROTECTED] wrote: On Mon, 2007-12-10 at 14:22 -0600, Jay Blanchard wrote: [snip] Can you say for certain nature is truly random? Just because the seed may have occurred 13.7 billion

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

2007-11-29 Thread Robin Vickery
On 28/11/2007, AmirBehzad Eslami [EMAIL PROTECTED] wrote: On Wednesday 21 November 2007 03:14:43 Ronald Wiplinger wrote: I have an application, where I use pictures. The size of the picture is about 90kB and to speed up the preview, I made a thumbnail of each picture which is about 2.5 to

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

2007-11-16 Thread Robin Vickery
On 16/11/2007, Paul van Haren [EMAIL PROTECTED] wrote: I'm trying to use arrays to implement a sort of data tree. For the code to work, it is essential that the nodes can be edited after they have become part of the tree. That would require that the array elements are pushed by reference

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

2007-11-13 Thread Robin Vickery
On 12/11/2007, Ronald Wiplinger [EMAIL PROTECTED] wrote: Chris wrote: Ronald Wiplinger wrote: My php program is working with Firefox, but not with Internet Explorer. Nothing to do with php, your problem is javascript. Is there a tool to find the problem? For IE, try

Re: [PHP] Re: Help with preg_replace

2007-11-08 Thread Robin Vickery
On 08/11/2007, Jochem Maas [EMAIL PROTECTED] wrote: Al wrote: Delimiters needed. Can use about anything not already in your pattern. / is very commonly used; but I like # or % generally; but, you can't use % because your pattern has it. $html = preg_replace(#%ResID#,$bookid,$html);

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

2007-11-07 Thread Robin Vickery
On 07/11/2007, kNish [EMAIL PROTECTED] wrote: Hi, A newbie question. I have more than one table to access from a database. When I use the code as below, it gives no response on the web page. What may I do to run more than one table from the same database into the script. Firstly, turn

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

2007-11-06 Thread Robin Vickery
On 06/11/2007, Neil Saunders [EMAIL PROTECTED] wrote: Hi All, I'm experiencing some differences in in the return values of strftime on Windows Linux platforms on PHP 5.2.1. I've knocked up a test case to demonstrate the bug: ?php $UNIX_TIME = mktime(0,0,0,5,31,2008); echo Time Made for

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/London Production: Default timezone

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

2007-11-05 Thread Robin Vickery
On 05/11/2007, Zoltán Németh [EMAIL PROTECTED] wrote: 2007. 11. 5, hétfő keltezéssel 06.10-kor Ronald Wiplinger ezt írta: Jim Lucas wrote: Ronald Wiplinger wrote: I have a file linked with require into my program with statements like: define(_ADDRESS,Address); define(_CITY,City);

Re: [PHP] while-do +array

2007-10-31 Thread Robin Vickery
On 31/10/2007, Steven Macintyre [EMAIL PROTECTED] wrote: Hiya, I have the following code ... which only seems to result in one item ... which is incorrect ... can anyone spot my problem? if ($armbase != ) { $options = explode(,, $armbase); $text .=

Re: [PHP] Not Null?

2007-10-31 Thread Robin Vickery
On 31/10/2007, Steve Marquez [EMAIL PROTECTED] wrote: Greetings, I have a script that looks for the variable to be NULL and then execute. Is there a way for the script to look for anything or something in the variable and then execute? Ex: If (Œ$a¹ == Œ ANYTHING¹) { oh dear, krazee

Re: [PHP] REGEX: grouping of alternative patterns

2007-10-30 Thread Robin Vickery
On 30/10/2007, Stijn Verholen [EMAIL PROTECTED] wrote: Hey list, I'm having problems with grouped alternative patterns. The regex I would like to use, is the following:

Re: [PHP] moving over to php 5

2007-10-30 Thread Robin Vickery
On 30/10/2007, Per Jessen [EMAIL PROTECTED] wrote: Larry Garfield wrote: On Monday 29 October 2007, Per Jessen wrote: Cristian Vrabie wrote: Hmm 117,223 hosts with php4 only support. Did you actually checked how many have php5 support? Many more. There are 178.112 hosters that have

Re: [PHP] Limitations of preg_replace?

2007-10-25 Thread Robin Vickery
On 25/10/2007, Werner Schneider [EMAIL PROTECTED] wrote: Hi. Are there any limitations of preg_replace and is there a way to change them (for example with ini_set)? I got a php 4.4.7 on a linux-webhoster which crashes without error-message on this script: ?php $txt = ;

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: ?php function solution1($var1){ // some code } function solution2($var2){ // some

Re: [PHP] problem calling functions

2007-10-19 Thread Robin Vickery
On 19/10/2007, afan pasalic [EMAIL PROTECTED] wrote: hi I have a problem with calling functions: ?php function solution1($var1){ // some code } function solution2($var2){ // some code } function solution3($var3){ // some code } if ($function == 'solution1'

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 give a

Re: [PHP] Case insensitive ksort

2007-09-18 Thread Robin Vickery
On 18/09/2007, Christoph Boget [EMAIL PROTECTED] wrote: I looked in the docs but didn't see anything regarding case insensitivity and I fear the functionality doesn't exist. I'm just hoping I'm looking in the wrong place. Is there a way to get ksort to work without regard to case? When I

Re: [PHP] Validating Email Conditional

2007-08-03 Thread Robin Vickery
. 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: On 02/08/07, CK [EMAIL PROTECTED] wrote: Hi, Would you point out why

Re: [PHP] Validating Email Conditional

2007-08-02 Thread Robin Vickery
On 02/08/07, CK [EMAIL PROTECTED] wrote: Hi, Would you point out why? As I've tested a range of email address, and have not found one rejected that is formatted correctly. ok, here's a few perfectly valid email addresses off the top of my head. The first one's especially annoying as I use it

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

2007-08-02 Thread Robin Vickery
On 02/08/07, js [EMAIL PROTECTED] wrote: Hi list. I'm trying to write a ORM in PHP. I want the ORM to have metadata mapping, which have a list of properties name and the value, without using any external file. (I like simple one, not want messy XML) I'm thinking PHP's reflective

Re: [PHP] Validating Email Conditional

2007-08-01 Thread Robin Vickery
On 01/08/07, CK [EMAIL PROTECTED] wrote: Hi, My script is working, [...] $regexp = ^([_a-z0-9-]+)(\.[_a-z0-9-]+)*@([a-z0-9-]+)(\.[a-z0-9-] +)*(\.[a-z]{2,4})$; If your script is using that regular expression to validate email addresses then your script is most definitely not working.

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 value. Currently,

Re: [PHP] Array difficulty

2007-07-31 Thread Robin Vickery
On 31/07/07, Alister Bulman [EMAIL PROTECTED] wrote: On 31/07/07, Carlton Whitehead [EMAIL PROTECTED] wrote: Couldn't you just do arsort($chance); $lastItem = chance[( count( $chance ) - 1 )]; I tried that earlier, but the problem is: count( $chance ) - 1 ); returns an integer, so I

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

2007-07-31 Thread Robin Vickery
On 31/07/07, Ken Tozier [EMAIL PROTECTED] wrote: Turns out that objects returned from SQL queries contain two parts for every field, one with a string key and one with an index key. Adding an is_numeric test on the keys allows you to filter out the numeric keys if you want to. For example: Or

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

2007-07-25 Thread Robin Vickery
On 24/07/07, Chris Mika [EMAIL PROTECTED] wrote: I don't know if I'm doing something wrong or if this is a bug. Very simply: I created an array with values 1-5. I use a foreach loop to iterate over it to add 1 to the values. It correctly iterates over the array except for the last value. Code:

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, giant red

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 in an array value or not: e.g. $var1 = big

Re: [PHP] Disadvantages of output buffering

2007-06-26 Thread Robin Vickery
On 26/06/07, Robert Cummings [EMAIL PROTECTED] wrote: On Tue, 2007-06-26 at 14:09 +0100, Stut wrote: Robert Cummings wrote: On Tue, 2007-06-26 at 14:33 +0200, Emil Edeholt wrote: Hi! My php project would get a much cleaner code if I could set cookies anywhere in the code. So I thought

Re: [PHP] Byte conversion

2007-06-25 Thread Robin Vickery
On 25/06/07, Eric Butera [EMAIL PROTECTED] wrote: I've been trying to figure out a way to do this all day and I'm afraid I might need a bit of help. Basically I am trying to port over something from Java to PHP and I'm stuck on one particular piece of code: if ((ba[i + 0] == (byte)0xa7) (ba[i

Re: [PHP] Counting Capital Letters

2007-06-21 Thread Robin Vickery
On 21/06/07, Richard Davey [EMAIL PROTECTED] wrote: Hi, I've written a short regexp which will *count* how many capital letters are in a given string (the woefully simple: '/[A-Z]/') Although it's an English language web site, I'm curious how you'd count capital letters that span beyond just

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 $userparam exists in the $_POST array // and get all the values

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'][], $_POST)

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

2007-06-17 Thread Robin Vickery
On 13/06/07, Richard Davey [EMAIL PROTECTED] wrote: Hi Robert, Wednesday, June 13, 2007, 3:15:39 PM, you wrote: It's terribly verbose and inefficient... ?php $filter['flags'] = 0; if( $allow_fraction ) { $filter['flags'] |= FILTER_FLAG_ALLOW_FRACTION; } if( $allow_thousand ) {

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 That would be pretty broken. There's no guarantee

Re: [PHP] Going from simple to super CAPTCHA

2007-06-13 Thread Robin Vickery
On 12/06/07, Richard Lynch [EMAIL PROTECTED] wrote: On Tue, June 12, 2007 9:33 am, Tijnema wrote: I meant reverse order :P That would be pretty broken. There's no guarantee that browsers will present the inputs in any order at all, even though they all seem (so far) to follow the convention

Re: [PHP] Going from simple to super CAPTCHA

2007-06-12 Thread Robin Vickery
On 10/06/07, Dave M G [EMAIL PROTECTED] wrote: PHP General List, With a little help from the web, and help from this list, I have a simple CAPTCHA image that works within the content system I'm building. But it's *really* simple. Basically white text on a black background, with a couple of

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 the last 2

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 = 500;

Re: [PHP] local v remote

2007-05-31 Thread Robin Vickery
On 31/05/07, blueboy [EMAIL PROTECTED] wrote: On my localhost this works fine $result= mysql_query(SELECT date_format(date, '%d/%m/%Y') as date, title, id, display FROM NEWS); 1. check return values, $result should not be false unless there's a problem. 2. if $result is false, check

Re: [PHP] convert numerical day of week

2007-05-23 Thread Robin Vickery
On 22/05/07, Robert Cummings [EMAIL PROTECTED] wrote: On Tue, 2007-05-22 at 13:47 -0500, Greg Donald wrote: On 5/22/07, Robert Cummings [EMAIL PROTECTED] wrote: Nothing said it was important, but why implement a half-assed solution when you can implement a superior solution in as much time?

Re: [PHP] IE7 = end tag?

2007-05-18 Thread Robin Vickery
On 18/05/07, Jim Moseby [EMAIL PROTECTED] wrote: The extra comma at the end of the array definition is still valid syntax in PHP. Try for yourself: php -r '$a = array(a = foo, b = bar,); print_r($a);' Interesting. Do you mean 'Valid Syntax' in that it 'works without error', or 'Valid

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
On 16/05/07, Lee PHP [EMAIL PROTECTED] wrote: /** Insert record. */ public function insert() { $sql = INSERT INTO table ( . field_1, . field_2, . field_3) . ?, . ?, . ?);

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 EOF BROWSER: $_SERVER[HTTP_USER_AGENT] EOF; Isn't that form (sans quote marks) deprecated and frowned upon? ?php error_reporting( E_ALL ); echo EOF BROWSER: $_SERVER[HTTP_USER_AGENT] EOF; Why would cleaner,

Re: [PHP] slow performance

2007-04-26 Thread Robin Vickery
On 25/04/07, Richard Lynch [EMAIL PROTECTED] wrote: On Wed, April 25, 2007 5:09 am, Zoltán Németh wrote: 2007. 04. 25, szerda keltezÃ(c)ssel 11.53-kor Henning Eiben ezt írta: Zoltán NÃ(c)meth schrieb: not exactly. it pre-compiles them to opcodes and stores the opcode blocks. the

Re: [PHP] Separating words based on capital letter

2007-04-25 Thread Robin Vickery
On 25/04/07, Dotan Cohen [EMAIL PROTECTED] wrote: On 25/04/07, Richard Lynch [EMAIL PROTECTED] wrote: On Tue, April 24, 2007 4:16 pm, Dotan Cohen wrote: I have some categories named in the database as such: OpenSource HomeNetwork I'd like to add a space before each capital letter,

Re: [PHP] Security Best Practice: typecast?

2007-04-02 Thread Robin Vickery
On 01/04/07, Richard Lynch [EMAIL PROTECTED] wrote: So, after a recent thread on data filtering, I'm wondering... Is this good enough in ALL possible Unicode/charset situations: $foo_id = (int) $_POST['foo_id']; $query = insert into whatever(foo_id) values($foo_id); Or is it possible, even

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 as

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 unsubscribe,

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.

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

2007-02-16 Thread Robin Vickery
On 16/02/07, Eli [EMAIL PROTECTED] wrote: Hi, Why isn't there a function that acts like array_pop() returns a pair of key-value rather than the value only ? Reason is, that in order to pop the key-value pair, you do: ?php $arr = array('a'=1,'b'=2,'c'=3,'d'=4); $arr_keys = array_keys($arr);

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 key-value rather than the value only ? Reason

Re: [PHP] most powerful php editor

2007-01-24 Thread Robin Vickery
On 21/01/07, Arno Kuhl [EMAIL PROTECTED] wrote: -Original Message- From: Vinicius C Silva [mailto:[EMAIL PROTECTED] Sent: 21 January 2007 02:54 To: php-general@lists.php.net Subject: [PHP] most powerful php editor For me the analogy goes something like this: if you type the occasional

Re: [PHP] Detecting naughty sites

2006-11-29 Thread Robin Vickery
On 29/11/06, Travis Doherty [EMAIL PROTECTED] wrote: Tom Chubb wrote: On 28/11/06, Dave Goodchild [EMAIL PROTECTED] wrote: Hi all. I am building a web app and as part of it advertisers can upload their ad image and website URL to go with their ad. Is there a good way to detect whether

Re: [PHP] Splitting a string

2006-11-15 Thread Robin Vickery
On 15/11/06, Aaron Koning [EMAIL PROTECTED] wrote: Assuming var1 and var2 only ever use the last four numbers (untested): $length = strlen($number); // get string length $var1 = substr($number,0,$length-4); // get number until only 4 numbers are left $var2 = substr($number,$length-4,2); // get

Re: [PHP] list of countries

2006-11-08 Thread Robin Vickery
On 07/11/06, James Tu [EMAIL PROTECTED] wrote: Thanks everyone for the helpful links and suggestions! Any people here with access to a country list in Arabic or Chinese? http://www.foreignword.com/countries/Arabic.htm -robin -- PHP General Mailing List (http://www.php.net/) To unsubscribe,

  1   2   3   >