TutorialMachine.com has finally launched, time to start loading Tutorials from photoshop to css design.
Archive for May, 2008...
Filed under AnnoucementsComments (0) Posted by sp on Monday, May 26th, 2008
Filed under Programming, Javascript
Please review this great example by Dav Glass:
http://blog.davglass.com/files/yui/animseq/
Comments (0) Posted by sp on Saturday, May 24th, 2008
Filed under Programming, Javascript
Just an example.
CODE:
-
/**
-
* Collects all inner elements and resizes accordingly.
-
* @method resizeAll
-
*/
-
this.resizeAll = function () {
-
var tempEL = el;
-
var tempObj = tempEL.getElementsByTagName("img");
-
for(i=0;i<tempObj.length;i++){
-
var tempAnimation = new YAHOO.util.Anim(tempObj[i].getAttribute("id"), this.attributes, this.duration, this.method);
-
tempAnimation.animate();
-
}
-
var tempObj = tempEL.getElementsByTagName("input");
-
for(i=0;i<tempObj.length;i++){
-
var tempAnimation = new YAHOO.util.Anim(tempObj[i].getAttribute("id"), this.attributes, this.duration, this.method);
-
tempAnimation.animate();
-
}
-
-
}
Comments (0) Posted by sp on Friday, May 23rd, 2008
Filed under Programming, Server
I am always on the lookout for a nice simple htpasswd generator and I found a pretty nice one.
http://www.htaccesstools.com/htpasswd-generator/
Enjoy!
Comments (0) Posted by sp on Thursday, May 22nd, 2008
Filed under Programming, PHP
Hey all,
So how can you read a user who just logged in with htacess?
CODE:
-
$auth_username = $_SERVER['REMOTE_USER']
Make sure you have it right by checking phpinfo().
Comments (0) Posted by sp on Monday, May 12th, 2008
Filed under Programming, PHP
My problem - when a user logged into my website and then went to my "blog" area (which did not require any logging in) Wordpress would removed all the sessions I had set.
Why did it do this?
If we open wp-settings.php the first few lines of code completely remove all session information (as well as other).
CODE:
-
function wp_unregister_GLOBALS() {
-
if ( !ini_get('register_globals') )
-
return;
-
-
if ( isset($_REQUEST['GLOBALS']) )
-
die('GLOBALS overwrite attempt detected');
-
-
// Variables that shouldn't be unset
-
$noUnset = array('GLOBALS', '_GET', '_POST', '_COOKIE', '_REQUEST', '_SERVER', '_ENV', '_FILES', 'table_prefix');
-
-
$input = array_merge($_GET, $_POST, $_COOKIE, $_SERVER, $_ENV, $_FILES, isset($_SESSION) && is_array($_SESSION) ? $_SESSION : array());
-
foreach ( $input as $k => $v )
-
if ( !in_array($k, $noUnset) && isset($GLOBALS[$k]) ) {
-
$GLOBALS[$k] = NULL;
-
unset($GLOBALS[$k]);
-
}
-
}
To fix this issue I did the following:
CODE:
-
function wp_unregister_GLOBALS() {
-
if ( !ini_get('register_globals') )
-
return;
-
-
if ( isset($_REQUEST['GLOBALS']) )
-
die('GLOBALS overwrite attempt detected');
-
-
// Variables that shouldn't be unset
-
$noUnset = array('GLOBALS', '_GET', '_POST', '_COOKIE', '_REQUEST', '_SERVER', '_ENV', '_FILES', 'table_prefix','_SESSION');
-
-
$input = array_merge($_GET, $_POST, $_COOKIE, $_SERVER, $_ENV, $_FILES);
-
foreach ( $input as $k => $v )
-
if ( !in_array($k, $noUnset) && isset($GLOBALS[$k]) ) {
-
$GLOBALS[$k] = NULL;
-
unset($GLOBALS[$k]);
-
}
-
}
Comments (0) Posted by sp on Thursday, May 8th, 2008