Wednesday, March 23, 2011

Increase the phpMyAdmin Session Timeout

You can override the setting for phpMyAdmin Session Timeout.
1.Open up config.inc.php in the root phpMyAdmin directory
2. Add this code anywhere on the document:

$cfg['LoginCookieValidity'] = ;

Where is some number larger than 1800. For example, 28800 works out to be 8 hours.

Disclaimer! It should go without saying that increasing the timeout is a (comparatively minor) security risk (but a risk nonetheless). Obviously, do not do this on your production server. And as always, proceed with caution.

Wednesday, March 2, 2011

php javascript confirm alert box


There are many times when you are working with php, drawing content from mysql and you need a function to draw on the Javascript confirm (alert with Yes and No option buttons) script. Learn how to pass in a parameter to Javascript and open another php file to complete the confirm action.

First write the Javascript function that passes a parameter
function go_there(name)
{
var p=name;
 var where_to= confirm("This action sends the data for this profile to the analysis center nd you will not be able to change the data later.\r\nAre you sure you want to make your data Finalized READ ONLY? ");
 if (where_to== true)
 {
   window.location="index.php?page=finalize&profile="+p;
 }

}

Then on you php call the function: I have removed all quotes, therefore fix the code before use.

echo go_there(. $data[profile].); href=#>finalize;



enjoy!