Sancar Saran wrote:
Greetings,

I had some problems with broser caching behaviors and php name space collision. I do lot of googling and try to figure what happened and I failed to figure. So I need help,
Here Details

1-) Browser Cache Beahviors
You know the back button problem. I search the net and found some header modifications to fix this problems.

Like this

ini_set('session.cache_limiter', 'private');
that's not a header, it's a php.ini setting. Just not-picking though, don't have an answer to this as I've personally never had problems with caching (then again, I also rarely use sessions)

And this will lead the some caching issues. Time to time browser may forgot or misbehave with javascripts.

Is there any suggestion for this.

When visitor hit back button and previous page has retun data from post variables.

1-) Re posting without any message
2-) No content cache


2-) The another problem was developing aproach.

Currently I'm working on large CMS thingy. My project be able to include php files anytime anywhere and unlimited amount.

So time to time variable names will collide and it was so hard to detect.
Prefix your variables if they're important. You probably couldn't care less if variables like $i, $j, $k, etc. are overwritten, but variables holding important content for you should be "secured" by either storing them in a specific place you know to be safe, or by prefixing them. eg: $myApp_foo, $myAll_bar, etc. If anyone makes an include for you, they will be very unlikely to use such names there too. The other way, which I personally prefer is to put everything important and non-local (ie. isn't confined to that one file it's run in) in special purpose arrays:
$SETTINGS[various names], $SELF[names], $MYAPP_SAFE[names]

Is there any suggestion to avoid these kind of collisions.

Thanks
Sancar

--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php

Reply via email to