Re: [PHP] My truth comes out [1]

2010-10-21 Thread chris h
settype looks like a no-go for this; per the php docs... http://php.net/manual/en/function.settype.php -- $bar = true; // boolean settype($bar, string); // $bar is now 1 (string) -- I think using a conditional here is the best (only?) way. $bool = (strtolower($string)=='true')? true:

Re: [PHP] Execute a php page and don't wait for it to finish

2010-10-19 Thread chris h
What about simply having the script trip a flag that another background script checks every 60 seconds or so? Once a minutes a background script checks to see if it needs to preform any tasks. When a user hits a certain page it does an ajax request to trip this flag and immediately returns. The

Re: [PHP] require_once

2010-10-19 Thread chris h
I'm having a problem including files using Zend Framework. I have in a controller file this Jim why not use the Zend autoloader? Chris.

Re: [PHP] require_once

2010-10-19 Thread chris h
) and not worrying about requiring all your files is a plus. Chris. On Tue, Oct 19, 2010 at 10:00 AM, jim jbw2...@earthlink.net wrote: I am following an example. Also, doesn't that require the class name to be something like models_members? Jim On 10/19/2010 09:40 AM, chris h wrote: I'm having

Re: [PHP] simple class constructor

2010-10-19 Thread chris h
Can you paste the index page's code here? If the page is going blank there's probably an error (syntax, bad file path, etc). If you have access you can turn error reporting on so you can actually see the error - or better yet check the php error log file. Settings for both of these are in the

Re: [PHP] simple class constructor

2010-10-19 Thread chris h
Also wanted to point out that you can check the error reporting level and log file location (really all of the php's settings) by calling phpinfo(); in your code. ?php phpinfo(); ? Chris. On Tue, Oct 19, 2010 at 4:54 PM, chris h chris...@gmail.com wrote: Can you paste the index

Re: [PHP] Buffering output to allow headers late in code?

2010-10-14 Thread chris h
I'm working through my class on PHP and I tried to put information from my sign-on process in the navbar. This didn't work well, since I had to reload the page to see it as the navbar was constructed earlier in the code than the signon process. (Hard to explain, as we are building a dynamic

Re: [PHP] floored by floor()

2010-10-14 Thread chris h
floor(32703) is different then floor(327.03 * 100). The former is an int, while the later is a float. Read those links that were sent :) Chris. On Thu, Oct 14, 2010 at 2:14 AM, Glen Fuller glenmful...@shaw.ca wrote: On 10/13/2010 10:48 PM, Mattias Thorslund wrote: Hi List, I'm having a

Re: [PHP] Text messaging from the web

2010-10-14 Thread chris h
You can send a text message via email: Verizon: 10digitphonenum...@vtext.com ATT: 10digitphonenum...@txt.att.net Sprint: 10digitphonenum...@messaging.sprintpcs.com T-Mobile: 10digitphonenum...@tmomail.net Nextel: 10digitphonenum...@messaging.nextel.com Cingular:

Re: [PHP] Re: Buffering output to allow headers late in code?

2010-10-14 Thread chris h
Then someone said that using buffering was a bad idea and I should disable it. I think it leads to poor habits like calling controller methods out of the view (essentially what you are wanting to use it for). Using it like that is asking for spaghetti code that's hard to maintain, scale, and

Re: [PHP] class object vs array for db table model

2010-10-12 Thread chris h
On Tue, Oct 12, 2010 at 2:38 AM, Tommy Pham tommy...@gmail.com wrote: Hi everyone, It's been a couple years since I've did a project in PHP. The current project I'm working on is for PHP 5.3 and I noticed a performance issue. Is it just me or is there a BIG difference in performance

Re: [PHP] class object vs array for db table model

2010-10-12 Thread chris h
hehe that's pretty funny; also funny oversight of mine in regards to isset()... so I guess we're both comedians today? ;-) Glad you got that worked out Tommy! Chris. On Tue, Oct 12, 2010 at 8:46 AM, Tommy Pham tommy...@gmail.com wrote: On Tue, Oct 12, 2010 at 4:45 AM, chris h chris

Re: [PHP] Array / form processing

2010-10-07 Thread chris h
']; } Technically the above IF's are optional, but they are proper syntax. I don't know how you are with OOP, but you may have more luck using objects instead of a complex array. Chris H. On Thu, Oct 7, 2010 at 3:35 PM, Ron Piggott ron.pigg...@actsministries.orgwrote: I am writing a custom shopping cart

Re: [PHP] Array / form processing

2010-10-07 Thread chris h
=1234 / input type=submit value=Remove class=place_order/ /form Without knowing what else is going on in your page, and how the request is being handled on the server, it's kind of hard to give exact advice. :) Chris H.

