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')? tr

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. Chris. On Tue, Oct 19, 2010 at 4:54 PM, chris h wrote: > > Can you paste the index page's code here? If t

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 ph

Re: [PHP] require_once

2010-10-19 Thread chris h
l) and not worrying about requiring all your files is a plus. Chris. On Tue, Oct 19, 2010 at 10:00 AM, jim 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

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] 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 ne

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

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 >AT&T: 10digitphonenum...@txt.att.net >Sprint: 10digitphonenum...@messaging.sprintpcs.com >T-Mobile: 10digitphonenum...@tmomail.net >Nextel: 10digitphonenum...@messaging.nextel.com >Cingular:

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 wrote: > On 10/13/2010 10:48 PM, Mattias Thorslund wrote: > >> Hi List, >> >> I'm having a problem wit

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 "dy

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 wrote: > On Tue, Oct 12, 2010 at 4:45 AM, c

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 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 between class obje

Re: [PHP] Array / form processing

2010-10-07 Thread chris h
I don't know what the context is like, but you may be better off just using an entire form here with hidden fields. i.e. 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] Array / form processing

2010-10-07 Thread chris h
]) && isset($value[2]['quantity']) ) { $personal_quantity = $value[2]['quantity']; } 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.

Re: RES: [PHP] Class mysqli not found

2010-10-06 Thread chris h
Are you doing phpinfo() off the CLI or via apache mod? Is it the same way you are running the actual script that's calling on mysqli? On Wed, Oct 6, 2010 at 4:58 PM, sueandant wrote: > phpinfo() includes mysqli in its detailed output: > > mysqli > MysqlI Support enabled > Client API libr

Re: [PHP] Class mysqli not found

2010-10-06 Thread chris h
mysqli is set of functions not a class. The name to connect is mysqli_connect mysqli can be used as either a set of functions ( mysqli_connect(..) ) OR it can be used an an object ( new mysqli(...) ). When used as an object you just use the various functions as methods. http://www.php.net/manua

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 wrote: > > >Just to clarify, both packages are instantiating and calling their > >respective classes from the $db var, which is in the global scope. > >Is t

Re: [PHP] which one is faster

2010-10-05 Thread chris h
On Tue, Oct 5, 2010 at 3:58 PM, Steve Staples 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

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 wrote: > I am running into a v

Re: [PHP] which one is faster

2010-10-05 Thread chris h
On Tue, Oct 5, 2010 at 3:53 PM, 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 wrote: > > > > > > > Bench

Re: [PHP] which one is faster

