
11-06-2008, 13:43
|
|
|
|
חבר מתאריך: 26.02.08
הודעות: 18
|
|
אני מעדיף לעשות שאילתא כמו שעשיתי, לא יודע למה פשוט מעדיף..
ועמנואל, אתה לא קורא עד הסוף :S
ציטוט:
[שימו לב שבREQUIRE יש some_config_file, בקוד המקורי יש ייבוא של קובץ קונפיג עם כל הפונקציות והמשתנים שהשתמשתי בהם ולא מוגדרים כאן]
|
אם זה כ"כ חשוב, הנה הקוד של הקובץ קונפיג[עובד]:
קוד PHP:
<?php $con = mysql_connect("localhost", "***", "***"); mysql_select_db("***", $con); $log_nameq = mysql_query("SELECT user FROM users WHERE id='".$_COOKIE['userid']."'"); $log_name = mysql_fetch_assoc($log_nameq); $log_name = $log_name['user']; $ptime = time()+(60*60*7)+(60*1); $site_add_a = ((substr($_SERVER['SERVER_NAME'],0,4) == 'www.') ? 'http://'.substr($_SERVER['SERVER_NAME'],4).'/' : 'http://'.$_SERVER['SERVER_NAME'].'/'); $site_add_b = ((substr($_SERVER['SERVER_NAME'],0,4) == 'www.') ? 'http://'.substr($_SERVER['SERVER_NAME'],4).'/adm/' : 'http://'.$_SERVER['SERVER_NAME'].'/adm/'); function main_page(){ global $site_add_a; global $site_add_b; echo <<<HTML <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> <html xmlns="http://www.w3.org/1999/xhtml" lang="he" xml:lang="he" dir="rtl"> <head> <title>אדמין</title> <meta http-equiv="Content-Type" content="text/html; charset=Windows-1255" /> <meta http-equiv="content-language" content="he" /> <link href="{$site_add_b}css.css" rel="stylesheet" type="text/css" /> <meta http-equiv="cache-control" content="no-store, no-cache, must-revalidate" /> <meta http-equiv="cache-control" content="post-check=0, pre-check=0" /> <meta http-equiv="Pragma" content="no-cache" /> </head> <frameset cols="*, 185" frameborder="0" border="0" framespacing="0"> <frame name="body" scrolling="auto" src="{$site_add_b}enter.php"> <frame name="menu" scrolling="auto" src="{$site_add_b}menu.php"> </frameset> </html> HTML; } //============================================= function cp_header(){ global $site_add_a; global $site_add_b; echo <<<HTML <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> <html xmlns="http://www.w3.org/1999/xhtml" lang="he" xml:lang="he" dir="rtl"> <head> <title>אדמין</title> <meta http-equiv="Content-Type" content="text/html; charset=Windows-1255" /> <meta http-equiv="content-language" content="he" /> <link href="{$site_add_b}css.css" rel="stylesheet" type="text/css" /> <meta http-equiv="cache-control" content="no-store, no-cache, must-revalidate" /> <meta http-equiv="cache-control" content="post-check=0, pre-check=0" /> <meta http-equiv="Pragma" content="no-cache" /> </head> <body> HTML; } function cp_footer(){ echo <<<HTML </body> </html> HTML; } //============================================= function no_pre(){ global $site_add_a; global $site_add_b; echo <<<HTML <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> <html xmlns="http://www.w3.org/1999/xhtml" lang="he" xml:lang="he" dir="rtl"> <head> <title>אדמין</title> <meta http-equiv="Content-Type" content="text/html; charset=Windows-1255" /> <meta http-equiv="content-language" content="he" /> <link href="{$site_add_b}css.css" rel="stylesheet" type="text/css" /> <meta http-equiv="cache-control" content="no-store, no-cache, must-revalidate" /> <meta http-equiv="cache-control" content="post-check=0, pre-check=0" /> <meta http-equiv="Pragma" content="no-cache" /> <script type="text/javascript"> if (top != self) { top.location = self.location; } </script> </head> <body> <div class="no"> HTML; if (!isset($_COOKIE['userid'], $_COOKIE['userpre']) || !isset($_COOKIE['cp_log'])){ echo 'אינך מחובר.<br /> <a href="'.$site_add_a.'club/login.php">התחבר למערכת</a> || <a href="'.$site_add_a.'cp_log.php">התחבר לפאנל</a>'; } else { echo 'אינך מורשה להיכנס לעמוד זה.<br /> במידה ואתה סבור שאמורה להיות לך הרשאה להיכנס לעמוד זה,<a href="'.$site_add_a.'pages/contact.php">צור קשר עם בעל האתר</a>.'; } echo <<<HTML </div> </body> </html> HTML; } ?>
ניסיתי גם error_reporting וגם ini_set ולא הוצגה לי אף שגיאה..
|