$value) { echo '
'.$key.' = '.$value; } /* DEBUG */ /******************************/ /* GLOBALS */ /******************************/ global $siteobject; global $topicobject; global $pageobject; global $visitorobject; global $adminflag; global $masterdatabaselink; /******************************/ /* FUNCTIONS */ /******************************/ /******************************/ /* Main Page */ /* generate web page */ /******************************/ /* INITIALIZATIONS */ $incomingurl = $_SERVER['REQUEST_URI']; $documentroot = $_SERVER['DOCUMENT_ROOT']; //echo '
incoming url is '.$incomingurl; $masterdatabaselink = 0; //$currentuser = $_SESSION['valid_user']; $authorizeloadpage = 'T'; $today = date('Y-m-d'); /* VALIDATE ADMIN */ //SetAdminFlag( $currentuser ); /* PREPARE */ //$statusmessage = CheckValidUser(); $testurl = strtolower($incomingurl); //echo $testurl; /* CHECK FOR HOME PAGE */ if ( ( $testurl == '/index.html' ) OR ( $testurl == '/index.htm' ) OR ( $testurl == '/index.php' ) OR ( $testurl == '/index.php4' ) OR ( $testurl == '/index.php5' ) OR ( $testurl == '/index.rb' ) OR ( $testurl == '/index.py' ) OR ( $testurl == '/index.pyc' ) OR ( $testurl == '/index.pyo' ) OR ( $testurl == '/index.asp' ) OR ( $testurl == '/index.aspx' ) OR ( $testurl == '/index.adp' ) OR ( $testurl == '/index.jsp' ) OR ( $testurl == '/index.pl' ) OR ( $testurl == '/' ) ) { require_once(PHP_PATH . 'homepage.html'); exit; } $questionstring= ''; $location = strpos($testurl, '?'); If ($location === FALSE) $strippedurl = $testurl; else { $strippedurl = substr($testurl, 0, $location); $questionstring = substr($testurl, $location); } /* echo '
testurl of '.$testurl.' and stripped = '.$strippedurl.' and question string of '.$questionstring.'
'; /* DEBUG */ /* CHECK FOR SCIFI */ if ( ( $testurl == '/scifi.html' ) OR ( $testurl == '/scifi.htm' ) OR ( $testurl == '/scifi.php' ) OR ( $testurl == '/scifi.php4' ) OR ( $testurl == '/scifi.php5' ) OR ( $testurl == '/scifi.rb' ) OR ( $testurl == '/scifi.py' ) OR ( $testurl == '/scifi.pyc' ) OR ( $testurl == '/scifi.pyo' ) OR ( $testurl == '/scifi.asp' ) OR ( $testurl == '/scifi.aspx' ) OR ( $testurl == '/scifi.adp' ) OR ( $testurl == '/scifi.jsp' ) OR ( $testurl == '/scifi.pl' ) OR ( $testurl == '/scifi/?/scifi' ) OR ( $testurl == '/scifi/' ) OR ( strcasecmp($testurl, '/scifi/?/scifi') == 0 ) OR ( strcasecmp($testurl, '/scifi/') == 0 ) OR ( strcasecmp($testurl, '/scifi') == 0 ) ) { require_once(SCIFI_PATH . 'scifi.html'); exit; } /* CHECK FOR STORY */ if ( ( $testurl == '/story.html' ) OR ( $testurl == '/story.htm' ) OR ( $testurl == '/story.php' ) OR ( $testurl == '/story.php4' ) OR ( $testurl == '/story.php5' ) OR ( $testurl == '/story.rb' ) OR ( $testurl == '/story.py' ) OR ( $testurl == '/story.pyc' ) OR ( $testurl == '/story.pyo' ) OR ( $testurl == '/story.asp' ) OR ( $testurl == '/story.aspx' ) OR ( $testurl == '/story.adp' ) OR ( $testurl == '/story.jsp' ) OR ( $testurl == '/story.pl' ) OR ( $testurl == '/story/?/story' ) OR ( $testurl == '/story/' ) OR ( strcasecmp($testurl, '/story/?/story') == 0 ) OR ( strcasecmp($testurl, '/story/') == 0 ) OR ( strcasecmp($testurl, '/story') == 0 ) ) { require_once(STORY_PATH . 'story.html'); exit; } /* CHECK FOR COMPUTER */ if ( ( $testurl == '/virtualcomputer.html' ) OR ( $testurl == '/virtualcomputer.htm' ) OR ( $testurl == '/virtualcomputer.php' ) OR ( $testurl == '/virtualcomputer.php4' ) OR ( $testurl == '/virtualcomputer.php5' ) OR ( $testurl == '/virtualcomputer.rb' ) OR ( $testurl == '/virtualcomputer.py' ) OR ( $testurl == '/virtualcomputer.pyc' ) OR ( $testurl == '/virtualcomputer.pyo' ) OR ( $testurl == '/virtualcomputer.asp' ) OR ( $testurl == '/virtualcomputer.aspx' ) OR ( $testurl == '/virtualcomputer.adp' ) OR ( $testurl == '/virtualcomputer.jsp' ) OR ( $testurl == '/virtualcomputer.pl' ) OR ( $testurl == '/virtualcomputer/?/virtualcomputer' ) OR ( $testurl == '/virtualcomputer/' ) OR ( strcasecmp($testurl, '/virtualcomputer/?/virtualcomputer') == 0 ) OR ( strcasecmp($testurl, '/virtualcomputer/') == 0 ) OR ( strcasecmp($testurl, '/virtualcomputer') == 0 ) ) { require_once(COMPUTER_PATH . 'virtualcomputer.html'); exit; } /* CHECK FOR CYBER SECURITY GAME */ if ( ( $testurl == '/cybersecuritygame.html' ) OR ( $testurl == '/cybersecuritygame.htm' ) OR ( $testurl == '/cybersecuritygame.php' ) OR ( $testurl == '/cybersecuritygame.php4' ) OR ( $testurl == '/cybersecuritygame.php5' ) OR ( $testurl == '/cybersecuritygame.rb' ) OR ( $testurl == '/cybersecuritygame.py' ) OR ( $testurl == '/cybersecuritygame.pyc' ) OR ( $testurl == '/cybersecuritygame.pyo' ) OR ( $testurl == '/cybersecuritygame.asp' ) OR ( $testurl == '/cybersecuritygame.aspx' ) OR ( $testurl == '/cybersecuritygame.adp' ) OR ( $testurl == '/cybersecuritygame.jsp' ) OR ( $testurl == '/cybersecuritygame.pl' ) OR ( $testurl == '/cybersecuritygame/?/cybersecuritygame' ) OR ( $testurl == '/cybersecuritygame/' ) OR ( strcasecmp($testurl, '/cybersecuritygame/?/cybersecuritygame') == 0 ) OR ( strcasecmp($testurl, '/cybersecuritygame/') == 0 ) OR ( strcasecmp($testurl, '/cybersecuritygame') == 0 ) ) { require_once(GAME_PATH . 'cybersecuritygame.html'); exit; } /* CHECK FOR BUSINESS PLAN */ if ( ( $testurl == '/businessplan' ) OR ( $testurl == '/businessplan.html' ) ) { require_once(PHP_PATH . 'businessplan.html'); exit; } /* examine possible topics */ $urlarray = explode('/',$incomingurl); $urlcount = count($urlarray); /* strip URL */ $lasturlitem = $urlarray[$urlcount-1]; /* find last item */ $rawlastitem = $lasturlitem; $firsturlitem = $urlarray[1]; /* find first item */ //$lasturlitem = strtolower($lasturlitem); /* make lower case */ //$firsturlitem = strtolower($firsturlitem); /* make lower case */ $endings = array(".html", ".htm", ".php", ".php4", ".php5", ".rb", ".py", ".pyc", ".pyo", ".asp", ".aspx", ".adp", ".jsp", ".pl"); $lasturlitem = str_ireplace($endings, '', $lasturlitem); /* remove endings */ //echo 'last item is ***'.$lasturlitem.'***
'; /* DEBUG */ $tempstring = strstr($lasturlitem,'?',TRUE); /* remove anything after a question mark */ //echo 'temp string is *'.$tempstring.'*
'; /* DEBUG */ //echo 'last item is '.$lasturlitem.'
'; /* DEBUG */ if ( $tempstring != '' ) $topicstring = $tempstring; /* and save */ else $topicstring = $lasturlitem; /* and save */ $topicstring = rawurldecode($topicstring); //echo 'topic string is '.$topicstring.'
'; /* DEBUG */ $parameterlist = strstr($lasturlitem,'?'); /* and collect the parameters, if any */ $paremlocation = strpos($lasturlitem,$parameterlist); if ($paremlocation >= 1) $lasturlitem = substr($lasturlitem, 0, $paremlocation); if ($lasturlitem == '') $topicstring = $firsturlitem; /* DEBUG PAGE INFO: for ($i = 1; $i < $urlcount; $i++) { echo '
level '.$i.' is '.$urlarray[$i]; } echo '
topic is '.$topicstring; echo '
first item is '.$firsturlitem; echo '
last item is '.$lasturlitem; echo '
parameters are '.$parameterlist; echo '

'; END DEBUG INFO */ /* CHECK FOR NUMBERS */ /* check for any part being the word number or numbers */ $numberwordfoundflag = false; for ($i = 1; $i < $urlcount; $i++) { $currentexamine = $urlarray[$i]; if ( ($currentexamine == 'number') OR ($currentexamine == 'numbers') ) $numberwordfoundflag = true; } if ( is_numeric($lasturlitem) ) { require_once(PHP_PATH . 'number.html'); exit; } else if ( ($numberwordfoundflag) OR ($rawlastitem == 'numbers.html') ) { require_once(PHP_PATH . 'numbermain.html'); exit; } /* CHECK FOR HITS FOR HIRE */ if ( ( $testurl == '/hitsforhire' ) OR ( $topicstring == 'hits for hire' ) OR ( $lasturlitem == 'hitsforhire' ) ) { require_once(PHP_PATH . 'hitsforhire.html'); exit; } /* DROP INTO DEFAULT TOPIC STUFF */ /* CHECK FOR WORDS */ require_once(PHP_PATH . 'word.html'); exit; /* DEBUG PAGE INFO: for ($i = 1; $i < $urlcount; $i++) { echo '
level '.$i.' is '.$urlarray[$i]; } echo '
topic is '.$topicstring; echo '
first item is '.$firsturlitem; echo '
last item is '.$lasturlitem; echo '
parameters are '.$parameterlist; echo '

'; END DEBUG INFO */ ?> welcome to Outrageous Coder <?php echo $topicstring; ?> page

welcome to OutrageousCoder

your topic is

in the subject area of '.$firsturlitem.''; } DisplayFindNumberTool(); ShowTwitter(); echo '
'; /* report incoming string */ //echo 'on test page
'; /* DEBUG */ echo $incomingurl; /* DEBUG */ //echo '
document root: '.$documentroot; /* DEBUG */ echo '
'; ?> '; /* DEBUG */ /* CREATE VISITOR OBJECT */ $visitorobject = new VisitorClass(1); //echo 'creating visitor object
'; /* DEBUG */ /* CREATE TOPIC OBJECT */ $topicobject = new TopicClass(0,'complete'); /* zero = determine from URL */ //echo 'creating topic object
'; /* DEBUG */ /* CREATE PAGE OBJECT */ //echo 'TESTING '.$topicobject->getattribute('compacttopic', 'formatted').' TESTING
'; /* DEBUG */ if ($topicobject->getattribute('compacttopic', 'raw') == 'topicfinder' ) $pageobject = new TopicFinderPageClass($topicobject); elseif ($topicobject->getattribute('compacttopic', 'raw') == 'politicsandpoliticalscience' ) $pageobject = new PoliticsPageClass($topicobject); else $pageobject = new PageClass($topicobject); //echo 'creating page object
'; /* DEBUG */ /* DRAWPAGE */ $pageobject->renderpage($topicobject); //echo 'finished rendering page
'; /* DEBUG */ /* FOR TESTING */ /* REPORT INFO IN TOPIC OBJECT */ //echo 'on test page
'; /* DEBUG */ //$topicobject->testdisplay(); /* DEBUG */ //echo $incomingurl.'
'; /* DEBUG */ // echo $lasturlitem.'
'; exit; /* no matching web page */ header("HTTP/1.0 404 Not Found"); include_once("404.shtml"); exit();