[PHP] Variable Scope problem passing function parameters

2008-12-18 Thread Jim McIntyre
I'm new to PHP 5 and classes, but I've done a lot of ActionScript. I'm trying to use PHPMailer inside my own class (a service for AMFPHP). I'm having problems getting the data that'spassed into my class's send() method to the instance of the PHPMailer. Basically, I have this: class EmailAMF

Re: [PHP] Variable Scope problem passing function parameters

2008-12-18 Thread Jim McIntyre
metastable wrote: Jim McIntyre wrote: $phpMail = new PHPMailer(); $phpMail-From = $from; $phpMail-AddAddress($this-to); $phpMail-Subject = $subject; $phpMail-Body = $body; return $phpMail-Send(); $this - to it has no meaning in the scope of your class. Apparently

[PHP] SOLVED Re: [PHP] Variable Scope problem passing function parameters

2008-12-18 Thread Jim McIntyre
Jim McIntyre wrote: metastable wrote: Jim McIntyre wrote: $phpMail = new PHPMailer(); $phpMail-From = $from; $phpMail-AddAddress($this-to); $phpMail-Subject = $subject; $phpMail-Body = $body; return $phpMail-Send(); Never mind - I found the problem. It was a lowly

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

2008-07-09 Thread Jim McIntyre
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? I prefer Monaco to Verdana - easier to distinguish 0 and O, etc. The font that came with

RE: [PHP] Keeping POST values when paging

2008-07-08 Thread Jim McIntyre
At 1:32 PM -0400 7/8/08, tedd wrote: Actually, you don't need to use sessions, post, nor get to pass variables between scripts. Here's an example: http://www.webbytedd.com/bb/tedd/index.php Of course, the smart ones on this list will figure it out pretty quickly. So, this code in the HTML

Re: [PHP] Random Unique ID

2007-03-24 Thread Jim McIntyre
IIRC, the OP wanted to generate a unique key precisely to keep from revealing the record ID to the end user... what about taking the auto_increment value (easy to generate, assured to be unique) adding its MD5 hash to another column in the table, then using that as the published ID? The only

[PHP] creating mailto: URL including 8-bit characters

2006-08-24 Thread Jim McIntyre
Hi, I'm trying to create a mailto: link in a page that will fill in the Subject and Bopy of a new email message with Spanish-language text. The text lives in strings in an array of localized text. Accented characters in the text are encoded as HTML entities. So, for example, the subject and

[PHP] Better way to count bits set in an integer?

2006-03-23 Thread Jim McIntyre
Hi, Is there a better/more efficient way to determine how many bits are set in an integer than this? substr_count(base_convert($myValue, 10, 2), '1'); I'm using PHP 4. Thanks, Jim -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php

Re: [PHP] Looping from A to Z

2006-02-19 Thread Jim McIntyre
Good afternoon. I'm having trouble getting PHP to loop from A through Z. Here is what I tried, coming from a C background: for ($l = A; $l = Z; $l++) echo $l; // Returns A, B, C, ..., X, Y, Z, AA, AB, AC, AD, AE, ... YX, YY, YZ. (26 * 26 results!) Interestingly, if I make it a less

Re: [PHP] A quick Regex query

2006-02-16 Thread Jim McIntyre
At 4:57 PM -0500 2/16/06, phplists wrote: Hi, I am using the following: [0-9]{4} [A-Za-zÅØ]{2,20} to extract data like: 1000 Øslo How can I alter the above to limit to ONLY 4 digits, or in other words exclude: 11000 Beograd Please note that what I am extracting from is NOT at the begining

[PHP] Workaround ISP's redirect of 404 Not Found PHP pages?

2006-01-26 Thread Jim McIntyre
Hi, I searched archived messages for this, but didn't find an answer. If this should go to the installation list, please advise (and forgive!). I'm working on a site hosted at 1and1. I want to use a PHP-enabled custom 404 page, but something in their configuration is preventing it from

[PHP] Re: Workaround ISP's redirect of 404 Not Found PHP pages?

2006-01-26 Thread Jim McIntyre
At 3:32 PM + 1/26/06, James Benson wrote: PHP is running as a CGI on the shared hosting servers, which is why your .htaccess isn't working for it. You will have to create the error rule within a php.ini file. That is so much bull, how then can it work for NON .php files? I know for a