php-general Digest 12 Jan 2010 17:10:50 -0000 Issue 6535
Topics (messages 301013 through 301026):
Re: corect way to use mail() function
301013 by: Michael A. Peters
301014 by: John Black
301017 by: Bob McConnell
301021 by: Michael A. Peters
Using PHPDocumentor to document the magic functions.
301015 by: Richard Quadling
301016 by: Richard Quadling
Re: I am not receiving any e-mail from the list...
301018 by: Bob McConnell
RewriteCond / rule for mod_rewrite
301019 by: John Corry
301025 by: Ashley Sheridan
array_count_values Problem
301020 by: Alice Wei
301023 by: Jonathan Tapicer
Re: To add the final ?> or not...
301022 by: John Corry
301024 by: LinuxManMikeC
301026 by: Michael A. Peters
Administrivia:
To subscribe to the digest, e-mail:
[email protected]
To unsubscribe from the digest, e-mail:
[email protected]
To post to the list, e-mail:
[email protected]
----------------------------------------------------------------------
--- Begin Message ---
Angus Mann wrote:
There are only 11 types of people in this world. Those that think binary
jokes are funny, those that don't, and those that don't know binary.
Er....Ummm.....shouldn't that read "...only 10 types of people..." ?
1 - those that think they are funny
10 - those that don't
11 - those that don't know binary
--- End Message ---
--- Begin Message ---
LAMP wrote:
Hi,
The company I work for, hosts online events registration applications.
After a registered registered himself for an event he will get a
confirmation email saying he registered successfully.
Currently, in the header part of the mail(), in "From" it says e.g.
[email protected] - because the email comes from us not from our
client (e.g. ABC Assoc.). Reply-to goes to us too.
Now one of our clients (e.g. ABC Assoc.) asks us to put in the "from"
field their email, to looks like the email comes from them. something
like: From: ABC Assoc. <[email protected]>;
I refused to do that concerned we are going to be blacklisted for
sending "spam". Because header shows one place and From field says other
email address - spam way of sending emails.
Am I right or it really doesn't matter "who" sent the email?
AFAIK, it depends.
If your server is computility.com and your client wants your server to
send email for abcaccos.org.
Then the messages may get flagged as spam if abcaccos.org has a SPF
record excluding your server from sending emails for them.
Some receiving servers will also check back with the sending server if
the email account you are sending from actually exists on the server
([email protected] would have to be a valid account on
mail.computility.com).
I don't think that you will get blacklisted for doing this but the
emails may be flagged as SPAM more often.
--
John
"There's something wrong with you if can make make an MMO about Star
Wars, and manage to make nobody want to play it."
--- End Message ---
--- Begin Message ---
From: LAMP
> Hi,
> The company I work for, hosts online events registration applications.
> After a registered registered himself for an event he will get a
> confirmation email saying he registered successfully.
> Currently, in the header part of the mail(), in "From" it says e.g.
> [email protected] - because the email comes from us not from our
> client (e.g. ABC Assoc.). Reply-to goes to us too.
>
> Now one of our clients (e.g. ABC Assoc.) asks us to put in the "from"
> field their email, to looks like the email comes from them. something
> like: From: ABC Assoc. <[email protected]>;
>
> I refused to do that concerned we are going to be blacklisted for
> sending "spam". Because header shows one place and From field says
other
> email address - spam way of sending emails.
>
> Am I right or it really doesn't matter "who" sent the email?
I believe the correct way to do this is to use the Sender: header for
[email protected] to show where it actually came from. Then it
doesn't matter what you put in From.
Bob McConnell
--- End Message ---
--- Begin Message ---
Bob McConnell wrote:
I believe the correct way to do this is to use the Sender: header for
[email protected] to show where it actually came from. Then it
doesn't matter what you put in From.
Bob McConnell
I believe that is correct.
--- End Message ---
--- Begin Message ---
Hi.
To implement public readonly properties you can use getX(), getY(),
getZ() methods (which then access the private vars) or you can use
__get($var) to consolidate/simplify the number of methods.
With the discrete getters() it is easy to docblock them. Everything is
obvious, but there is a LOT of duplicate code and documentation.
But how do you docblock __get()?
With the magic functions __get(), __set(), __call(), __callStatic(),
they act as proxies. It is NOT the proxy itself that is normally
wanted to be documented (maybe in a cursory manner), but what is being
proxied.
If you are creating a WSDL file for SOAP and have __get() and
__call(), then you would want to document each entry but without the
code duplication.
What is the best approach?
Regards,
Richard Quadling.
--
-----
Richard Quadling
"Standing on the shoulders of some very clever giants!"
EE : http://www.experts-exchange.com/M_248814.html
Zend Certified Engineer : http://zend.com/zce.php?c=ZEND002498&r=213474731
ZOPA : http://uk.zopa.com/member/RQuadling
--- End Message ---
--- Begin Message ---
2010/1/12 Jochem Maas <[email protected]>:
> Op 1/12/10 12:46 PM, Richard Quadling schreef:
>> Hi.
>>
>> To implement public readonly properties you can use getX(), getY(),
>> getZ() methods (which then access the private vars) or you can use
>> __get($var) to consolidate/simplify the number of methods.
>>
>> With the discrete getters() it is easy to docblock them. Everything is
>> obvious, but there is a LOT of duplicate code and documentation.
>>
>> But how do you docblock __get()?
>>
>> With the magic functions __get(), __set(), __call(), __callStatic(),
>> they act as proxies. It is NOT the proxy itself that is normally
>> wanted to be documented (maybe in a cursory manner), but what is being
>> proxied.
>>
>>
>> If you are creating a WSDL file for SOAP and have __get() and
>> __call(), then you would want to document each entry but without the
>> code duplication.
>>
>>
>> What is the best approach?
>>
>
> this is a difficult problem, probably no real answer to it right now.
> I vaguely remember Derick Rethans mailing about this issue in regard to
> the ezComponents lib ... you might want to check that codebase for inspiration
> and or STW for what he had to say on the matter.
>
>>
>> Regards,
>>
>> Richard Quadling.
>>
>
>
@property and @method are my friends. Gee! Wood for trees.
Thanks.
--
-----
Richard Quadling
"Standing on the shoulders of some very clever giants!"
EE : http://www.experts-exchange.com/M_248814.html
Zend Certified Engineer : http://zend.com/zce.php?c=ZEND002498&r=213474731
ZOPA : http://uk.zopa.com/member/RQuadling
--- End Message ---
--- Begin Message ---
From: [email protected]
> On Mon, Jan 11, 2010 at 10:10, Richard <[email protected]> wrote:
>>
>> I had this (I think) recently; mail simply stopped coming from the
>> list and I can't remember unsubscribing (though that's not saying
>> much...). I simply re-subscribed and all was dandy again.
>
> Quite possibly caused by malformed headers or SPAM being rejected
> by the filters and bounced back to the list. Two bounces and a tracer
> is sent. If that fails as well (and they usually do), you're
> unsubscribed without further notice. It happens to me all the time on
> the Windows list (now that I think about it, I think it happened
> again).
I occasionally see the tracers from various lists, particularly
[email protected]. It seems some list server software fails to clean up
the routing headers occasionally. Our boundary spam filters reject them
as having been forwarded too many times, indicating a possible mail
loop. I believe I have been unsubscribed from more than one list for
this reason.
Bob McConnell
--- End Message ---
--- Begin Message ---
I have this in my .htaccess file (for a Magento installation).
############################################
## never rewrite for existing files, directories and links
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteCond %{REQUEST_FILENAME} !-l
############################################
## rewrite everything else to index.php
RewriteRule .* index.php [L]
The client just asked for a wordpress installation. I installed and set it
up in /blog.
But when I request /blog in my browser, I get an endless redirect error.
???
Anyone care to offer help with why?
--
John Corry
PHP developer - 3by400, Inc
http://www.3by400.com
--- End Message ---
--- Begin Message ---
On Tue, 2010-01-12 at 08:49 -0500, John Corry wrote:
> I have this in my .htaccess file (for a Magento installation).
>
> ############################################
> ## never rewrite for existing files, directories and links
>
> RewriteCond %{REQUEST_FILENAME} !-f
> RewriteCond %{REQUEST_FILENAME} !-d
> RewriteCond %{REQUEST_FILENAME} !-l
>
> ############################################
> ## rewrite everything else to index.php
> RewriteRule .* index.php [L]
>
> The client just asked for a wordpress installation. I installed and set it
> up in /blog.
>
> But when I request /blog in my browser, I get an endless redirect error.
>
> ???
>
> Anyone care to offer help with why?
>
You shouldn't if this is all that's in your .htaccess file. Is there one
in the blog directory, and just to be sure, is the WordPress directory
called 'blog' and are you typing in the correct letter case?
Thanks,
Ash
http://www.ashleysheridan.co.uk
--- End Message ---
--- Begin Message ---
Hi,
I have a code in the following, after investigating more closely on how to
use array_count_values():
//Calculate the number of elements in array
$total_num = count($friend_from);
$total_num2 = count(array_unique($friend_from));
for ($i=0;$i<=$total_num2;$i++) echo $friend_from[$i] . " " .
array_count_values($friend_from[$i]) . "\n";
Neither of these two numbers, $total_num and $total_num2 are 0, but I only
get something like this:
Monroe, IN
Cherokee, OK
Cherokee, OK
Cleveland, OK
Greer, OK
How come that I cannot get it to print out the individual array_count_values?
Have I missed something here?
Thanks for your help.
_________________________________________________________________
Hotmail: Trusted email with powerful SPAM protection.
http://clk.atdmt.com/GBL/go/196390707/direct/01/
--- End Message ---
--- Begin Message ---
Hi,
The function array_count_values returns an array
(http://php.net/array_count_values). So you are using it the wrong
way, you should assign the return value to a variable and then access
some index.
Regards,
Jonathan
On Tue, Jan 12, 2010 at 11:09 AM, Alice Wei <[email protected]> wrote:
>
> Hi,
>
> I have a code in the following, after investigating more closely on how to
> use array_count_values():
>
> //Calculate the number of elements in array
> $total_num = count($friend_from);
> $total_num2 = count(array_unique($friend_from));
> for ($i=0;$i<=$total_num2;$i++) echo $friend_from[$i] . " " .
> array_count_values($friend_from[$i]) . "\n";
>
> Neither of these two numbers, $total_num and $total_num2 are 0, but I only
> get something like this:
>
> Monroe, IN
> Cherokee, OK
> Cherokee, OK
> Cleveland, OK
> Greer, OK
> How come that I cannot get it to print out the individual
> array_count_values? Have I missed something here?
> Thanks for your help.
>
>
> _________________________________________________________________
> Hotmail: Trusted email with powerful SPAM protection.
> http://clk.atdmt.com/GBL/go/196390707/direct/01/
--- End Message ---
--- Begin Message ---
I leave ?> out.
I'm pretty careful about my code formatting and whitespace.
It's my opinion that if I can eliminate a potential problem by not including
an optional closing tag...there's really no reason why I shouldn't.
--
John Corry
PHP developer - 3by400, Inc
http://www.3by400.com
--- End Message ---
--- Begin Message ---
On Fri, Jan 8, 2010 at 1:24 PM, Daevid Vincent <[email protected]> wrote:
>
> I'm having a debate with a co-worker about adding the final ?> on a PHP
> page...
>
So everybody, when do we get to the real discussion? Which end of an
egg do we break?
--- End Message ---
--- Begin Message ---
LinuxManMikeC wrote:
On Fri, Jan 8, 2010 at 1:24 PM, Daevid Vincent <[email protected]> wrote:
I'm having a debate with a co-worker about adding the final ?> on a PHP
page...
So everybody, when do we get to the real discussion? Which end of an
egg do we break?
Depends upon how far away the Perl developer is when we throw it, and
how much spin we put on it.
--- End Message ---