Posted on July 2, 2008 by afruj
Wanna generating reports with pdf format from HTML or PHP? No probs. Following converters will help you:
DOMPDF: It generates PDF from HTML and very easy to use. You may find it here http://www.digitalj unkies.ca/ dompdf/about. php
TCPDF: TCPDF is a Free Libre Open Source PHP class for generating PDF documents without requiring external extensions. TCPDF project [...]
Filed under: PHP | Tagged: PDF, PHP | Leave a Comment »
Posted on July 2, 2008 by afruj
Storing sessions in a database:
We use the following codes to storing sessions in a database:
<?php
session_set_save_handler(‘_open’,
‘_close’,
‘_read’,
‘_write’,
‘_destroy’,
‘_clean’);
function _open()
{
global $_lms_db;
$db_user = $_SERVER['DB_USER'];
$db_pass = $_SERVER['DB_PASS'];
$db_host = ‘localhost’;
if ($_sess_db = mysql_connect($db_host, $db_user, $db_pass))
{
return mysql_select_db(‘Clientsessions’, $_lms_db);
}
return FALSE;
}
function _close()
{
global $_lms_db;
return mysql_close($_lms_db);
}
function _read($id)
{
global $_lms_db;
$id = mysql_real_escape_string($id);
$sql = “SELECT data
FROM Clientsessions
WHERE id = ‘$id’”;
if [...]
Filed under: PHP, Session | Tagged: database, Session | Leave a Comment »