. * * ------------------------------------------------------------------------ * DESCRIPTION: * ------------------------------------------------------------------------ * This library tells the PHP4 session handler to write to a MySQL database * instead of creating individual files for each session. * * Create a new database in MySQL called "sessions" like so: * * CREATE TABLE sessions ( * sesskey char(32) not null, * expiry int(11) unsigned not null, * value text not null, * PRIMARY KEY (sesskey) * ); * * ------------------------------------------------------------------------ * INSTALLATION: * ------------------------------------------------------------------------ * Make sure you have MySQL support compiled into PHP4. Then copy this * script to a directory that is accessible by the rest of your PHP * scripts. * * ------------------------------------------------------------------------ * USAGE: * ------------------------------------------------------------------------ * Include this file in your scripts before you call session_start(), you * don't have to do anything special after that. */ $SESS_DBHOST = "scottflodin.duckdns.org"; /* database server hostname */ $SESS_DBUSER = "scottflodin"; /* database user */ $SESS_DBPASS = "nidolf"; /* database password */ $SESS_DBNAME = "totalca_main"; /* database name */ $SESS_DBHOST = "localhost"; /* database server hostname */ $SESS_DBUSER = "totalca"; /* database user */ $SESS_DBPASS = "j5#8Cu4a"; /* database password */ $SESS_DBNAME = "totalca_main"; /* database name */ $SESS_DBH = ""; $SESS_LIFE = (3600 * 24 * 365); // (1 hour) * (24 hours) * (365 days) session_set_cookie_params($SESS_LIFE); function sess_open($save_path, $session_name) { global $SESS_DBHOST, $SESS_DBNAME, $SESS_DBUSER, $SESS_DBPASS, $SESS_DBH; if (! $SESS_DBH = mysql_connect($SESS_DBHOST, $SESS_DBUSER, $SESS_DBPASS)) { echo "
  • Can't connect to $SESS_DBHOST as $SESS_DBUSER"; echo "
  • MySQL Error: ", mysql_error() . ' - SESSION duck'; die; } if (! mysql_select_db($SESS_DBNAME, $SESS_DBH)) { echo "
  • Unable to select database $SESS_DBNAME" . ' - SESSION duck'; die; } return true; } function sess_close() { return true; } function sess_read($key) { global $SESS_DBH, $SESS_LIFE; $qry = "SELECT value FROM sessions WHERE sesskey = '".$key."'"; $qid = mysql_query($qry, $SESS_DBH); if (list($value) = mysql_fetch_row($qid)) { return $value; } return false; } function sess_write($key, $val) { global $SESS_DBH, $SESS_LIFE; $expiry = time() + $SESS_LIFE; $value = addslashes($val); $qry = "INSERT INTO sessions VALUES ('$key', $expiry, '$value')"; $qid = mysql_query($qry, $SESS_DBH); if (! $qid) { $qry = "UPDATE sessions SET expiry = $expiry, value = '".$value."' WHERE sesskey = '".$key."'"; $qid = mysql_query($qry, $SESS_DBH); } return $qid; } function sess_destroy($key) { global $SESS_DBH; $qry = "DELETE FROM sessions WHERE sesskey = '".$key."'"; $qid = mysql_query($qry, $SESS_DBH); session_unset(); // FLODIN added 2004_09_20 global $session_expired; // FLODIN added 2005_07_26 $session_expired = 1; // FLODIN added 2004_09_20 return $qid; } function sess_gc($maxlifetime) { global $SESS_DBH; $qry = "DELETE FROM sessions WHERE expiry < " . time(); //$qid = mysql_query($qry, $SESS_DBH); //return mysql_affected_rows($SESS_DBH); } session_set_save_handler( "sess_open", "sess_close", "sess_read", "sess_write", "sess_destroy", "sess_gc"); ?> California Politics and People | TotalCapitol

    Advertise on Total Capitol

    TotalCapitol.com is viewed each month by thousands of lobbyists, state and federal legislators, legislative staff, the governor's administration, agency personnel, campaign professionals, fundraisers and members of the print, radio and TV media. They visit TotalCapitol.com a few times a day so they don't miss anything important to state politics and policy. These are people who eat at restaurants, vacation across the world, hire firms, buy flowers, clothes, wine and cars.

    Your ad on TotalCapitol.com will target the potential customers you want.


    Advertising on Total Capitol is affordable:

    Website banner ad of 120 pixels by 90 pixels

    Appearing on the front page and throughout TotalCapitol.com. Ads appear at the top of every page on the website.

    $125 per 2 weeks or $225 per month
      Example

    Advertise in our twice-daily news e-mails

    Your message delivered to the in-box of our growing membership.

    $125 per 2 weeks or $225 per month
     
    This e-mail sponsored by

    Exclusive banner ad 750 pixels by 90 pixels

    Appearing on front and throughout TotalCapitol.com (only one on site per month).

    $1,000 per month

    Example:

     

    Graphical ads can be supplied in .gif, .jpg or .swf (Flash) format. Clicks on these ads link visitors to the advertisers' web sites.

    Once we receive your ad and payment, we will post your ad within 24 hours. You will also receive a receipt via e-mail for your records.

    For more information, contact Scott Flodin at 626-665-2335 or Gino DiCaro at 916-730-3443.


    Or send us e-mail:
    Your name:
    Your e-mail:
    Your phone:
    Message:

    - // STRIPE FORM