Re: [PHP] Re: Continuance of the struggle (trying to understand)

2010-10-05 Thread chris h
If I paste the script into a web page What do you mean by paste the script into a web page? Can you tell us exactly what you are doing when you do that? Chris. On Tue, Oct 5, 2010 at 7:54 AM, Col Day colind...@aol.com wrote: Hi Shreyas, Ok, as far as I can tell the script should show

Re: [PHP] which one is faster

2010-10-05 Thread chris h
Benchmark and find out! :) What are you using this for? Unless you are doing something crazy it probably doesn't matter, and you should pick whichever you feel looks nicer / is easier to code in / etc. Chris H. On Tue, Oct 5, 2010 at 3:23 PM, saeed ahmed saeed@gmail.com wrote: $a = 'hey

Re: [PHP] which one is faster

2010-10-05 Thread chris h
(29) By concat op: 2.1521489620209 string(27) By string: 2.2470209598541 string(29) By concat op: 2.1347990036011 string(27) By string: 2.1982681751251 I would say that under virtually all cases that difference is less then negligible. Chris H. On Tue, Oct 5, 2010 at 3:35 PM, Ashley Sheridan

Re: [PHP] which one is faster

2010-10-05 Thread chris h
On Tue, Oct 5, 2010 at 3:53 PM, Ashley Sheridan a...@ashleysheridan.co.ukwrote: On Tue, 2010-10-05 at 15:46 -0400, Steve Staples wrote: On Tue, 2010-10-05 at 20:35 +0100, Ashley Sheridan wrote: On Tue, 2010-10-05 at 15:28 -0400, chris h wrote: Benchmark and find out

Re: [PHP] Variable (Class instantiation) collision

2010-10-05 Thread chris h
Just to clarify, both packages are instantiating and calling their respective database classes from the $db var, which is in the global scope. Is this correct? This is why I hate the global scope, I hate it, I hate it! On Tue, Oct 5, 2010 at 3:47 PM, Brian Smither bhsmit...@gmail.com wrote: I

Re: [PHP] which one is faster

2010-10-05 Thread chris h
On Tue, Oct 5, 2010 at 3:58 PM, Steve Staples sstap...@mnsi.net wrote: On Tue, 2010-10-05 at 20:53 +0100, Ashley Sheridan wrote: On Tue, 2010-10-05 at 15:46 -0400, Steve Staples wrote: On Tue, 2010-10-05 at 20:35 +0100, Ashley Sheridan wrote: On Tue, 2010-10-05 at 15:28 -0400, chris h

Re: [PHP] Variable (Class instantiation) collision

2010-10-05 Thread chris h
Short of refactoring ApplicationB, can you set it up as a SOAP/REST service that AppA calls? On Tue, Oct 5, 2010 at 5:02 PM, Brian Smither bhsmit...@gmail.com wrote: Just to clarify, both packages are instantiating and calling their respective classes from the $db var, which is in the global

[PHP] PHPExcel with large files (27,000+ rows)

2010-10-04 Thread chris h
I'm currently working on a project that requires the parsing of excel files. Basically the user uploads an excel file, and then a script needs to save a row in a Postgres database for each row in the excel file. The issue we are having is that when we task PHPExcel with parsing an excel file

Re: [PHP] PHPExcel with large files (27,000+ rows)

2010-10-04 Thread chris h
@gmail.com wrote: On Tue, Oct 5, 2010 at 12:39 AM, chris h chris...@gmail.com wrote: I'm currently working on a project that requires the parsing of excel files. Basically the user uploads an excel file, and then a script needs to save a row in a Postgres database for each row in the excel file

Re: [PHP] Syntax Error

2010-10-03 Thread chris h
On Sun, Oct 3, 2010 at 12:47 PM, Gary gp...@paulgdesigns.com wrote: I have just created a registration page using Webassist, and I am getting a syntax error that I am not understanding. Anyone be able to point me in the right direction? You have an error in your SQL syntax; check the

Re: [PHP] Little Parsing help...

2010-10-02 Thread chris h
Don, How far along are you? To get started something like this may work for you... preg_match_all('/[A-G]{1}#?/', $line, $matches); That SHOULD return each note of the line (you can retrieve them via the $matches array), given that there are no other upper-case characters that are not notes.

Re: [PHP] Scraping Multiple sites

2010-10-02 Thread chris h
On Sat, Oct 2, 2010 at 9:03 PM, Russell Dias rus...@gmail.com wrote: I'm currently stuck on a little problem. I'm using cURL in conjunction with DOMDocument and Xpath to scrape data from a couple of websites. Please note that is only for personal and educational purposes. Right now I have 5

Re: [PHP] Array question

