Jump to content

blueman378

Members
  • Posts

    888
  • Joined

  • Last visited

    Never

Everything posted by blueman378

  1. hey i checked and there isnt anything, heres index.php <?php include("../include/session.php"); ?> <!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"> <head> <meta http-equiv="Content-Type" content="text/html; charset=UTF-8"> <title>Welcome to HCB games <?php echo date('l dS \of F Y h:i:s A'); ?></title> <meta name="keywords" content="play free games online flash games flash arcade swf cool movies cartoons"> <meta name="robots" content="index, follow"> <meta name="description" content="Play free flash games online, watch cool movies and cartoons!"> <link rel="stylesheet" type="text/css" href="../index.css" media="all"> </head> <body> <div id="wrapper" style="width: 92%;" align="center"> <div id="header"> <div class="heada"> <div class="headc"> <table border="0" cellspacing="0"> <tbody><tr> <td><a linkindex="0" href="http://localhost/" title=""><img class="logo" src="../images/logo.png" alt="Game Script" border="0" height="84" hspace="10" width="284"></a></td> <td rowspan="2" valign="top"> <div class="topmenu"> <a linkindex="1" href="http://localhost/page-memberlist" class="topmenu">Memberlist</a> | <a linkindex="2" href="http://localhost/page-about_us" class="topmenu">About Us</a> | <a linkindex="3" href="http://localhost/page-help" class="topmenu">Help</a> | <a href="mailto:" class="topmenu">Contact Us</a> | <a class="topmenu" href="mailto:?subject=Play%20Free%20Games%20at%20HCB%20Games%21">Tell a Friend</a> | <a class="topmenu" href="http://localhost/">Bookmark Us</a> </div> <div class="quickgame"> Quick Play: <select id="games" name="games" onchange="switchme()"> <option value="">--select a game--</option> </select> <img src="../images/px.gif" align="absmiddle" height="23" width="4"></div> </td> </tr> <tr class="navigator"> <td class="menu"><ul> <li><span><img src="../images/px.gif" align="absmiddle" height="23" width="40"></span></li> <li class="sel"><span>Games</span></li><li class="unsel"><a linkindex="4" href="http://localhost/index.php?mcid=2">Movies</a></li> </ul></td> </tr> </tbody></table> </div> </div> </div> <div id="submenu"> <div class="submenua"> <div class="submenuc"> <div> <a linkindex="5" href="http://localhost/cat-1-p0.html" class="submenu">Action / Adventure</a> | <a linkindex="6" href="http://localhost/cat-8- p0.html" class="submenu">Beat em up</a> | <a linkindex="7" href="http://localhost/cat-5-p0.html" class="submenu">Other</a> | <a linkindex="8" href="http://localhost/cat-3-p0.html" class="submenu">Puzzle</a> | <a linkindex="9" href="http://localhost/cat-6-p0.html" class="submenu">Racing</a> | <a linkindex="10" href="http://localhost/cat-7-p0.html" class="submenu">Retro</a> | <a linkindex="11" href="http://localhost/cat-4-p0.html" class="submenu">Shoot 'em up</a> | <a linkindex="12" href="http://localhost/cat-2-p0.html" class="submenu">Sports</a></div> </div> </div> </div> <div id="submenushadow"> <div class="sushada"> <div class="sushadc"> </div> </div> </div> <div class="wrappera"> <div class="wrapperc"> <div id="content"> <div class="wideboxs adsbox"><div class="boxs_head adsbox"><span></span></div><div class="boxs_body adsbox"><p align="center"><? /** * User not logged in, display the login form. * If user has already tried to login, but errors were * found, display the total number of errors. * If errors occurred, they will be displayed. */ if($form->num_errors > 0){ echo "<font size=\"2\" color=\"#ff0000\">".$form->num_errors." error(s) found</font>"; echo $form->error("user"); echo $form->error("pass"); } ?> </p></div></div> <table class="content" border="0" cellspacing="5"> <tbody><tr><td class="sidecol" width="1"><div class="boxs bluebox"><div class="boxs_head bluebox"><h2>Top Games</h2></div><div class="boxs_body bluebox"><p></p><table class="topgamescashe" cellspacing="1"> <tbody><tr><td class="topgamerowalt"><a linkindex="13" href="http://localhost/play-4017- _Heli_Strike.html"> Heli Strike</a></td><td class="topgamerowalt" align="right">278</td></tr> <tr><td class="topgamerow"><a linkindex="14" href="http://localhost/play-3997- _Gold_Miner.html"> Gold Miner</a></td><td class="topgamerow" align="right">158</td></tr> <tr><td class="topgamerowalt"><a linkindex="15" href="http://localhost/play-3637- Superbike__GP.html">Superbike GP</a></td><td class="topgamerowalt" align="right">100</td></tr> <tr><td class="topgamerow"><a linkindex="16" href="http://localhost/play-3993- _Dragonball_Z_Pong.html"> Dragonball Z Pong</a></td><td class="topgamerow" align="right">72</td></tr> <tr><td class="topgamerowalt"><a linkindex="17" href="http://localhost/play-3998- _12_Puzzle.html"> 12 Puzzle</a></td><td class="topgamerowalt" align="right">71</td></tr> <tr><td class="topgamerow"><a linkindex="18" href="http://localhost/play-14- _A.L.I.A.S._3.html"> A.L.I.A.S. 3</a></td><td class="topgamerow" align="right">62</td></tr> <tr><td class="topgamerowalt"><a linkindex="19" href="http://localhost/play-3999- _12_Holes_of_X-Mas.html"> 12 Holes of X-Mas</a></td><td class="topgamerowalt" align="right">57</td></tr> <tr><td class="topgamerow"><a linkindex="20" href="http://localhost/play-375- _Life_Buoys.html"> Life Buoys</a></td><td class="topgamerow" align="right">57</td></tr> <tr><td class="topgamerowalt"><a linkindex="21" href="http://localhost/play-814- _Pretty_Girl.html"> Pretty Girl</a></td><td class="topgamerowalt" align="right">54</td></tr> <tr><td class="topgamerow"><a linkindex="22" href="http://localhost/play-1504- __Office_Paintball.html"> Office Paintball</a></td><td class="topgamerow" align="right">54</td></tr> <tr><td class="topgamerowalt"><a linkindex="23" href="http://localhost/play-3982- _Shoot_the_Turkeys.html"> Shoot the Turkeys</a></td><td class="topgamerowalt" align="right">50</td></tr> <tr><td class="topgamerow"><a linkindex="24" href="http://localhost/play-3509- _Sexy__Slots.html"> Sexy Slots</a></td><td class="topgamerow" align="right">47</td></tr> <tr><td class="topgamerowalt"><a linkindex="25" href="http://localhost/play-3930- _Contra.html"> Contra</a></td><td class="topgamerowalt" align="right">43</td></tr> <tr><td class="topgamerow"><a linkindex="26" href="http://localhost/play-3508- _G__Ball.html"> G Ball</a></td><td class="topgamerow" align="right">42</td></tr> <tr><td class="topgamerowalt"><a linkindex="27" href="http://localhost/play-323- _Hovercraft.html"> Hovercraft</a></td><td class="topgamerowalt" align="right">41</td></tr> <tr><td class="topgamerow"><a linkindex="28" href="http://localhost/play-3914-_Halo.html"> Halo</a></td><td class="topgamerow" align="right">41</td></tr> <tr><td class="topgamerowalt"><a linkindex="29" href="http://localhost/play-3901- _Mario_Star_Catcher_2.html"> Mario Star Catcher 2</a></td><td class="topgamerowalt" align="right">39</td></tr> <tr><td class="topgamerow"><a linkindex="30" href="http://localhost/play-504- _______Red_Beard.html"> Red Beard</a></td><td class="topgamerow" align="right">37</td></tr> <tr><td class="topgamerowalt"><a linkindex="31" href="http://localhost/play-610- _5_Miles_to_Go.html"> 5 Miles to Go</a></td><td class="topgamerowalt" align="right">37</td></tr> <tr><td class="topgamerow"><a linkindex="32" href="http://localhost/play-1445- _Flash_Pong.html"> Flash Pong</a></td><td class="topgamerow" align="right">36</td></tr> <tr><td class="topgamerowalt"><a linkindex="33" href="http://localhost/play-4033- GameTeam_Drop_Blocks.html">GameTeam Drop Blocks</a></td><td class="topgamerowalt" align="right">36</td></tr> <tr><td class="topgamerow"><a linkindex="34" href="http://localhost/play-2367- ___World_Cup_Soccer_Tournament.html"> World Cup Soccer Tournament</a></td><td class="topgamerow" align="right">35</td></tr> <tr><td class="topgamerowalt"><a linkindex="35" href="http://localhost/play-333- _Insect_Hunter_2_:__Frozen.html"> Insect Hunter 2 : Frozen</a></td><td class="topgamerowalt" align="right">33</td></tr> <tr><td class="topgamerow"><a linkindex="36" href="http://localhost/play-2617- ___Pet_Puzzle.html"> Pet Puzzle</a></td><td class="topgamerow" align="right">32</td></tr> <tr><td class="topgamerowalt"><a linkindex="37" href="http://localhost/play-1524- Street_Cred.html">Street Cred</a></td><td class="topgamerowalt" align="right">31</td></tr> <tr><td class="topgamerow"><a linkindex="38" href="http://localhost/play-2800- Booby__Blast.html">Booby Blast</a></td><td class="topgamerow" align="right">30</td></tr> <tr><td class="topgamerowalt"><a linkindex="39" href="http://localhost/play-3884- _Kerry_Bush_Bash.html"> Kerry Bush Bash</a></td><td class="topgamerowalt" align="right">30</td></tr> <tr><td class="topgamerow"><a linkindex="40" href="http://localhost/play-4006- _3D_Worm.html"> 3D Worm</a></td><td class="topgamerow" align="right">27</td></tr> <tr><td class="topgamerowalt"><a linkindex="41" href="http://localhost/play-286- _Ghetto_Chase.html"> Ghetto Chase</a></td><td class="topgamerowalt" align="right">27</td></tr> <tr><td class="topgamerow"><a linkindex="42" href="http://localhost/play-327- _Hybrid_Fighter.html"> Hybrid Fighter</a></td><td class="topgamerow" align="right">27</td></tr> <tr><td class="topgamerowalt"><a linkindex="43" href="http://localhost/play-2296- ____AnimeChickGame.html"> AnimeChickGame</a></td><td class="topgamerowalt" align="right">27</td></tr> <tr><td class="topgamerow"><a linkindex="44" href="http://localhost/play-4000- _12_Many.html"> 12 Many</a></td><td class="topgamerow" align="right">26</td></tr> <tr><td class="topgamerowalt"><a linkindex="45" href="http://localhost/play-4009- _Crazy_Police_Dogs.html"> Crazy Police Dogs</a></td><td class="topgamerowalt" align="right">26</td></tr> <tr><td class="topgamerow"><a linkindex="46" href="http://localhost/play-1432-_Aspen.html"> Aspen</a></td><td class="topgamerow" align="right">24</td></tr> <tr><td class="topgamerowalt"><a linkindex="47" href="http://localhost/play-3128- _Bomb__Defusal.html"> Bomb Defusal</a></td><td class="topgamerowalt" align="right">23</td></tr> </tbody></table> <a linkindex="48" class="link" href="http://localhost/page-top100">Top 100 >>></a> </div></div><div class="boxs greenbox"><div class="boxs_head greenbox"><h2>Top Rated</h2></div><div class="boxs_body greenbox"><p></p><table class="topgamescashe" cellspacing="1"> <tbody><tr><td class="topgamerowalt"><span class="toprate">5.0</span></td><td class="topgamerowalt"><a linkindex="49" href="http://localhost/play-3637- Superbike__GP.html">Superbike GP</a></td></tr><tr><td class="topgamerow"><span class="toprate">5.0</span></td><td class="topgamerow"><a linkindex="50" href="http://localhost/play-3998-_12_Puzzle.html"> 12 Puzzle</a></td></tr> </tbody></table> </div></div><div class="boxs bluebox"><div class="boxs_head bluebox"><h2>Statistics</h2></div><div class="boxs_body bluebox"><p></p><table class="topgamescashe" cellspacing="0"> <tbody><tr> <td class="topgamerow"><b>Total Members</b></td><td class="topgamerow"><?php echo "".$database->getNumMembers()."" ?></td></tr> <tr><td class="topgamerowalt"><b>Users Online</b></td><td class="topgamerowalt"><?php echo "$database->num_active_users"; ?></td></tr> <tr> <td class="topgamerow"><b>Guests Online</b></td><td class="topgamerow"><?php echo "$database->num_active_guests"; ?></td></tr> </tbody></table> </div></div><div class="boxs greenbox"><div class="boxs_head greenbox"><h2>Affiliate Sites</h2></div><div class="boxs_body greenbox"><p></p><table class="topgamescashe" cellspacing="1"> </table> <?php include("../links.txt"); ?> </div></div></td><td class="centercol"><div class="cntttl"> <div class="cntbox"> <div class="cntbox_head"><div> <h1>Welcome to HCB Games</h1> </div></div> <div class="cntbox_cnt"> <p><?php include("../mainintro.txt"); ?></p> </div> <div class="cntbox_foot"><div><div></div></div></div> </div> </div> </td> <td class="sidecol" width="1"><div class="boxs bluebox"><div class="boxs_head bluebox"><h2>Latest Games</h2></div><div class="boxs_body bluebox"><p></p><table class="topgamescashe" cellspacing="1"> <tbody><tr><td class="topgamerowalt"><a linkindex="162" href="http://localhost/play-4026- Captain_Jack_Adventure.html">Captain Jack Adventure</a></td><td class="topgamerowalt" align="right">5</td></tr> <tr><td class="topgamerow"><a linkindex="163" href="http://localhost/play-4025- HolyWar:_Invasion.html">HolyWar: Invasion</a></td><td class="topgamerow" align="right">3</td></tr> <tr><td class="topgamerowalt"><a linkindex="164" href="http://localhost/play-4024- Sky_Fire.html">Sky Fire</a></td><td class="topgamerowalt" align="right">7</td></tr> <tr><td class="topgamerow"><a linkindex="165" href="http://localhost/play-4023- Naval_Strike.html">Naval Strike</a></td><td class="topgamerow" align="right">3</td></tr> <tr><td class="topgamerowalt"><a linkindex="166" href="http://localhost/play-4022- Onslaught.html">Onslaught</a></td><td class="topgamerowalt" align="right">3</td></tr> <tr><td class="topgamerow"><a linkindex="167" href="http://localhost/play-4021- KGB_Hunter.html">KGB Hunter</a></td><td class="topgamerow" align="right">5</td></tr> <tr><td class="topgamerowalt"><a linkindex="168" href="http://localhost/play-4020- Naval_Fighter.html">Naval Fighter</a></td><td class="topgamerowalt" align="right">10</td></tr> <tr><td class="topgamerow"><a linkindex="169" href="http://localhost/play-4019- Mad_Truckers.html">Mad Truckers</a></td><td class="topgamerow" align="right">9</td></tr> <tr><td class="topgamerowalt"><a linkindex="170" href="http://localhost/play-4018- Crusader_Tank.html">Crusader Tank</a></td><td class="topgamerowalt" align="right">8</td></tr> <tr><td class="topgamerow"><a linkindex="171" href="http://localhost/play-4016- _Swimming_With_No_Arms.html"> Swimming With No Arms</a></td><td class="topgamerow" align="right">0</td></tr> <tr><td class="topgamerowalt"><a linkindex="172" href="http://localhost/play-4015- _Hot_Chick_With_a_Gun.html"> Hot Chick With a Gun</a></td><td class="topgamerowalt" align="right">0</td></tr> <tr><td class="topgamerow"><a linkindex="173" href="http://localhost/play-4010- _Juggling_During_Dance_Dance_Revolution.html"> Juggling During Dance Da</a></td><td class="topgamerow" align="right">13</td></tr> <tr><td class="topgamerowalt"><a linkindex="174" href="http://localhost/play-4009- _Crazy_Police_Dogs.html"> Crazy Police Dogs</a></td><td class="topgamerowalt" align="right">26</td></tr> <tr><td class="topgamerow"><a linkindex="175" href="http://localhost/play-4008- _Corey_Martinez_BMX.html"> Corey Martinez BMX</a></td><td class="topgamerow" align="right">18</td></tr> <tr><td class="topgamerowalt"><a linkindex="176" href="http://localhost/play-4007- _Agassi_vs_Federer_at_the_Burj_al_Arab_Hotel.html"> Agassi vs Federer at the</a></td><td class="topgamerowalt" align="right">5</td></tr> <tr><td class="topgamerow"><a linkindex="177" href="http://localhost/play-4006- _3D_Worm.html"> 3D Worm</a></td><td class="topgamerow" align="right">27</td></tr> <tr><td class="topgamerowalt"><a linkindex="178" href="http://localhost/play-4005- _3D_Space_Skimmer.html"> 3D Space Skimmer</a></td><td class="topgamerowalt" align="right">10</td></tr> <tr><td class="topgamerow"><a linkindex="179" href="http://localhost/play-4004- _3D_MAZE.html"> 3D MAZE</a></td><td class="topgamerow" align="right">14</td></tr> <tr><td class="topgamerowalt"><a linkindex="180" href="http://localhost/play-4003- 3_Foot__Ninja_II.html">3 Foot Ninja II</a></td><td class="topgamerowalt" align="right">12</td></tr> <tr><td class="topgamerow"><a linkindex="181" href="http://localhost/play-4002- _3__Foot_Ninja.html"> 3 Foot Ninja</a></td><td class="topgamerow" align="right">15</td></tr> </tbody></table> <a linkindex="182" class="link" href="http://localhost/page-last100">Last 100 >>></a> </div></div> </td> </tr> </tbody></table> <div class="wideboxs adsbox"><div class="boxs_head adsbox"><span></span></div><div class="boxs_body adsbox"><p align="center"> </p> </div></div></div> <br> </div> </div> <div id="footer"> <div class="footera"> <div class="footerc"> <p>All Games Copyright © To Their Respective Owners. All Rights Reserved.</p> </div> </div> </div> </div><!-- end WRAPPER --> <br> <div style="position: absolute; width: 28px; height: 28px; z-index: 1000; display: none;"></div><img style="position: absolute; width: 35px; height: 29px; z-index: 1000; display: none;" src="chrome://piclens/content/launch.png"></body> </html> can u please check, thanks mate
  2. um heres the session.php page, can someone please look over it to see what is wrong with it? <?/** * Session.php * * The Session class is meant to simplify the task of keeping * track of logged in users and also guests. * * Written by: Jpmaster77 a.k.a. The Grandmaster of C++ (GMC) * Last Updated: August 19, 2004 */ include("database.php"); include("mailer.php"); include("form.php"); class Session { var $username; //Username given on sign-up var $userid; //Random value generated on current login var $userlevel; //The level to which the user pertains var $time; //Time user was last active (page loaded) var $logged_in; //True if user is logged in, false otherwise var $userinfo = array(); //The array holding all user info var $url; //The page url current being viewed var $referrer; //Last recorded site page viewed /** * Note: referrer should really only be considered the actual * page referrer in process.php, any other time it may be * inaccurate. */ /* Class constructor */ function Session(){ $this->time = time(); $this->startSession(); } /** * startSession - Performs all the actions necessary to * initialize this session object. Tries to determine if the * the user has logged in already, and sets the variables * accordingly. Also takes advantage of this page load to * update the active visitors tables. */ function startSession(){ global $database; //The database connection session_start(); //Tell PHP to start the session /* Determine if user is logged in */ $this->logged_in = $this->checkLogin(); /** * Set guest value to users not logged in, and update * active guests table accordingly. */ if(!$this->logged_in){ $this->username = $_SESSION['username'] = GUEST_NAME; $this->userlevel = GUEST_LEVEL; $database->addActiveGuest($_SERVER['REMOTE_ADDR'], $this->time); } /* Update users last active timestamp */ else{ $database->addActiveUser($this->username, $this->time); } /* Remove inactive visitors from database */ $database->removeInactiveUsers(); $database->removeInactiveGuests(); /* Set referrer page */ if(isset($_SESSION['url'])){ $this->referrer = $_SESSION['url']; }else{ $this->referrer = "/"; } /* Set current url */ $this->url = $_SESSION['url'] = $_SERVER['PHP_SELF']; } /** * checkLogin - Checks if the user has already previously * logged in, and a session with the user has already been * established. Also checks to see if user has been remembered. * If so, the database is queried to make sure of the user's * authenticity. Returns true if the user has logged in. */ function checkLogin(){ global $database; //The database connection /* Check if user has been remembered */ if(isset($_COOKIE['cookname']) && isset($_COOKIE['cookid'])){ $this->username = $_SESSION['username'] = $_COOKIE['cookname']; $this->userid = $_SESSION['userid'] = $_COOKIE['cookid']; } /* Username and userid have been set and not guest */ if(isset($_SESSION['username']) && isset($_SESSION['userid']) && $_SESSION['username'] != GUEST_NAME){ /* Confirm that username and userid are valid */ if($database->confirmUserID($_SESSION['username'], $_SESSION['userid']) != 0){ /* Variables are incorrect, user not logged in */ unset($_SESSION['username']); unset($_SESSION['userid']); return false; } /* User is logged in, set class variables */ $this->userinfo = $database->getUserInfo($_SESSION['username']); $this->username = $this->userinfo['username']; $this->userid = $this->userinfo['userid']; $this->userlevel = $this->userinfo['userlevel']; return true; } /* User not logged in */ else{ return false; } } /** * login - The user has submitted his username and password * through the login form, this function checks the authenticity * of that information in the database and creates the session. * Effectively logging in the user if all goes well. */ function login($subuser, $subpass, $subremember){ global $database, $form; //The database and form object /* Username error checking */ $field = "user"; //Use field name for username if(!$subuser || strlen($subuser = trim($subuser)) == 0){ $form->setError($field, "* Username not entered"); } else{ /* Check if username is not alphanumeric */ if(!eregi("^([0-9a-z])*$", $subuser)){ $form->setError($field, "* Username not alphanumeric"); } } /* Password error checking */ $field = "pass"; //Use field name for password if(!$subpass){ $form->setError($field, "* Password not entered"); } /* Return if form errors exist */ if($form->num_errors > 0){ return false; } /* Checks that username is in database and password is correct */ $subuser = stripslashes($subuser); $result = $database->confirmUserPass($subuser, md5($subpass)); /* Check error codes */ if($result == 1){ $field = "user"; $form->setError($field, "* Username not found"); } else if($result == 2){ $field = "pass"; $form->setError($field, "* Invalid password"); } /* Return if form errors exist */ if($form->num_errors > 0){ return false; } /* Username and password correct, register session variables */ $this->userinfo = $database->getUserInfo($subuser); $this->username = $_SESSION['username'] = $this->userinfo['username']; $this->userid = $_SESSION['userid'] = $this->generateRandID(); $this->userlevel = $this->userinfo['userlevel']; /* Insert userid into database and update active users table */ $database->updateUserField($this->username, "userid", $this->userid); $database->addActiveUser($this->username, $this->time); $database->removeActiveGuest($_SERVER['REMOTE_ADDR']); /** * This is the cool part: the user has requested that we remember that * he's logged in, so we set two cookies. One to hold his username, * and one to hold his random value userid. It expires by the time * specified in constants.php. Now, next time he comes to our site, we will * log him in automatically, but only if he didn't log out before he left. */ if($subremember){ setcookie("cookname", $this->username, time()+COOKIE_EXPIRE, COOKIE_PATH); setcookie("cookid", $this->userid, time()+COOKIE_EXPIRE, COOKIE_PATH); } /* Login completed successfully */ return true; } /** * logout - Gets called when the user wants to be logged out of the * website. It deletes any cookies that were stored on the users * computer as a result of him wanting to be remembered, and also * unsets session variables and demotes his user level to guest. */ function logout(){ global $database; //The database connection /** * Delete cookies - the time must be in the past, * so just negate what you added when creating the * cookie. */ if(isset($_COOKIE['cookname']) && isset($_COOKIE['cookid'])){ setcookie("cookname", "", time()-COOKIE_EXPIRE, COOKIE_PATH); setcookie("cookid", "", time()-COOKIE_EXPIRE, COOKIE_PATH); } /* Unset PHP session variables */ unset($_SESSION['username']); unset($_SESSION['userid']); /* Reflect fact that user has logged out */ $this->logged_in = false; /** * Remove from active users table and add to * active guests tables. */ $database->removeActiveUser($this->username); $database->addActiveGuest($_SERVER['REMOTE_ADDR'], $this->time); /* Set user level to guest */ $this->username = GUEST_NAME; $this->userlevel = GUEST_LEVEL; } /** * register - Gets called when the user has just submitted the * registration form. Determines if there were any errors with * the entry fields, if so, it records the errors and returns * 1. If no errors were found, it registers the new user and * returns 0. Returns 2 if registration failed. */ function register($subuser, $subpass, $subemail){ global $database, $form, $mailer; //The database, form and mailer object /* Username error checking */ $field = "user"; //Use field name for username if(!$subuser || strlen($subuser = trim($subuser)) == 0){ $form->setError($field, "* Username not entered"); } else{ /* Spruce up username, check length */ $subuser = stripslashes($subuser); if(strlen($subuser) < 5){ $form->setError($field, "* Username below 5 characters"); } else if(strlen($subuser) > 30){ $form->setError($field, "* Username above 30 characters"); } /* Check if username is not alphanumeric */ else if(!eregi("^([0-9a-z])+$", $subuser)){ $form->setError($field, "* Username not alphanumeric"); } /* Check if username is reserved */ else if(strcasecmp($subuser, GUEST_NAME) == 0){ $form->setError($field, "* Username reserved word"); } /* Check if username is already in use */ else if($database->usernameTaken($subuser)){ $form->setError($field, "* Username already in use"); } /* Check if username is banned */ else if($database->usernameBanned($subuser)){ $form->setError($field, "* Username banned"); } } /* Password error checking */ $field = "pass"; //Use field name for password if(!$subpass){ $form->setError($field, "* Password not entered"); } else{ /* Spruce up password and check length*/ $subpass = stripslashes($subpass); if(strlen($subpass) < 4){ $form->setError($field, "* Password too short"); } /* Check if password is not alphanumeric */ else if(!eregi("^([0-9a-z])+$", ($subpass = trim($subpass)))){ $form->setError($field, "* Password not alphanumeric"); } /** * Note: I trimmed the password only after I checked the length * because if you fill the password field up with spaces * it looks like a lot more characters than 4, so it looks * kind of stupid to report "password too short". */ } /* Email error checking */ $field = "email"; //Use field name for email if(!$subemail || strlen($subemail = trim($subemail)) == 0){ $form->setError($field, "* Email not entered"); } else{ /* Check if valid email address */ $regex = "^[_+a-z0-9-]+(\.[_+a-z0-9-]+)*" ."@[a-z0-9-]+(\.[a-z0-9-]{1,})*" ."\.([a-z]{2,}){1}$"; if(!eregi($regex,$subemail)){ $form->setError($field, "* Email invalid"); } $subemail = stripslashes($subemail); } /* Errors exist, have user correct them */ if($form->num_errors > 0){ return 1; //Errors with form } /* No errors, add the new account to the */ else{ if($database->addNewUser($subuser, md5($subpass), $subemail)){ if(EMAIL_WELCOME){ $mailer->sendWelcome($subuser,$subemail,$subpass); } return 0; //New user added succesfully }else{ return 2; //Registration attempt failed } } } /** * editAccount - Attempts to edit the user's account information * including the password, which it first makes sure is correct * if entered, if so and the new password is in the right * format, the change is made. All other fields are changed * automatically. */ function editAccount($subcurpass, $subnewpass, $subemail){ global $database, $form; //The database and form object /* New password entered */ if($subnewpass){ /* Current Password error checking */ $field = "curpass"; //Use field name for current password if(!$subcurpass){ $form->setError($field, "* Current Password not entered"); } else{ /* Check if password too short or is not alphanumeric */ $subcurpass = stripslashes($subcurpass); if(strlen($subcurpass) < 4 || !eregi("^([0-9a-z])+$", ($subcurpass = trim($subcurpass)))){ $form->setError($field, "* Current Password incorrect"); } /* Password entered is incorrect */ if($database->confirmUserPass($this->username,md5($subcurpass)) != 0){ $form->setError($field, "* Current Password incorrect"); } } /* New Password error checking */ $field = "newpass"; //Use field name for new password /* Spruce up password and check length*/ $subpass = stripslashes($subnewpass); if(strlen($subnewpass) < 4){ $form->setError($field, "* New Password too short"); } /* Check if password is not alphanumeric */ else if(!eregi("^([0-9a-z])+$", ($subnewpass = trim($subnewpass)))){ $form->setError($field, "* New Password not alphanumeric"); } } /* Change password attempted */ else if($subcurpass){ /* New Password error reporting */ $field = "newpass"; //Use field name for new password $form->setError($field, "* New Password not entered"); } /* Email error checking */ $field = "email"; //Use field name for email if($subemail && strlen($subemail = trim($subemail)) > 0){ /* Check if valid email address */ $regex = "^[_+a-z0-9-]+(\.[_+a-z0-9-]+)*" ."@[a-z0-9-]+(\.[a-z0-9-]{1,})*" ."\.([a-z]{2,}){1}$"; if(!eregi($regex,$subemail)){ $form->setError($field, "* Email invalid"); } $subemail = stripslashes($subemail); } /* Errors exist, have user correct them */ if($form->num_errors > 0){ return false; //Errors with form } /* Update password since there were no errors */ if($subcurpass && $subnewpass){ $database->updateUserField($this->username,"password",md5($subnewpass)); } /* Change Email */ if($subemail){ $database->updateUserField($this->username,"email",$subemail); } /* Success! */ return true; } /** * isAdmin - Returns true if currently logged in user is * an administrator, false otherwise. */ function isAdmin(){ return ($this->userlevel == ADMIN_LEVEL || $this->username == ADMIN_NAME); } /** * generateRandID - Generates a string made up of randomized * letters (lower and upper case) and digits and returns * the md5 hash of it to be used as a userid. */ function generateRandID(){ return md5($this->generateRandStr(16)); } /** * generateRandStr - Generates a string made up of randomized * letters (lower and upper case) and digits, the length * is a specified parameter. */ function generateRandStr($length){ $randstr = ""; for($i=0; $i<$length; $i++){ $randnum = mt_rand(0,61); if($randnum < 10){ $randstr .= chr($randnum+48); }else if($randnum < 36){ $randstr .= chr($randnum+55); }else{ $randstr .= chr($randnum+61); } } return $randstr; } }; /** * Initialize session object - This must be initialized before * the form object because the form uses session variables, * which cannot be accessed unless the session has started. */ $session = new Session; /* Initialize form object */ $form = new Form; ?>
  3. ok ive done some more digging, what i gather is that its because there is white space in one of the files either t the start or the end, is this error saying it is in the index.php page or the session.php page? cheers
  4. sorry, <?php include("../include/session.php"); /** * User not an administrator, redirect to main page * automatically. */ if(!$session->isAdmin()){ ?> <center><font color="red"<h3><i>ERROR</i>: Access Denied</h3></font> Back to [<a href="../index.php">Main Page</a>]</center><?php } else{ ?> <center> <?php if (!isset($_POST['submit'])) { ?> <form method="post" action="<?php echo $PHP_SELF;?>"> Select a file to edit:<br /> <select name="file"> <option value="../links.txt">Site Links</option> <option value="../mainintro.txt">Main Intro</option> </select> <input type="submit" value="submit" name="submit"><br /> </form> <?php } else { $loadcontent = $_POST["file"];; $fp = @fopen($loadcontent, "r"); $loadcontent = fread($fp, filesize($loadcontent)); $loadcontent = htmlspecialchars($loadcontent); fclose($fp); ?> <form method="post" action="<?php echo $PHP_SELF;?>"> Select a file to edit:<br /> <select name="file"> <option value="../links.txt">Site Links</option> <option value="../mainintro.txt">Main Intro</option> </select> <input type="submit" value="submit" name="submit"><br /> </form> <form method=post action="<?=$_SERVER['PHP_SELF']?>"> <textarea name="savecontent" cols="70" rows="30"><?=$loadcontent?></textarea> <br> <input type="submit" name="save_file" value="Save"> </form> <?php if($save_file) { $savecontent = stripslashes($savecontent); $fp = @fopen($loadcontent, "w"); if ($fp) { fwrite($fp, $savecontent); fclose($fp); } } } ?> <?php } ?> </center> there is some extra code there simply to protect the page from someone who is not a admin using it
  5. hi guys, thanks 4 ur help, i got this solved heres the code, it has a form which is displayed if a page has not been selected, if page has been selected then it refreshes and loads the editor, thanks
  6. sorry about this, but heres the error: Warning: session_start() [function.session-start]: Cannot send session cache limiter - headers already sent (output started at C:\wamp\www\admin\index.php:1) in C:\wamp\www\include\session.php on line 46 and heres the page causing the problems, <? include("../include/session.php"); ?> <!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"> <head> <meta http-equiv="Content-Type" content="text/html; charset=UTF-8"> <title>Welcome to HCB games <?php echo date('l dS \of F Y h:i:s A'); ?></title> <meta name="keywords" content="play free games online flash games flash arcade swf cool movies cartoons"> <meta name="robots" content="index, follow"> <meta name="description" content="Play free flash games online, watch cool movies and cartoons!"> <link rel="stylesheet" type="text/css" href="../index.css" media="all"> </head> <body> <div id="wrapper" style="width: 92%;" align="center"> <div id="header"> <div class="heada"> <div class="headc"> <table border="0" cellspacing="0"> <tbody><tr> <td><a linkindex="0" href="http://localhost/" title=""><img class="logo" src="../images/logo.png" alt="Game Script" border="0" height="84" hspace="10" width="284"></a></td> <td rowspan="2" valign="top"> <div class="topmenu"> <a linkindex="1" href="http://localhost/page-memberlist" class="topmenu">Memberlist</a> | <a linkindex="2" href="http://localhost/page-about_us" class="topmenu">About Us</a> | <a linkindex="3" href="http://localhost/page-help" class="topmenu">Help</a> | <a href="mailto:" class="topmenu">Contact Us</a> | <a class="topmenu" href="mailto:?subject=Play%20Free%20Games%20at%20HCB%20Games%21">Tell a Friend</a> | <a class="topmenu" href="http://localhost/">Bookmark Us</a> </div> <div class="quickgame"> Quick Play: <select id="games" name="games" onchange="switchme()"> <option value="">--select a game--</option> </select> <img src="../images/px.gif" align="absmiddle" height="23" width="4"></div> </td> </tr> <tr class="navigator"> <td class="menu"><ul> <li><span><img src="../images/px.gif" align="absmiddle" height="23" width="40"></span></li> <li class="sel"><span>Games</span></li><li class="unsel"><a linkindex="4" href="http://localhost/index.php?mcid=2">Movies</a></li> </ul></td> </tr> </tbody></table> </div> </div> </div> <div id="submenu"> <div class="submenua"> <div class="submenuc"> <div> <a linkindex="5" href="http://localhost/cat-1-p0.html" class="submenu">Action / Adventure</a> | <a linkindex="6" href="http://localhost/cat-8-p0.html" class="submenu">Beat em up</a> | <a linkindex="7" href="http://localhost/cat-5-p0.html" class="submenu">Other</a> | <a linkindex="8" href="http://localhost/cat-3-p0.html" class="submenu">Puzzle</a> | <a linkindex="9" href="http://localhost/cat-6-p0.html" class="submenu">Racing</a> | <a linkindex="10" href="http://localhost/cat-7-p0.html" class="submenu">Retro</a> | <a linkindex="11" href="http://localhost/cat-4-p0.html" class="submenu">Shoot 'em up</a> | <a linkindex="12" href="http://localhost/cat-2-p0.html" class="submenu">Sports</a></div> </div> </div> </div> <div id="submenushadow"> <div class="sushada"> <div class="sushadc"> </div> </div> </div> <div class="wrappera"> <div class="wrapperc"> <div id="content"> <div class="wideboxs adsbox"><div class="boxs_head adsbox"><span></span></div><div class="boxs_body adsbox"><p align="center"><? /** * User not logged in, display the login form. * If user has already tried to login, but errors were * found, display the total number of errors. * If errors occurred, they will be displayed. */ if($form->num_errors > 0){ echo "<font size=\"2\" color=\"#ff0000\">".$form->num_errors." error(s) found</font>"; echo $form->error("user"); echo $form->error("pass"); } ?> </p></div></div> <table class="content" border="0" cellspacing="5"> <tbody><tr><td class="sidecol" width="1"><div class="boxs bluebox"><div class="boxs_head bluebox"><h2>Top Games</h2></div><div class="boxs_body bluebox"><p></p><table class="topgamescashe" cellspacing="1"> <tbody><tr><td class="topgamerowalt"><a linkindex="13" href="http://localhost/play-4017-_Heli_Strike.html"> Heli Strike</a></td><td class="topgamerowalt" align="right">278</td></tr> <tr><td class="topgamerow"><a linkindex="14" href="http://localhost/play-3997-_Gold_Miner.html"> Gold Miner</a></td><td class="topgamerow" align="right">158</td></tr> <tr><td class="topgamerowalt"><a linkindex="15" href="http://localhost/play-3637-Superbike__GP.html">Superbike GP</a></td><td class="topgamerowalt" align="right">100</td></tr> <tr><td class="topgamerow"><a linkindex="16" href="http://localhost/play-3993-_Dragonball_Z_Pong.html"> Dragonball Z Pong</a></td><td class="topgamerow" align="right">72</td></tr> <tr><td class="topgamerowalt"><a linkindex="17" href="http://localhost/play-3998-_12_Puzzle.html"> 12 Puzzle</a></td><td class="topgamerowalt" align="right">71</td></tr> <tr><td class="topgamerow"><a linkindex="18" href="http://localhost/play-14-_A.L.I.A.S._3.html"> A.L.I.A.S. 3</a></td><td class="topgamerow" align="right">62</td></tr> <tr><td class="topgamerowalt"><a linkindex="19" href="http://localhost/play-3999-_12_Holes_of_X-Mas.html"> 12 Holes of X-Mas</a></td><td class="topgamerowalt" align="right">57</td></tr> <tr><td class="topgamerow"><a linkindex="20" href="http://localhost/play-375-_Life_Buoys.html"> Life Buoys</a></td><td class="topgamerow" align="right">57</td></tr> <tr><td class="topgamerowalt"><a linkindex="21" href="http://localhost/play-814-_Pretty_Girl.html"> Pretty Girl</a></td><td class="topgamerowalt" align="right">54</td></tr> <tr><td class="topgamerow"><a linkindex="22" href="http://localhost/play-1504-__Office_Paintball.html"> Office Paintball</a></td><td class="topgamerow" align="right">54</td></tr> <tr><td class="topgamerowalt"><a linkindex="23" href="http://localhost/play-3982-_Shoot_the_Turkeys.html"> Shoot the Turkeys</a></td><td class="topgamerowalt" align="right">50</td></tr> <tr><td class="topgamerow"><a linkindex="24" href="http://localhost/play-3509-_Sexy__Slots.html"> Sexy Slots</a></td><td class="topgamerow" align="right">47</td></tr> <tr><td class="topgamerowalt"><a linkindex="25" href="http://localhost/play-3930-_Contra.html"> Contra</a></td><td class="topgamerowalt" align="right">43</td></tr> <tr><td class="topgamerow"><a linkindex="26" href="http://localhost/play-3508-_G__Ball.html"> G Ball</a></td><td class="topgamerow" align="right">42</td></tr> <tr><td class="topgamerowalt"><a linkindex="27" href="http://localhost/play-323-_Hovercraft.html"> Hovercraft</a></td><td class="topgamerowalt" align="right">41</td></tr> <tr><td class="topgamerow"><a linkindex="28" href="http://localhost/play-3914-_Halo.html"> Halo</a></td><td class="topgamerow" align="right">41</td></tr> <tr><td class="topgamerowalt"><a linkindex="29" href="http://localhost/play-3901-_Mario_Star_Catcher_2.html"> Mario Star Catcher 2</a></td><td class="topgamerowalt" align="right">39</td></tr> <tr><td class="topgamerow"><a linkindex="30" href="http://localhost/play-504-_______Red_Beard.html"> Red Beard</a></td><td class="topgamerow" align="right">37</td></tr> <tr><td class="topgamerowalt"><a linkindex="31" href="http://localhost/play-610-_5_Miles_to_Go.html"> 5 Miles to Go</a></td><td class="topgamerowalt" align="right">37</td></tr> <tr><td class="topgamerow"><a linkindex="32" href="http://localhost/play-1445-_Flash_Pong.html"> Flash Pong</a></td><td class="topgamerow" align="right">36</td></tr> <tr><td class="topgamerowalt"><a linkindex="33" href="http://localhost/play-4033-GameTeam_Drop_Blocks.html">GameTeam Drop Blocks</a></td><td class="topgamerowalt" align="right">36</td></tr> <tr><td class="topgamerow"><a linkindex="34" href="http://localhost/play-2367-___World_Cup_Soccer_Tournament.html"> World Cup Soccer Tournament</a></td><td class="topgamerow" align="right">35</td></tr> <tr><td class="topgamerowalt"><a linkindex="35" href="http://localhost/play-333-_Insect_Hunter_2_:__Frozen.html"> Insect Hunter 2 : Frozen</a></td><td class="topgamerowalt" align="right">33</td></tr> <tr><td class="topgamerow"><a linkindex="36" href="http://localhost/play-2617-___Pet_Puzzle.html"> Pet Puzzle</a></td><td class="topgamerow" align="right">32</td></tr> <tr><td class="topgamerowalt"><a linkindex="37" href="http://localhost/play-1524-Street_Cred.html">Street Cred</a></td><td class="topgamerowalt" align="right">31</td></tr> <tr><td class="topgamerow"><a linkindex="38" href="http://localhost/play-2800-Booby__Blast.html">Booby Blast</a></td><td class="topgamerow" align="right">30</td></tr> <tr><td class="topgamerowalt"><a linkindex="39" href="http://localhost/play-3884-_Kerry_Bush_Bash.html"> Kerry Bush Bash</a></td><td class="topgamerowalt" align="right">30</td></tr> <tr><td class="topgamerow"><a linkindex="40" href="http://localhost/play-4006-_3D_Worm.html"> 3D Worm</a></td><td class="topgamerow" align="right">27</td></tr> <tr><td class="topgamerowalt"><a linkindex="41" href="http://localhost/play-286-_Ghetto_Chase.html"> Ghetto Chase</a></td><td class="topgamerowalt" align="right">27</td></tr> <tr><td class="topgamerow"><a linkindex="42" href="http://localhost/play-327-_Hybrid_Fighter.html"> Hybrid Fighter</a></td><td class="topgamerow" align="right">27</td></tr> <tr><td class="topgamerowalt"><a linkindex="43" href="http://localhost/play-2296-____AnimeChickGame.html"> AnimeChickGame</a></td><td class="topgamerowalt" align="right">27</td></tr> <tr><td class="topgamerow"><a linkindex="44" href="http://localhost/play-4000-_12_Many.html"> 12 Many</a></td><td class="topgamerow" align="right">26</td></tr> <tr><td class="topgamerowalt"><a linkindex="45" href="http://localhost/play-4009-_Crazy_Police_Dogs.html"> Crazy Police Dogs</a></td><td class="topgamerowalt" align="right">26</td></tr> <tr><td class="topgamerow"><a linkindex="46" href="http://localhost/play-1432-_Aspen.html"> Aspen</a></td><td class="topgamerow" align="right">24</td></tr> <tr><td class="topgamerowalt"><a linkindex="47" href="http://localhost/play-3128-_Bomb__Defusal.html"> Bomb Defusal</a></td><td class="topgamerowalt" align="right">23</td></tr> </tbody></table> <a linkindex="48" class="link" href="http://localhost/page-top100">Top 100 >>></a> </div></div><div class="boxs greenbox"><div class="boxs_head greenbox"><h2>Top Rated</h2></div><div class="boxs_body greenbox"><p></p><table class="topgamescashe" cellspacing="1"> <tbody><tr><td class="topgamerowalt"><span class="toprate">5.0</span></td><td class="topgamerowalt"><a linkindex="49" href="http://localhost/play-3637-Superbike__GP.html">Superbike GP</a></td></tr><tr><td class="topgamerow"><span class="toprate">5.0</span></td><td class="topgamerow"><a linkindex="50" href="http://localhost/play-3998-_12_Puzzle.html"> 12 Puzzle</a></td></tr> </tbody></table> </div></div><div class="boxs bluebox"><div class="boxs_head bluebox"><h2>Statistics</h2></div><div class="boxs_body bluebox"><p></p><table class="topgamescashe" cellspacing="0"> <tbody><tr> <td class="topgamerow"><b>Total Members</b></td><td class="topgamerow"><?php echo "".$database->getNumMembers()."" ?></td></tr> <tr><td class="topgamerowalt"><b>Users Online</b></td><td class="topgamerowalt"><?php echo "$database->num_active_users"; ?></td></tr> <tr> <td class="topgamerow"><b>Guests Online</b></td><td class="topgamerow"><?php echo "$database->num_active_guests"; ?></td></tr> </tbody></table> </div></div><div class="boxs greenbox"><div class="boxs_head greenbox"><h2>Affiliate Sites</h2></div><div class="boxs_body greenbox"><p></p><table class="topgamescashe" cellspacing="1"> </table> <a linkindex="51" class="link" href="http://localhost/index.php?page=link_trade">Add Link >>></a> </div></div></td><td class="centercol"><div class="cntttl"> <div class="cntbox"> <div class="cntbox_head"><div> <h1>HCB Games Admin Center</h1> </div></div> <div class="cntbox_cnt"> <p><?php /** * displayUsers - Displays the users database table in * a nicely formatted html table. */ function displayUsers(){ global $database; $q = "SELECT username,userlevel,email,timestamp " ."FROM ".TBL_USERS." ORDER BY userlevel DESC,username"; $result = $database->query($q); /* Error occurred, return given name by default */ $num_rows = mysql_numrows($result); if(!$result || ($num_rows < 0)){ echo "Error displaying info"; return; } if($num_rows == 0){ echo "Database table empty"; return; } /* Display table contents */ echo "<table align=\"left\" border=\"1\" cellspacing=\"0\" cellpadding=\"3\">\n"; echo "<tr><td><b>Username</b></td><td><b>Level</b></td><td><b>Email</b></td><td><b>Last Active</b></td></tr>\n"; for($i=0; $i<$num_rows; $i++){ $uname = mysql_result($result,$i,"username"); $ulevel = mysql_result($result,$i,"userlevel"); $email = mysql_result($result,$i,"email"); $time = mysql_result($result,$i,"timestamp"); $readable_time = date("d-m-Y \a\\t\ h:i a", $time); echo "<tr><td>$uname</td><td>$ulevel</td><td>$email</td><td>$readable_time</td></tr>\n"; } echo "</table><br>\n"; } /** * displayBannedUsers - Displays the banned users * database table in a nicely formatted html table. */ function displayBannedUsers(){ global $database; $q = "SELECT username,timestamp " ."FROM ".TBL_BANNED_USERS." ORDER BY username"; $result = $database->query($q); /* Error occurred, return given name by default */ $num_rows = mysql_numrows($result); if(!$result || ($num_rows < 0)){ echo "Error displaying info"; return; } if($num_rows == 0){ echo "Database table empty"; return; } /* Display table contents */ echo "<table align=\"left\" border=\"1\" cellspacing=\"0\" cellpadding=\"3\">\n"; echo "<tr><td><b>Username</b></td><td><b>Time Banned</b></td></tr>\n"; for($i=0; $i<$num_rows; $i++){ $uname = mysql_result($result,$i,"username"); $time = mysql_result($result,$i,"timestamp"); echo "<tr><td>$uname</td><td>$time</td></tr>\n"; } echo "</table><br>\n"; } /** * User not an administrator, redirect to main page * automatically. */ if(!$session->isAdmin()){ header("Location: ../index.php"); } else{ /** * Administrator is viewing page, so display all * forms. */ ?> <html> <title>Jpmaster77's Login Script</title> <body> <h1>Admin Center</h1> <p><font size="5" color="#ff0000"> <b>::::::::::::::::::::::::::::::::::::::::::::</b></font> <font size="4">Logged in as <b><? echo $session->username; ?></b></font><br> <br> Back to [<a href="../index.php">Main Page</a>]<br> <br> <? if($form->num_errors > 0){ echo "<font size=\"4\" color=\"#ff0000\">" ."!*** Error with request, please fix</font><br><br>"; } ?> </p> <table align="left" border="0" cellspacing="5" cellpadding="5"> <tr><td> <? /** * Display Users Table */ ?> <h3>Users Table Contents:</h3> <? displayUsers(); ?> </td></tr> <tr> <td> <br> <? /** * Update User Level */ ?> <h3>Update User Level</h3> <? echo $form->error("upduser"); ?> <table> <form action="adminprocess.php" method="POST"> <tr><td> Username:<br> <input type="text" name="upduser" maxlength="30" value="<? echo $form->value("upduser"); ?>"> </td> <td> Level:<br> <select name="updlevel"> <option value="1">1 <option value="9">9 </select> </td> <td> <br> <input type="hidden" name="subupdlevel" value="1"> <input type="submit" value="Update Level"> </td></tr> </form> </table> </td> </tr> <tr> <td><hr></td> </tr> <tr> <td> <? /** * Delete User */ ?> <h3>Delete User</h3> <? echo $form->error("deluser"); ?> <form action="adminprocess.php" method="POST"> Username:<br> <input type="text" name="deluser" maxlength="30" value="<? echo $form->value("deluser"); ?>"> <input type="hidden" name="subdeluser" value="1"> <input type="submit" value="Delete User"> </form> </td> </tr> <tr> <td><hr></td> </tr> <tr> <td> <? /** * Delete Inactive Users */ ?> <h3>Delete Inactive Users</h3> This will delete all users (not administrators), who have not logged in to the site<br> within a certain time period. You specify the days spent inactive.<br><br> <table> <form action="adminprocess.php" method="POST"> <tr><td> Days:<br> <select name="inactdays"> <option value="3">3 <option value="7">7 <option value="14">14 <option value="30">30 <option value="100">100 <option value="365">365 </select> </td> <td> <br> <input type="hidden" name="subdelinact" value="1"> <input type="submit" value="Delete All Inactive"> </td> </form> </table> </td> </tr> <tr> <td><hr></td> </tr> <tr> <td> <? /** * Ban User */ ?> <h3>Ban User</h3> <? echo $form->error("banuser"); ?> <form action="adminprocess.php" method="POST"> Username:<br> <input type="text" name="banuser" maxlength="30" value="<? echo $form->value("banuser"); ?>"> <input type="hidden" name="subbanuser" value="1"> <input type="submit" value="Ban User"> </form> </td> </tr> <tr> <td><hr></td> </tr> <tr><td> <? /** * Display Banned Users Table */ ?> <h3>Banned Users Table Contents:</h3> <? displayBannedUsers(); ?> </td></tr> <tr> <td><hr></td> </tr> <tr> <td> <? /** * Delete Banned User */ ?> <h3>Delete Banned User</h3> <? echo $form->error("delbanuser"); ?> <form action="adminprocess.php" method="POST"> Username:<br> <input type="text" name="delbanuser" maxlength="30" value="<? echo $form->value("delbanuser"); ?>"> <input type="hidden" name="subdelbanned" value="1"> <input type="submit" value="Delete Banned User"> </form> </td> </tr> </table> <p> </p> <p> </p> <p> </p> <p> </p> <p> </p> <p> </p> <p> </p> <p> </p> <p> </p> <p> </p> <p> </p> <p> </p> <p> </p> <p> </p> <p> </p> <p> </p> <p> </p> <p> </p> <p> </p> <p> </p> <p> </p> <p> </p> <p> </p> <p> </p> </div> <div class="cntbox_foot"><div><div></div></div></div> </div> </div> </td> <td class="sidecol" width="1"><div class="boxs greenbox"><div class="boxs_head greenbox"><h2>Search</h2></div><div class="boxs_body greenbox"><p></p><? include("../searchbar.php"); ?> </div></div><div class="boxs bluebox"><div class="boxs_head bluebox"><h2>Latest Games</h2></div><div class="boxs_body bluebox"><p></p><table class="topgamescashe" cellspacing="1"> <tbody><tr><td class="topgamerowalt"><a linkindex="162" href="http://localhost/play-4026-Captain_Jack_Adventure.html">Captain Jack Adventure</a></td><td class="topgamerowalt" align="right">5</td></tr> <tr><td class="topgamerow"><a linkindex="163" href="http://localhost/play-4025-HolyWar:_Invasion.html">HolyWar: Invasion</a></td><td class="topgamerow" align="right">3</td></tr> <tr><td class="topgamerowalt"><a linkindex="164" href="http://localhost/play-4024-Sky_Fire.html">Sky Fire</a></td><td class="topgamerowalt" align="right">7</td></tr> <tr><td class="topgamerow"><a linkindex="165" href="http://localhost/play-4023-Naval_Strike.html">Naval Strike</a></td><td class="topgamerow" align="right">3</td></tr> <tr><td class="topgamerowalt"><a linkindex="166" href="http://localhost/play-4022-Onslaught.html">Onslaught</a></td><td class="topgamerowalt" align="right">3</td></tr> <tr><td class="topgamerow"><a linkindex="167" href="http://localhost/play-4021-KGB_Hunter.html">KGB Hunter</a></td><td class="topgamerow" align="right">5</td></tr> <tr><td class="topgamerowalt"><a linkindex="168" href="http://localhost/play-4020-Naval_Fighter.html">Naval Fighter</a></td><td class="topgamerowalt" align="right">10</td></tr> <tr><td class="topgamerow"><a linkindex="169" href="http://localhost/play-4019-Mad_Truckers.html">Mad Truckers</a></td><td class="topgamerow" align="right">9</td></tr> <tr><td class="topgamerowalt"><a linkindex="170" href="http://localhost/play-4018-Crusader_Tank.html">Crusader Tank</a></td><td class="topgamerowalt" align="right">8</td></tr> <tr><td class="topgamerow"><a linkindex="171" href="http://localhost/play-4016-_Swimming_With_No_Arms.html"> Swimming With No Arms</a></td><td class="topgamerow" align="right">0</td></tr> <tr><td class="topgamerowalt"><a linkindex="172" href="http://localhost/play-4015-_Hot_Chick_With_a_Gun.html"> Hot Chick With a Gun</a></td><td class="topgamerowalt" align="right">0</td></tr> <tr><td class="topgamerow"><a linkindex="173" href="http://localhost/play-4010-_Juggling_During_Dance_Dance_Revolution.html"> Juggling During Dance Da</a></td><td class="topgamerow" align="right">13</td></tr> <tr><td class="topgamerowalt"><a linkindex="174" href="http://localhost/play-4009-_Crazy_Police_Dogs.html"> Crazy Police Dogs</a></td><td class="topgamerowalt" align="right">26</td></tr> <tr><td class="topgamerow"><a linkindex="175" href="http://localhost/play-4008-_Corey_Martinez_BMX.html"> Corey Martinez BMX</a></td><td class="topgamerow" align="right">18</td></tr> <tr><td class="topgamerowalt"><a linkindex="176" href="http://localhost/play-4007-_Agassi_vs_Federer_at_the_Burj_al_Arab_Hotel.html"> Agassi vs Federer at the</a></td><td class="topgamerowalt" align="right">5</td></tr> <tr><td class="topgamerow"><a linkindex="177" href="http://localhost/play-4006-_3D_Worm.html"> 3D Worm</a></td><td class="topgamerow" align="right">27</td></tr> <tr><td class="topgamerowalt"><a linkindex="178" href="http://localhost/play-4005-_3D_Space_Skimmer.html"> 3D Space Skimmer</a></td><td class="topgamerowalt" align="right">10</td></tr> <tr><td class="topgamerow"><a linkindex="179" href="http://localhost/play-4004-_3D_MAZE.html"> 3D MAZE</a></td><td class="topgamerow" align="right">14</td></tr> <tr><td class="topgamerowalt"><a linkindex="180" href="http://localhost/play-4003-3_Foot__Ninja_II.html">3 Foot Ninja II</a></td><td class="topgamerowalt" align="right">12</td></tr> <tr><td class="topgamerow"><a linkindex="181" href="http://localhost/play-4002-_3__Foot_Ninja.html"> 3 Foot Ninja</a></td><td class="topgamerow" align="right">15</td></tr> </tbody></table> <a linkindex="182" class="link" href="http://localhost/page-last100">Last 100 >>></a> </div></div> <div class="boxs whitebox"><div class="boxs_head whitebox"><span></span></div><div class="boxs_body whitebox"><p> </p></div></div></td> </tr> </tbody></table> <div class="wideboxs adsbox"><div class="boxs_head adsbox"><span></span></div><div class="boxs_body adsbox"><p align="center"> </p> </div></div></div> <br> </div> </div> <div id="footer"> <div class="footera"> <div class="footerc"> <p>All Games Copyright © To Their Respective Owners. All Rights Reserved.</p> </div> </div> </div> </div><!-- end WRAPPER --> <br> <div style="position: absolute; width: 28px; height: 28px; z-index: 1000; display: none;"></div><img style="position: absolute; width: 35px; height: 29px; z-index: 1000; display: none;" src="chrome://piclens/content/launch.png"></body> </html> <? } ?> [and yes there is good reason for all the <p> </p>] thanks, from the header errors thread what i gathered is i need my processing stuff at the top so i tried moving function displayUsers(){ global $database; $q = "SELECT username,userlevel,email,timestamp " ."FROM ".TBL_USERS." ORDER BY userlevel DESC,username"; $result = $database->query($q); /* Error occurred, return given name by default */ $num_rows = mysql_numrows($result); if(!$result || ($num_rows < 0)){ echo "Error displaying info"; return; } if($num_rows == 0){ echo "Database table empty"; return; } right up with the php include statement but that didnt work, so i have tried, please help
  7. yeah sory i should have posted what im currently using: <center><?php $loadcontent = "textfile.txt"; $fp = @fopen($loadcontent, "r"); $loadcontent = fread($fp, filesize($loadcontent)); $loadcontent = htmlspecialchars($loadcontent); fclose($fp); ?> <form method=post action="<?=$_SERVER['PHP_SELF']?>"> <textarea name="savecontent" cols="25" rows="10"><?=$loadcontent?></textarea> <br> <input type="submit" name="save_file" value="Save"> </form> <?php if($save_file) { $savecontent = stripslashes($savecontent); $fp = @fopen($loadcontent, "w"); if ($fp) { fwrite($fp, $savecontent); fclose($fp); } } ?> </center> this works im just looking for a way to have a dropdown box which contains a list of set files eg : file1.txt extra/file2.tx links.txt and then when the user selects it it writes that value to $loadcontent and refreshes the page so it loads that, i really have no idea where to start for this ( i possibly could but its 11 at night and i cant really think lol thanks for any help,
  8. hi there, im looking to grab a very simple file editor, all it has to do is open a said file (in text format) and read the contents into a text area, then i simple make the changes and click save and it saves them to that file, e.g ___________________________ |Drop down box to open set files| _____________________________________ |Text area for file to be read to | | | |____________________________________| ___________ |save button| cheers
  9. thanks guys, whats the admins username? i need to contact him about a dontation
  10. ah got it, short open tags was off, why would this cause this?
  11. hi there i have installed php using "wamp" but i have a problem, php is ignoring all code after -> i have a code like this: <? /** * Main.php */ include("include/session.php"); ?> <html> <title>Jpmaster77's Login Script</title> <body> <table> <tr><td> <? /** * User has already logged in, so display relavent links, including * a link to the admin center if the user is an administrator. */ if($session->logged_in){ echo "<h1>Logged In</h1>"; echo "Welcome <b>$session->username</b>, you are logged in. <br><br>" ."[<a href=\"userinfo.php?user=$session->username\">My Account</a>] " ."[<a href=\"useredit.php\">Edit Account</a>] "; if($session->isAdmin()){ echo "[<a href=\"admin/admin.php\">Admin Center</a>] "; } echo "[<a href=\"process.php\">Logout</a>]"; } else{ ?> <h1>Login</h1> <? /** * User not logged in, display the login form. * If user has already tried to login, but errors were * found, display the total number of errors. * If errors occurred, they will be displayed. */ if($form->num_errors > 0){ echo "<font size=\"2\" color=\"#ff0000\">".$form->num_errors." error(s) found</font>"; } ?> <form action="process.php" method="POST"> <table align="left" border="0" cellspacing="0" cellpadding="3"> <tr><td>Username:</td><td><input type="text" name="user" maxlength="30" value="<? echo $form->value("user"); ?>"></td><td><? echo $form->error("user"); ?></td></tr> <tr><td>Password:</td><td><input type="password" name="pass" maxlength="30" value="<? echo $form->value("pass"); ?>"></td><td><? echo $form->error("pass"); ?></td></tr> <tr><td colspan="2" align="left"><input type="checkbox" name="remember" <? if($form->value("remember") != ""){ echo "checked"; } ?>> <font size="2">Remember me next time <input type="hidden" name="sublogin" value="1"> <input type="submit" value="Login"></td></tr> <tr><td colspan="2" align="left"><br><font size="2">[<a href="forgotpass.php">Forgot Password?</a>]</font></td><td align="right"></td></tr> <tr><td colspan="2" align="left"><br>Not registered? <a href="register.php">Sign-Up!</a></td></tr> </table> </form> <? } /** * Just a little page footer, tells how many registered members * there are, how many users currently logged in and viewing site, * and how many guests viewing site. Active users are displayed, * with link to their user information. */ echo "</td></tr><tr><td align=\"center\"><br><br>"; echo "<b>Member Total:</b> ".$database->getNumMembers()."<br>"; echo "There are $database->num_active_users registered members and "; echo "$database->num_active_guests guests viewing the site.<br><br>"; include("include/view_active.php"); ?> </td></tr> </table> </body> </html> but when i run it i get: (see error.jpg attached) i get the exact same problem with any other scriptof its type, and idea what is causing that? there is another topic on here with the same name that had the same problem but they dont explain how they fixed it, cheers matt [attachment deleted by admin]
  12. when you install wamp it detects firefox on your computer and asks you if you wish to use this as your default browser, did you click yes to this?
  13. ok i have absolutly no idea where to start for this, basically what i need it something where the user can type in what they want, use formatting, and smileys, this includes enter, and then i need a script to convert this into html formatting, something similar to how the forum posting works i just need a base example and then i can work from there cheers matt
  14. <?php header("Location: "/home/vol2/byethost13.com/b13_1013561/mydoodle.byethost13.com/htdocs/users/".$session->username."/index.php"); ?> cheers matt quick correction, its probably the same thing with <?php header("Location: "/users/".$session->username."/index.php"); ?>
  15. just to point out they are here to help, you will notice you have had no "answers" to anything you have posted, thats because you are not clearly stating what your problems are, all you are doing is posting what you are currently doing, they asked about the questions because they wanted to try and help, they could have just said no clear questions and gone away. but they didn't they decided to try again and ask you do you actually have a question to try and get you to state them clearer, next time if you want help remember that being polite usually gets the best results, in fact i am sure that if you read in the forum rules it will state that you must respect other members. now try and be more polite and remember that they are here to help as a favor its not your right to be helped, now if you want help be polite and post your questions clearly and the members of the forum will try to help you out. also you might want to look at the link in MadTechie's sig How to ask questions the smart way http://catb.org/~esr/faqs/smart-questions.html
  16. sorry if u have already fixed it but i figure if u havnt ill point it out u have the same thing here: or is it intentional? if so please tell me why
  17. ok i got it to work now just had to play around with the quotes its: $your_data = '<?php $owner = $_SESSION["reguname"]; include("../../userindex.php"); ?>'; now my second question is it states : $owner = $_SESSION["reguname"]; now how would i go about making it so that rather than acctually writing that out, it writes out the value of $_SESSION["reguname"]? thanks
  18. thanks, but it still shows the exact same error
  19. just one question would this be causing problems? just a thought
  20. ok i am trying to declare this variable: $owner = "$_SESSION['reguname']"; but it in itself is causing problems can anyone tell me why? th error is faultCode0faultStringParse error:syntax error, unexpected T_ENCAPSED_AND_WHITESPACE, expecting T_STRING or T_VARIABLE or T_NUM_STRING in /home/vol2/byethost13.com/b13_1013561/mydoodle.byethost13.com/htdocs/register.php on line 47 it is part of the code that does this : /**make the user folder*/ mkdir ("/home/vol2/byethost13.com/b13_1013561/mydoodle.byethost13.com/htdocs/users/".$_SESSION['reguname'], 0777); echo "Folder ".$_SESSION['reguname']." created \n"; /** make the user page*/ fopen ("/home/vol2/byethost13.com/b13_1013561/mydoodle.byethost13.com/htdocs/users/".$_SESSION['reguname']."/index.php", 'w', 0777); echo "file created \n"; /** write to the file */ $your_data = "<?php $owner = "$_SESSION['reguname']"; include('../../userindex.php'); ?>"; // Open the file and erase the contents if any $fp = fopen("/home/vol2/byethost13.com/b13_1013561/mydoodle.byethost13.com/htdocs/users/".$_SESSION['reguname']."/index.php", "w"); // Write the data to the file fwrite($fp, $your_data); // Close the file fclose($fp); echo "page code wrote \n"; $_SESSION['reguname'] is assigned its value earlier on. , once this problem is solved if i need it i will ask my other question. thanks for your help
  21. ok heres whats happening i have tried 8 completly different scripts to either delete or move the directory however they all do the exact same thing... that is they all do absolutly nothing i am getting no errors what so ever but it doesnt affect the directory at all the latest script is simply moving it maybe you can help. $file = '/home/vol2/byethost13.com/b13_1013561/mydoodle.byethost13.com/htdocs/users/.$subuser'; if (is_dir("$file")) { rename ("$file", "../../delete/$file") or die ("Could not move directory");} do you see anything wrong?
  22. please people i really need help with this my code now is if ($handle = opendir('/home/vol2/byethost13.com/b13_1013561/mydoodle.byethost13.com/htdocs/users/$subuser')) { while (false !== ($file = readdir($handle))) { if ($file != "." && $file != ".." && is_file($file)) { print $file; } } closedir($handle); } rmdir("/home/vol2/byethost13.com/b13_1013561/mydoodle.byethost13.com/htdocs/users/$subuser"); echo"folder $subuser deleted!";
  23. i dont quite get what you mean by that. what the code is meant to do is: so heres my code /* Delete user from database */ else{ $q = "DELETE FROM ".TBL_USERS." WHERE username = '$subuser'"; $database->query($q); $dirname = '/home/vol2/byethost13.com/b13_1013561/mydoodle.byethost13.com/htdocs/users/$subuser'; function delete_directory($dirname) { if (is_dir($dirname)) $dir_handle = opendir($dirname); if (!$dir_handle) return false; while($file = readdir($dir_handle)) { if ($file != "." && $file != "..") { if (!is_dir($dirname."/".$file)) unlink($dirname."/".$file); else delete_directory($dirname.'/'.$file); } } closedir($dir_handle); rmdir($dirname); return true; } header("Location: ".$session->referrer); } now the problem is the code is giving out no errors it sucessfully deletes the user from the database however it leaves the folder behind and i have no idea why because it leaves no errors
  24. ok heres my code ffunction delete_directory($dirname) { if (is_dir($dirname)) $dir_handle = opendir($dirname); if (!$dir_handle) return false; while($file = readdir($dir_handle)) { if ($file != "." && $file != "..") { if (!is_dir($dirname."/".$file)) unlink($dirname."/".$file); else delete_directory($dirname.'/'.$file); } } closedir($dir_handle); rmdir($dirname); return true; } now my problem is i cant see what part i would declare the directory to be deleted, while i was typing this i ust thought maybe i have to state it in another variable? ust asking thanks
×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.