Tue Sep 20, 2011 7:55 am
<?php
if(!isset($_SESSION))
{
session_start();
}
$now = time();
$limit = $now;
if(isset($_SESSION['last_activity']) && ($_SESSION['last_activity'] < $limit))
{
$_SESSION = array();
header('Location:logout.php');
exit;
}
else
{
//the current time
$_SESSION['last_activity'] = $now;
}
?>
Thu Sep 22, 2011 11:14 am
Thu Sep 22, 2011 11:17 am
Thu Sep 22, 2011 11:59 am
<?php
$hostname="localhost";
$username="username";
$password="password";
$dbconnection= mysql_connect ($hostname, $username, $password);
if (!$dbconnection) {
die (" cannot connect to database");
}
$result=mysql_select_db ("databasename");
if (! $result) {
die ("database could not be selected");
}
echo "Database ready.";
?>
$query_res = mysql_query( "SELECT * from tableName" );
Thu Sep 22, 2011 12:37 pm
Fri Sep 23, 2011 1:32 am
$date = date("Y-m-d H:i:s");
$query =" INSERT INTO `user` VALUES (0,null,'$country_code','$username','$firstname','$lastname','$password','
$address1',
'$address2','$telephone','$mobile','$email','$city',0,'$date','$date','$date_birthday','$gender',0,'$activationkey',0)";
$result =mysql_query($query );
echo mysql_error();
Codemiles.com is a participant in the Amazon Services LLC Associates Program, an affiliate advertising program designed to provide a means for sites to earn advertising fees by advertising and linking to Amazon.com
Powered by phpBB © phpBB Group.