2010-10-05 Thread chris h
ing(30) "By concat op: 2.2123351097107" string(27) "By string: 2.2798750400543" string(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"

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 wrote: > $a = 'hey&#

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 wrote: > Hi Shreyas, > > Ok, as far as I can tell the script should show "This is an H

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

2010-10-04 Thread chris h
rote: > On Tue, Oct 5, 2010 at 12:39 AM, chris h 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

[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 with

Re: [PHP] Syntax Error

2010-10-03 Thread chris h
On Sun, Oct 3, 2010 at 12:47 PM, Gary 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 manual that correspond

Re: [PHP] Scraping Multiple sites

2010-10-02 Thread chris h
On Sat, Oct 2, 2010 at 9:03 PM, Russell Dias 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 independent

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. Al

Re: [PHP] Array question

2010-09-25 Thread chris h
#x27;; $normal[1] = 'b'; $normal[2] = 'c'; - 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 wrote

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 wrote: > Hey folks, > > Here's the deal. I have the following code: > &

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 wrote: > From: chris h > > > On Fri, Sep 24, 2010 at 8:35 AM, Peter Lind > w

Re: [PHP] Re: Copying an Object

2010-09-24 Thread chris h
On Fri, Sep 24, 2010 at 8:35 AM, Peter Lind wrote: > On 24 September 2010 14:22, Bob McConnell wrote: > > From: David Hutto > > > >> On Fri, Sep 24, 2010 at 4:09 AM, Gary > wrote: > >>> Daniel Kolbo wrote: > >>> > Say you have two classes: human and male. Further, say male extends >

Re: [PHP] Copying an Object

2010-09-22 Thread chris h
ferent class - please correct me 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

Re: [PHP] PHP Email Question

2010-09-20 Thread chris h
> Ignore the other parameters unless you are very familiar with RFCs 2821, > 2822 and their associated RFCs > I would advise against ignoring the other parameters. Doing so will pretty much guarantee having your email end up in SPAM. Instead look up the examples in the docs, or better yet use s

Re: [PHP] How to store data that doesn't change?

2010-09-18 Thread chris h
On Sat, Sep 18, 2010 at 12:37 PM, Ashley Sheridan wrote: > On Sat, 2010-09-18 at 12:21 -0400, chris h wrote: > > When you really NEED a global resource I'm a fan of a registry class. It's > a little slower but not noticeable in most cases. > > With a registry you ca

Re: [PHP] How to store data that doesn't change?

2010-09-18 Thread chris h
When you really NEED a global resource I'm a fan of a registry class. It's a little slower but not noticeable in most cases. With a registry you can store all global data in a single, controlled area. You can also store arrays and resources instead of just strings. One down side to most registr

Re: [PHP] 1984 (Big Brother)

2010-09-18 Thread chris h
So whenever the boss is in a meeting and his screen saver kicks on then the business shuts down. Also I think we've established that thumbdrive + database = disaster. Maybe a thumbdrive that has file with some random hash. Then create a cron that checks for the existence of that file each minute

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.

Re: [PHP] 1984 (Big Brother)

2010-09-13 Thread chris h
On Mon, Sep 13, 2010 at 5:09 PM, Daevid Vincent 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 em

Re: [PHP] Zend framework

2010-09-10 Thread chris h
t: RE: [PHP] Zend framework > > > > http://www.php.net/manual/en/language.oop5.basic.php > > > > > -Original Message- > > > From: David Harkness [mailto:davi...@highgearmedia.com] > > > Sent: Friday, September 10, 2010 10:59 AM > > > To: rqua

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 wrote: > I'm looking at someone's code to learn and I'm relatively new to > programming. In the code I see commands like: >

[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 st

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 ho

Re: [PHP] Hi

2010-09-06 Thread chris h
On Mon, Sep 6, 2010 at 1:45 PM, chris h 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 th

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

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 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 Facebook site

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 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 unsubsc

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 " $response "; Though you'll likely want to increase the size of the textarea! ;-) Chris. On Fri, Sep 3, 2010

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 wrote: > On Wed, Aug 18, 2010 at 4:55 PM, Adam Richardson >wrote: > > > On Wed, Aug 18, 2010 at 4:49 PM, Ashley Sheridan < > a...@ashleysheridan.co.uk > > > wrote: > > > >> On Wed, 2010-08-18 at 13:

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 fu

Re: [PHP] tutorial failure

2010-08-18 Thread chris h
On Wed, Aug 18, 2010 at 7:10 AM, e-letter wrote: > On 18/08/2010, chris h 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 c

Re: [PHP] tutorial failure

2010-08-18 Thread chris h
at 6:47 AM, e-letter wrote: > On 18/08/2010, chris h 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 > > > T

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 it'

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

2010-08-14 Thread chris h
hoose to use I would 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 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 &

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

2010-08-13 Thread chris h
you can do it like this... on the php side this would equate to... echo $_POST['field'][0]; // prints "zero" echo $_POST['field'][1]; // prints "one" echo $_POST['field'][65]; // prints "sixty-five" echo $_POST['field']['car']; // prints "truck" provided the form is submitted via a POST met

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 < aliasghar.tor...@gmail

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 wrote: > At 6:11 PM -0400 8/13/10, Daniel P. Brown wrote: >

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 i