php-general Digest 18 Aug 2012 06:11:32 -0000 Issue 7927

Topics (messages 318731 through 318750):

Re: Need to have form protection techniques
        318731 by: Daniel Brown
        318732 by: Tedd Sperling
        318733 by: Robert Cummings
        318734 by: Al
        318735 by: Tedd Sperling
        318736 by: Robert Cummings
        318737 by: Robert Cummings

Instance inheritance
        318738 by: Aaron Holmes

Cost of redirect and site domain switch? Good Practice / Bad Practice / 
Terrible Practice
        318739 by: Tristan
        318740 by: Jonathan Sundquist
        318741 by: Sebastian Krebs
        318742 by: Tristan
        318743 by: Daniel Brown
        318744 by: Tristan
        318745 by: Tristan
        318746 by: Daniel Brown
        318748 by: Jim Lucas
        318749 by: Jim Giner

APC expunge notices
        318747 by: Nathan Nobbe
        318750 by: Robert Cummings

Administrivia:

To subscribe to the digest, e-mail:
        php-general-digest-subscr...@lists.php.net

To unsubscribe from the digest, e-mail:
        php-general-digest-unsubscr...@lists.php.net

To post to the list, e-mail:
        php-gene...@lists.php.net


----------------------------------------------------------------------
--- Begin Message ---
On Fri, Aug 17, 2012 at 12:05 AM, Ansry User 01 <yrsna.res...@gmail.com> wrote:
> I need to know the forms validity techniques for Php.

    This will probably take a while to absorb, so you may need to
revisit this page several times:

        http://oidk.net/php/know-the-forms-validity-techniques-for.php

-- 
</Daniel P. Brown>
Network Infrastructure Manager
http://www.php.net/

--- End Message ---
--- Begin Message ---
On Aug 17, 2012, at 10:09 AM, Daniel Brown <danbr...@php.net> wrote:

> On Fri, Aug 17, 2012 at 12:05 AM, Ansry User 01 <yrsna.res...@gmail.com> 
> wrote:
>> I need to know the forms validity techniques for Php.
> 
>    This will probably take a while to absorb, so you may need to
> revisit this page several times:
> 
>        http://oidk.net/php/know-the-forms-validity-techniques-for.php
> 
> -- 
> </Daniel P. Brown>
> Network Infrastructure Manager
> http://www.php.net/


I would also add:

http://phpsecurity.org

Chris has written an outstanding book on php security -- well worth the 
read/cost.

http://www.amazon.com/Essential-PHP-Security-Chris-Shiflett/dp/059600656X

Less than $20 -- you can't beat that.

Cheers,

tedd


_____________________
t...@sperling.com
http://sperling.com



--- End Message ---
--- Begin Message ---
On 12-08-17 10:15 AM, Tedd Sperling wrote:
On Aug 17, 2012, at 10:09 AM, Daniel Brown <danbr...@php.net> wrote:

On Fri, Aug 17, 2012 at 12:05 AM, Ansry User 01 <yrsna.res...@gmail.com> wrote:
I need to know the forms validity techniques for Php.

    This will probably take a while to absorb, so you may need to
revisit this page several times:

        http://oidk.net/php/know-the-forms-validity-techniques-for.php

No tedd, I'm sorry but the info in the link above is pretty much perfect.

Cheers,
Rob.
--
E-Mail Disclaimer: Information contained in this message and any
attached documents is considered confidential and legally protected.
This message is intended solely for the addressee(s). Disclosure,
copying, and distribution are prohibited unless authorized.

--- End Message ---
--- Begin Message ---


On 8/17/2012 10:42 AM, Robert Cummings wrote:
On 12-08-17 10:15 AM, Tedd Sperling wrote:
On Aug 17, 2012, at 10:09 AM, Daniel Brown <danbr...@php.net> wrote:

On Fri, Aug 17, 2012 at 12:05 AM, Ansry User 01 <yrsna.res...@gmail.com> wrote:
I need to know the forms validity techniques for Php.

    This will probably take a while to absorb, so you may need to
