execute("USE cardesignnews_php"); // $cdb->execute($sqlquery); //$userid = $cdb->lookup($sqlquery); $_SESSION['userid'] = $cdb->lookup($sqlquery); $userid = $_SESSION['userid']; // if($cdb->next()) { // $msg = $userid; // include 'index.php'; if($_SESSION['userid']) { // $userid=$cdb->get(0); $cdb->execute("USE cardesignnews_unify"); $cdb->execute("SELECT group_id FROM user_group_members INNER JOIN users ON user_group_members.user_id=users.id WHERE user_id=$userid"); $cdb->next(); $astatus=$cdb->get(0); if($astatus==1) { // ie a paid member $allow_content=1; $_SESSION['allow_content'] = 1; } $allow_content=1; $_SESSION['allow_content'] = 1; } } $webmaster="webmaster@cardesignnews.com"; $siteurl="http://cdn.invades.org"; // call this function to unencode \ and ' in form // data (which have been encoded for insert into db) // and translate html special chars. function unencode_form() { global $HTTP_POST_VARS, $HTTP_GET_VARS; reset($HTTP_POST_VARS); while(list($key, $val)=each($HTTP_POST_VARS)) { if(!is_array($GLOBALS[$key])) { $GLOBALS[$key]=(str_replace("\\\\", "\\", $val)); $GLOBALS[$key]=htmlspecialchars(str_replace("''", "'", $GLOBALS[$key])); } } reset($HTTP_GET_VARS); while(list($key, $val)=each($HTTP_GET_VARS)) { if(!is_array($GLOBALS[$key])) { $GLOBALS[$key]=(str_replace("\\\\", "\\", $val)); $GLOBALS[$key]=htmlspecialchars(str_replace("''", "'", $GLOBALS[$key])); } } } // only use HTTP_REFERER as backlink if it was linked from this site if($HTTP_REFERER!=""&&strpos("+".$HTTP_REFERER, $siteurl)) $backlink=$HTTP_REFERER; else $backlink="index.php"; // formats the date the way we want all over the site function df($date) { return date("d M Y", $date); } // validate emails function check_mail($email) { $invalid_digits="\n\r\t "; $k=strlen($email); if($k<1) return 0; for($i=0;$i<$k;$i++) if((strstr($invalid_digits, substr($email, $i, 1)))) break; if($i!=$k) return 0; $ary=explode("@", $email); $ary2=explode(".", $ary[1]); if(count($ary)!=2||count($ary2)<2||strlen($ary[0])<1) return 0; return 1; } // insert a list of radio buttons function insert_check_list($tablename, $fieldname) { global $db; $db->execute("select ID, Name from $tablename"); while($db->next()) { ?> geth(1)?>
\n"; } function insert_dropdown_list($tablename, $fieldname, $selectedval, $addfield=1) { global $db; echo " Frankfurt Motor Show 2005 - Highlights
 What we've seen • Our photos and comment

   
Page 3 of 5