2010-09-25 Thread chris h
'; - And yes, in your example $results[] would be equivalent to $results[$j] For more reference: http://www.php.net/manual/en/language.types.array.php Chris H. On Sat, Sep 25, 2010 at 4:31 PM, MikeB mpbr...@gmail.com wrote: I have the following code: $query = SELECT * FROM classics; $result

Re: [PHP] Re: Copying an Object

2010-09-24 Thread chris h
On Fri, Sep 24, 2010 at 8:35 AM, Peter Lind peter.e.l...@gmail.com wrote: On 24 September 2010 14:22, Bob McConnell r...@cbord.com wrote: From: David Hutto On Fri, Sep 24, 2010 at 4:09 AM, Gary php-gene...@garydjones.name wrote: Daniel Kolbo wrote: Say you have two classes: human

Re: [PHP] Re: Copying an Object

2010-09-24 Thread chris h
Gang of Four http://www.amazon.com/Design-Patterns-Elements-Reusable-Object-Oriented/dp/0201633612 An excellent book on OOP. Chris H. On Fri, Sep 24, 2010 at 9:34 AM, Bob McConnell r...@cbord.com wrote: From: chris h On Fri, Sep 24, 2010 at 8:35 AM, Peter Lind peter.e.l...@gmail.com

Re: [PHP] if/elseif being treated as if/if

2010-09-24 Thread chris h
Andy I see no reason why both echo's would fire; unless this block of code gets executed multiple times. can we see more of the code? Chris H. On Fri, Sep 24, 2010 at 1:50 PM, Andy McKenzie amckenz...@gmail.com wrote: Hey folks, Here's the deal. I have the following code: if($col_vals

Re: [PHP] Copying an Object

2010-09-22 Thread chris h
if I'm wrong. Is it possible that there's a more elegant solution to your problem that does not include a mass copy of all an object's properties? (e.g. using statics like Mr Bungle suggested or perhaps some nifty design pattern?) Chris H. On Wed, Sep 22, 2010 at 7:35 AM, Daniel Kolbo kolb0

Re: [PHP] Adjusting Session Times

2010-09-14 Thread chris h
My thought is to adjust the session expiration in the table based on the client currently logged in. I don't know if there's a better way, but I would probably just do that. The expiration would be set to whatever the client's preference is, and default to 8 hours if he doesn't have one. You

Re: [PHP] 1984 (Big Brother)

2010-09-13 Thread chris h
On Mon, Sep 13, 2010 at 5:09 PM, Daevid Vincent dae...@daevid.com wrote: -Original Message- From: tedd [mailto:t...@sperling.com] Sent: Sunday, September 12, 2010 9:32 AM To: PHP-General list Subject: [PHP] 1984 (Big Brother) Hi gang: I have a client who wants his

Re: [PHP] newbie question about code

2010-09-10 Thread chris h
I would check this out to give you a decent understanding of php's oop. http://php.net/manual/en/language.oop5.php Chris. On Fri, Sep 10, 2010 at 2:27 PM, Adam Williams adam_willi...@bellsouth.netwrote: I'm looking at someone's code to learn and I'm relatively new to programming. In the

Re: [PHP] Zend framework

2010-09-10 Thread chris h
-Original Message- From: David Harkness [mailto:davi...@highgearmedia.com] Sent: Friday, September 10, 2010 10:59 AM To: rquadl...@googlemail.com Cc: chris h; PHP-General Subject: Re: [PHP] Zend framework We use part of Zend MVC (the dispatcher, controllers

[PHP] Zend framework

2010-09-09 Thread chris h
Hello all, I'm starting a new project and I'm thinking about building it on Zend framework and possibly Zend server. I've only used the framework slightly and I've never really used Zend server. That being said I hear that the framework is pretty decent to work with. I want something that is

Re: [PHP] Reformat array result.

2010-09-08 Thread chris h
Paul, How are you matching the records in the event count array to the ones in the timestamp array? Is it safe to say that: $timestamp[ $i ] corresponds to $eventCount[ $i ]? If so, you could just iterate through the timestamp array; on each iteration create a record in a new array that holds

Re: [PHP] Hi

2010-09-06 Thread chris h
You can check the extension of the uploaded file http://www.php.net/manual/en/features.file-upload.post-method.php But to be sure that it's truly a zip file you could actually open the file with php's zip function. http://php.net/manual/en/ref.zip.php Chris. On Mon, Sep 6, 2010 at 9:46 AM,

Re: [PHP] Hi

2010-09-06 Thread chris h
On Mon, Sep 6, 2010 at 1:45 PM, chris h chris...@gmail.com wrote: Per PHPdocs on $_FILES['userfile']['type']... The mime type of the file, if the browser provided this information. An example would be image/gif. This mime type is however not checked on the PHP side and therefore don't take

Re: [PHP] a test (list is too quite)

2010-09-04 Thread chris h
Evidently all is well in the world of php... :) On Sat, Sep 4, 2010 at 12:45 PM, tedd t...@sperling.com wrote: Hi gang: Just checking to see if I am still receiving postings. :-) Cheers, tedd -- --- http://sperling.com/ -- PHP General Mailing List (http://www.php.net/) To