revisit this page several times:

        http://oidk.net/php/know-the-forms-validity-techniques-for.php

No tedd, I'm sorry but the info in the link above is pretty much perfect.

Cheers,
Rob.

Looks to me as if it's been hacked.

--- End Message ---
--- Begin Message ---
On Aug 17, 2012, at 10:42 AM, Robert Cummings <rob...@interjinn.com> wrote:
>>> On Fri, Aug 17, 2012 at 12:05 AM, Ansry User 01 <yrsna.res...@gmail.com> 
>>> wrote:
>>>> I need to know the forms validity techniques for Php.
>>> 
>>>    This will probably take a while to absorb, so you may need to
>>> revisit this page several times:
>>> 
>>>        http://oidk.net/php/know-the-forms-validity-techniques-for.php
> 
> No tedd, I'm sorry but the info in the link above is pretty much perfect.
> 
> Cheers,
> Rob.

Oh, to be serious on this list on Fridays is lost cause.

I keep forgetting Fridays are like April 1.

Cheers,

tedd

_____________________
t...@sperling.com
http://sperling.com

--- End Message ---
--- Begin Message ---
On 12-08-17 11:14 AM, Tedd Sperling wrote:
On Aug 17, 2012, at 10:42 AM, Robert Cummings <rob...@interjinn.com> wrote:
On Fri, Aug 17, 2012 at 12:05 AM, Ansry User 01 <yrsna.res...@gmail.com> wrote:
I need to know the forms validity techniques for Php.

    This will probably take a while to absorb, so you may need to
revisit this page several times:

        http://oidk.net/php/know-the-forms-validity-techniques-for.php

No tedd, I'm sorry but the info in the link above is pretty much perfect.

Cheers,
Rob.

Oh, to be serious on this list on Fridays is lost cause.

I keep forgetting Fridays are like April 1.

:D

Cheers,
Rob.
--
E-Mail Disclaimer: Information contained in this message and any
attached documents is considered confidential and legally protected.
This message is intended solely for the addressee(s). Disclosure,
copying, and distribution are prohibited unless authorized.

--- End Message ---
--- Begin Message ---
On 12-08-17 10:59 AM, Al wrote:


On 8/17/2012 10:42 AM, Robert Cummings wrote:
On 12-08-17 10:15 AM, Tedd Sperling wrote:
On Aug 17, 2012, at 10:09 AM, Daniel Brown <danbr...@php.net> wrote:

On Fri, Aug 17, 2012 at 12:05 AM, Ansry User 01 <yrsna.res...@gmail.com> wrote:
I need to know the forms validity techniques for Php.

     This will probably take a while to absorb, so you may need to
revisit this page several times:

         http://oidk.net/php/know-the-forms-validity-techniques-for.php

No tedd, I'm sorry but the info in the link above is pretty much perfect.

Cheers,
Rob.

Looks to me as if it's been hacked.


I thought it was some intentional Friday entertainment!

Cheers,
Rob.
--
E-Mail Disclaimer: Information contained in this message and any
attached documents is considered confidential and legally protected.
This message is intended solely for the addressee(s). Disclosure,
copying, and distribution are prohibited unless authorized.

--- End Message ---
--- Begin Message ---
Hello,
I would like some input on the best way to do something that I can only think to call "instance inheritance." I want to return, from a class method, an object that has the same methods as $this, with some additional data, and without altering $this. The way I'm doing this now is with clone, but that doesn't seem ideal, and I suspect I'm missing something simpler.

I am also using __get() and __set() for class properties, so perhaps some traditional accessors are invalidated.

Here's the gist of what I have right now.

class Super Implements Iterator
{
    private $position    = 0;
    private $properties = array('some_prop');
    private $data          = array('data');
    function current()
    {
        $clone      = clone $this;
        $property = $this->properties[$this->position];
        $data        = $this->data[$this->position];

        $clone->$property = $data;

        return $clone;
    }
    ...
}

class Sub extends Super
{
    ...
}

$obj = new Sub();

foreach($obj as $k=>$v) {
// $v now has the same methods as Sub, but it also has the current property set to some value, while $obj does not
    var_dump($obj->some_prop); // NULL
    var_dump($v->some_prop);    // string(4) "data"

}

--- End Message ---
--- Begin Message ---
So, I need to change from somedomain.com to somenewdomain.com

I was thinking of doing this

1) create an alias to the site somenewdomain.com to point to current server
2) run permanent 301 redirect from somedomain.com to somenewdomain.com


I was thinking this was a clean safe way to do it so we dont have to run a
global find replace.

Concerns might be but, I don't know for sure?

1) SEO
2) processing / time / cost for the 301 redirect on any old
somedomain.comrequests


What do you guys think?

Thanks, T

--- End Message ---
--- Begin Message ---
Depending on how long you have why not just do an alias? No redirect
required.

On Fri, Aug 17, 2012 at 2:35 PM, Tristan <sunnrun...@gmail.com> wrote:

> So, I need to change from somedomain.com to somenewdomain.com
>
> I was thinking of doing this
>
> 1) create an alias to the site somenewdomain.com to point to current
> server
> 2) run permanent 301 redirect from somedomain.com to somenewdomain.com
>
>
> I was thinking this was a clean safe way to do it so we dont have to run a
> global find replace.
>
> Concerns might be but, I don't know for sure?
>
> 1) SEO
> 2) processing / time / cost for the 301 redirect on any old
> somedomain.comrequests
>
>
> What do you guys think?
>
> Thanks, T
>

--- End Message ---
--- Begin Message ---
If you need to change the domain completely, choose "301".

- Crawler will recognize it and will update their indexes quite soon. Especially you avoid "duplicate content"-punishments, because you say yourself, that the content originally comes from another domain, that isn't anymore (Like "It's not a duplicate, it's _the_ content, but under a different address"). - The delay is negliable. Also as soon as every index were updated no "new" visitor should enter your site via the old domain. Browser should (don't know wether they do, or not) recognize "301" too and redirect any further request to the url on their own (think of it as "they cache the redirect permanently").

If this change is only temporary I would recommend using "307" to avoid duplicate contents. I would even say, that a 307-redirect from somenewdomain.com to somedomain.com is more appropiate, but that depends.

Regards,
Sebastian

Am 17.08.2012 21:35, schrieb Tristan:
So, I need to change from somedomain.com to somenewdomain.com

I was thinking of doing this

1) create an alias to the site somenewdomain.com to point to current server
2) run permanent 301 redirect from somedomain.com to somenewdomain.com


I was thinking this was a clean safe way to do it so we dont have to run a
global find replace.

Concerns might be but, I don't know for sure?

1) SEO
2) processing / time / cost for the 301 redirect on any old
somedomain.comrequests


What do you guys think?

Thanks, T



--- End Message ---
--- Begin Message ---
Jonathan,

Yeah that was my intention but, I think search engines will hit you for
duped content if you're running two domains same content. So, the idea was
to redirect 301 style and have an alias.

-T

On Fri, Aug 17, 2012 at 1:36 PM, Jonathan Sundquist <jsundqu...@gmail.com>wrote:

> Depending on how long you have why not just do an alias? No redirect
> required.
>
>
> On Fri, Aug 17, 2012 at 2:35 PM, Tristan <sunnrun...@gmail.com> wrote:
>
>> So, I need to change from somedomain.com to somenewdomain.com
>>
>> I was thinking of doing this
>>
>> 1) create an alias to the site somenewdomain.com to point to current
>> server
>> 2) run permanent 301 redirect from somedomain.com to somenewdomain.com
>>
>>
>> I was thinking this was a clean safe way to do it so we dont have to run a
>> global find replace.
>>
>> Concerns might be but, I don't know for sure?
>>
>> 1) SEO
>> 2) processing / time / cost for the 301 redirect on any old
>> somedomain.comrequests
>>
>>
>> What do you guys think?
>>
>> Thanks, T
>>
>
>