Re: [PHP] a test (list is too quite)

2010-09-04 Thread chris h
On Sat, Sep 4, 2010 at 2:24 PM, Marc Guay marc.g...@gmail.com wrote: Can I make a facebook site using PHP? If yes, how? Please send me the infos privately. -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php I'm also trying to make a

Re: [PHP] PHP, Soap, and WDSL

2010-09-03 Thread chris h
Alternatively you can pass the var through htmlspecialchars... echo htmlspecialchars( $response ); and for a really simple solution you can echo it inside a textarea... echo textarea $response /textarea; Though you'll likely want to increase the size of the textarea! ;-) Chris. On

Re: [PHP] tutorial failure

2010-08-18 Thread chris h
php is not processing the file. There's a few reasons for this, but the first thing I would check is the permissions of the file. From the directory try $ ls -oa This should tell you who owns the file and what it's permissions are. You mentioned that you copied it as root, you could change

Re: [PHP] tutorial failure

2010-08-18 Thread chris h
at 6:47 AM, e-letter inp...@gmail.com wrote: On 18/08/2010, chris h chris...@gmail.com wrote: php is not processing the file. There's a few reasons for this, but the first thing I would check is the permissions of the file. From the directory try $ ls -oa The file permission

Re: [PHP] tutorial failure

2010-08-18 Thread chris h
On Wed, Aug 18, 2010 at 7:10 AM, e-letter inp...@gmail.com wrote: On 18/08/2010, chris h chris...@gmail.com wrote: What are the actual file permissions when you run ls -o? root What's the entire output of ls -o? Do you know if PHP is installed as an apache mod or cgi? Also you might

Re: [PHP] method overloading in a class

2010-08-18 Thread chris h
Would something like this work for you? class foo { public function bar($arg1, $arg2, $arg3=null) { if (isset($arg3)){ { return $this-_bar3($arg1, $arg2, $arg3); } else { return $this-_bar2($arg1, $arg2); } } also you may want to look into the

Re: [PHP] Can't read $_POST array

2010-08-18 Thread chris h
Does $_SERVER['HTTP_METHOD'] show a GET or POST? On Wed, Aug 18, 2010 at 4:58 PM, Adam Richardson simples...@gmail.comwrote: On Wed, Aug 18, 2010 at 4:55 PM, Adam Richardson simples...@gmail.com wrote: On Wed, Aug 18, 2010 at 4:49 PM, Ashley Sheridan a...@ashleysheridan.co.uk wrote:

Re: [PHP] It's Friday (a MySQL Question)

2010-08-14 Thread chris h
suggest reading over the link I sent you so you can customize it's output. Chris. On Sat, Aug 14, 2010 at 8:51 AM, tedd t...@sperling.com wrote: At 6:53 PM -0400 8/13/10, chris h wrote: Tedd I don't know if this will resolve your issue or not, but have you looked into using mysqldump? http

Re: [PHP] Setting up a 2 Column Display for SQL Recordset

2010-08-13 Thread chris h
Dave I would look into something like the array_slice function. http://us3.php.net/manual/en/function.array-slice.php With this function you could create two arrays - one for the left column, and one for the right column - and iterate through them simultaneously. i.e. untested: given $allNames

Re: [PHP] It's Friday (a MySQL Question)

2010-08-13 Thread chris h
Tedd I don't know if this will resolve your issue or not, but have you looked into using mysqldump? http://dev.mysql.com/doc/refman/5.1/en/mysqldump.html That's what I use for my backups. Chris. On Fri, Aug 13, 2010 at 6:47 PM, tedd t...@sperling.com wrote: At 6:11 PM -0400 8/13/10, Daniel

Re: [PHP] login to protected directory by php

2010-08-13 Thread chris h
Based off what your saying my guess is that the request is not hitting your php script. Is the php script in the protected directory? If so what is it's file name and what url are you hitting for the test? Chris. On Fri, Aug 13, 2010 at 6:21 PM, Ali Asghar Toraby Parizy

Re: [PHP] Updating Multiple rows in mysql w php at once (newbie)

2010-08-13 Thread chris h
you can do it like this... input name=field[] value=zero type=text / input name=field[] value=one type=text / input name=field[65] value=sixty-five type=text / input name=field[car] value=truck type=text / on the php side this would equate to... echo $_POST['field'][0]; // prints zero echo