--- End Message ---
--- Begin Message ---
On Fri, Aug 17, 2012 at 3:35 PM, Tristan <sunnrun...@gmail.com> wrote:
> So, I need to change from somedomain.com to somenewdomain.com
>
> I was thinking of doing this
>
> 1) create an alias to the site somenewdomain.com to point to current server
> 2) run permanent 301 redirect from somedomain.com to somenewdomain.com
>
>
> I was thinking this was a clean safe way to do it so we dont have to run a
> global find replace.
>
> Concerns might be but, I don't know for sure?
>
> 1) SEO
> 2) processing / time / cost for the 301 redirect on any old
> somedomain.comrequests
>
>
> What do you guys think?

    Well, first, you get a 0.2-point deduction for not asking anything
about PHP, but since it's Friday and the folks here are about the most
creative and intelligent bunch of minds on any mailing list (call be
biased, I don't care), you still qualify for a medal.
Congratulations.

    If it were me, and this is an Apache box, I would....

        * Add a ServerAlias somenewdomain.com directive to the
somedomain.com VirtualHost entry
        * Add a mod_rewrite rule to your .htaccess file in the web
root of somedomain.com:

            RewriteEngine On
            RewriteCond %{HTTP_HOST} somedomain\.com$
            RewriteRule ^(.*)$ http://somenewdomain.com/$1 [QSA,L,R=301]

    Remember to modify your rewrite stuff to be compatible with the
present SSL status of the request, and do whatever you need to do with
regard to any subdomains or whatever.


-- 
</Daniel P. Brown>
Network Infrastructure Manager
http://www.php.net/

--- End Message ---
--- Begin Message ---
Sebastian,

I'll check into 307 I haven't used that before but, this really is a
permanent redirect. They are going to a shorter domain.

About the SEO part of it though. Would it be good to find replace all
internal links from somedomain.com to somenewdomain.com or will it follow
the 301 with no punishment or cause any other weirdnesses you can think of.

Thanks, T

On Fri, Aug 17, 2012 at 1:56 PM, Sebastian Krebs <krebs....@gmail.com>wrote:

> If you need to change the domain completely, choose "301".
>
> - Crawler will recognize it and will update their indexes quite soon.
> Especially you avoid "duplicate content"-punishments, because you say
> yourself, that the content originally comes from another domain, that isn't
> anymore (Like "It's not a duplicate, it's _the_ content, but under a
> different address").
> - The delay is negliable. Also as soon as every index were updated no
> "new" visitor should enter your site via the old domain. Browser should
> (don't know wether they do, or not) recognize "301" too and redirect any
> further request to the url on their own (think of it as "they cache the
> redirect permanently").
>
> If this change is only temporary I would recommend using "307" to avoid
> duplicate contents. I would even say, that a 307-redirect from
> somenewdomain.com to somedomain.com is more appropiate, but that depends.
>
> Regards,
> Sebastian
>
> Am 17.08.2012 21:35, schrieb Tristan:
>
>  So, I need to change from somedomain.com to somenewdomain.com
>>
>> I was thinking of doing this
>>
>> 1) create an alias to the site somenewdomain.com to point to current
>> server
>> 2) run permanent 301 redirect from somedomain.com to somenewdomain.com
>>
>>
>> I was thinking this was a clean safe way to do it so we dont have to run a
>> global find replace.
>>
>> Concerns might be but, I don't know for sure?
>>
>> 1) SEO
>> 2) processing / time / cost for the 301 redirect on any old
>> somedomain.comrequests
>>
>>
>> What do you guys think?
>>
>> Thanks, T
>>
>>
>
> --
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, visit: http://www.php.net/unsub.php
>
>

--- End Message ---
--- Begin Message ---
Daniel,

Why thank you for your mercy. That is precisely why I belong to this list.
Happy Friday!

My colleague is saying

"but I still think we should change all the references to
someolddomain.com<http://farmcreditnetwork.com/> to
some newdomain, especially in the code base, database etc..."

I don't want to introduce more problems if a find/replace doesn't go right.
Is there any valid reason for doing the quoted above or any argument
against doing that.

Thanks, T


On Fri, Aug 17, 2012 at 2:09 PM, Daniel Brown <danbr...@php.net> wrote:

> On Fri, Aug 17, 2012 at 3:35 PM, Tristan <sunnrun...@gmail.com> wrote:
> > So, I need to change from somedomain.com to somenewdomain.com
> >
> > I was thinking of doing this
> >
> > 1) create an alias to the site somenewdomain.com to point to current
> server
> > 2) run permanent 301 redirect from somedomain.com to somenewdomain.com
> >
> >
> > I was thinking this was a clean safe way to do it so we dont have to run
> a
> > global find replace.
> >
> > Concerns might be but, I don't know for sure?
> >
> > 1) SEO
> > 2) processing / time / cost for the 301 redirect on any old
> > somedomain.comrequests
> >
> >
> > What do you guys think?
>
>     Well, first, you get a 0.2-point deduction for not asking anything
> about PHP, but since it's Friday and the folks here are about the most
> creative and intelligent bunch of minds on any mailing list (call be
> biased, I don't care), you still qualify for a medal.
> Congratulations.
>
>     If it were me, and this is an Apache box, I would....
>
>         * Add a ServerAlias somenewdomain.com directive to the
> somedomain.com VirtualHost entry
>         * Add a mod_rewrite rule to your .htaccess file in the web
> root of somedomain.com:
>
>             RewriteEngine On
>             RewriteCond %{HTTP_HOST} somedomain\.com$
>             RewriteRule ^(.*)$ http://somenewdomain.com/$1 [QSA,L,R=301]
>
>     Remember to modify your rewrite stuff to be compatible with the
> present SSL status of the request, and do whatever you need to do with
> regard to any subdomains or whatever.
>
>
> --
> </Daniel P. Brown>
> Network Infrastructure Manager
> http://www.php.net/
>

--- End Message ---
--- Begin Message ---
On Fri, Aug 17, 2012 at 4:30 PM, Tristan <sunnrun...@gmail.com> wrote:
>
> My colleague is saying
>
> "but I still think we should change all the references to someolddomain.com
> to some newdomain, especially in the code base, database etc..."
>
> I don't want to introduce more problems if a find/replace doesn't go right.
> Is there any valid reason for doing the quoted above or any argument against
> doing that.

    If you have the luxury of time and resources, your colleague is
absolutely correct.  In fact, now might be the ideal time to convert
all hard-coded values to a variable or definition that need only be
changed once should this recur.

    Either way, the find/replace should definitely be done.  Should
anything happen to the original domain - expiration, transfer, or even
a temporary DNS routing issue - you're screwed.  You can't 301 from
something that isn't there in the first place (though, for good
measure, you can 301 *to* anything you'd like).  From Linux, it's
simple to write a 'for' loop to find, cat, and sed everything in the
*.php, *.inc, *.html, etc. files, and database options are even
easier.  That said, of course, make sure you've got everything backed
up just before you change the stuff, should things go awry --- and
without a current backup, you can bet your ass they will.  Murphy's
Law.

-- 
</Daniel P. Brown>
Network Infrastructure Manager
http://www.php.net/

--- End Message ---
--- Begin Message ---
On 08/17/2012 01:09 PM, Tristan wrote:
Sebastian,

I'll check into 307 I haven't used that before but, this really is a
permanent redirect. They are going to a shorter domain.

About the SEO part of it though. Would it be good to find replace all
internal links from somedomain.com to somenewdomain.com or will it follow
the 301 with no punishment or cause any other weirdnesses you can think of.

Thanks, T

On Fri, Aug 17, 2012 at 1:56 PM, Sebastian Krebs<krebs....@gmail.com>wrote:

If you need to change the domain completely, choose "301".

- Crawler will recognize it and will update their indexes quite soon.
Especially you avoid "duplicate content"-punishments, because you say
yourself, that the content originally comes from another domain, that isn't
anymore (Like "It's not a duplicate, it's _the_ content, but under a
different address").
- The delay is negliable. Also as soon as every index were updated no
"new" visitor should enter your site via the old domain. Browser should
(don't know wether they do, or not) recognize "301" too and redirect any
further request to the url on their own (think of it as "they cache the
redirect permanently").

If this change is only temporary I would recommend using "307" to avoid
duplicate contents. I would even say, that a 307-redirect from
somenewdomain.com to somedomain.com is more appropiate, but that depends.

Regards,
Sebastian

You could simply remove all full domain+path URL links and replace them with absolute path urls only.

turn http://www.somedomain.com/path/to/my/webpage.html

into /path/to/my/webpage.html

This would work with either domain.

--
Jim Lucas

http://www.cmsws.com/
http://www.cmsws.com/examples/

--- End Message ---
--- Begin Message ---
On 8/17/2012 7:16 PM, Jim Lucas wrote:
On 08/17/2012 01:09 PM, Tristan wrote:
Sebastian,

I'll check into 307 I haven't used that before but, this really is a
permanent redirect. They are going to a shorter domain.

About the SEO part of it though. Would it be good to find replace all
internal links from somedomain.com to somenewdomain.com or will it follow the 301 with no punishment or cause any other weirdnesses you can think of.

Thanks, T

On Fri, Aug 17, 2012 at 1:56 PM, Sebastian Krebs<krebs....@gmail.com>wrote:

If you need to change the domain completely, choose "301".

- Crawler will recognize it and will update their indexes quite soon.
Especially you avoid "duplicate content"-punishments, because you say
yourself, that the content originally comes from another domain, that isn't
anymore (Like "It's not a duplicate, it's _the_ content, but under a
different address").
- The delay is negliable. Also as soon as every index were updated no
"new" visitor should enter your site via the old domain. Browser should
(don't know wether they do, or not) recognize "301" too and redirect any
further request to the url on their own (think of it as "they cache the
redirect permanently").

If this change is only temporary I would recommend using "307" to avoid
duplicate contents. I would even say, that a 307-redirect from
somenewdomain.com to somedomain.com is more appropiate, but that depends.

Regards,
Sebastian

You could simply remove all full domain+path URL links and replace them with absolute path urls only.

turn http://www.somedomain.com/path/to/my/webpage.html

into /path/to/my/webpage.html

This would work with either domain.

Those would be "relative paths", ..o?

--- End Message ---
--- Begin Message ---
Hi everyone,

I'd like to see what other folks think about the idea of having APC provide
a E_WARNING or E_NOTICE when it has to expunge the cache.  Ideally, this
would include the amount of memory allocated in the error message.

The idea here is to provide system admins with information that

A. The cache had to be expunged
B. The amount of memory allocated when the cache had to be expunged

Right now, unless a close eye is kept, how is one to garner this
information.

Maybe, if the idea is interesting, it could be expanded to allow a user
defined callback method where custom behavior could be implemented.

Your feedback appreciated,

-nathan

--- End Message ---
--- Begin Message ---
On 12-08-17 05:22 PM, Nathan Nobbe wrote:
Hi everyone,

I'd like to see what other folks think about the idea of having APC provide
a E_WARNING or E_NOTICE when it has to expunge the cache.  Ideally, this
would include the amount of memory allocated in the error message.

The idea here is to provide system admins with information that

A. The cache had to be expunged
B. The amount of memory allocated when the cache had to be expunged

Right now, unless a close eye is kept, how is one to garner this
information.

Maybe, if the idea is interesting, it could be expanded to allow a user
defined callback method where custom behavior could be implemented.

Your feedback appreciated,

I like all of these ideas :)

Cheers,
Rob.
--
E-Mail Disclaimer: Information contained in this message and any
attached documents is considered confidential and legally protected.
This message is intended solely for the addressee(s). Disclosure,
copying, and distribution are prohibited unless authorized.

--- End Message ---

Reply via email to