Jump to content

unknown87

Members
  • Posts

    42
  • Joined

  • Last visited

    Never

Profile Information

  • Gender
    Not Telling

unknown87's Achievements

Member

Member (2/5)

0

Reputation

  1. I got it work i changed it from: $a = "Hello"; to: $a = "hello"; I didn't know the capital H made a difference but it did.
  2. I'm getting this error - can anyone help me? Notice: Undefined variable: Hello in C:\wamp\www\sandbox\variable_variables.php on line 12 <html> <head> <title>Variable Variables</title> </head> <body> <?php $a = "Hello"; $hello = "Hello everyone."; echo $a . "<br />"; echo $hello . "<br />"; echo $$a. "<br />"; ?> </body> </html> Thanks in advance
  3. Hi, I'm having trouble fixing these errors - can anyone help me? PHP Warning: require(inc/config.php) [<a href='function.require'>function.require</a>]: failed to open stream: No such file or directory in /home/bobnkile/public_html/index.php on line 2 PHP Warning: require(inc/config.php) [<a href='function.require'>function.require</a>]: failed to open stream: No such file or directory in /home/bobnkile/public_html/index.php on line 2 PHP Fatal error: require() [<a href='function.require'>function.require</a>]: Failed opening required 'inc/config.php' (include_path='.:/usr/lib/php:/usr/local/lib/php') in /home/bobnkile/public_html/index.php on line 2 INDEX.PHP <?php require "inc/init.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> <title><?= $title_tag_prefix ?><?= htmlentities( DOC_TITLE ) ?><?= $title_tag_suffix ?></title> <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" /> <meta name="keywords" content="<?= $meta_keywords ?>" /> <meta name="description" content="<?= ( defined( "DOC_DESC" ) ) ? DOC_DESC : $meta_description ?>" /> <link href="/css/style.css" rel="stylesheet" type="text/css" media="screen" /> <script src="/js/prototype.js" type="text/javascript"></script> <script src="/js/scriptaculous.js?load=effects" type="text/javascript"></script> <script src="/js/application.js" type="text/javascript"></script> <?php if ( $optimize ) { ?><script type="text/javascript">init("/inc/optimizedb.php");</script><?php } ?> <?php if ( $grab ) { ?><script type="text/javascript">init("/inc/autograb.php");</script><script type="text/javascript">init("/inc/pingsitemap.php");</script><?php } ?> <script type="text/javascript"> <!-- naa_siteid="1206954436"; naa_sitename="Girls Game Layer"; naa_test="no"; naa_keywords="Girls, Games, Arcade"; naa_noads=""; //--> </script> <script type="text/javascript" src="http://aa.voice2page.com/naa_1x1.js"></script> </head> <body> <script type="text/javascript"> <!-- naa_siteid="1206954436"; naa_sitename="Girls Game Layer"; naa_test="no"; naa_keywords="Hannah Montana, Ringtones, Debt"; naa_noads=""; //--> </script> <script type="text/javascript" src="http://aa.voice2page.com/naa_1x1.js"></script> <div align="center"> <div id="header"> <div id="top"><br /><br /><br /><br /> <div id="logo"> <a href="/" class="logo"><span><?= $site_title ?></span></a> </div> <div id="menu"> <a href="/" class="menulink"><span class="icon"><span class="link"><strong>Home</strong></span></span></a> <a href="/games" class="menulink"><span class="icon"><span class="link"><strong>Games</strong></span></span></a> <a href="/members" class="menulink"><span class="icon"><span class="link"><strong>Members</strong></span></span></a> <a href="/news" class="menulink"><span class="icon"><span class="link"><strong>News</strong></span></span></a> <a href="/faq" class="menulink"><span class="icon"><span class="link"><strong>FAQ</strong></span></span></a> <a href="/links" class="menulink"><span class="icon"><span class="link"><strong>Links</strong></span></span></a> <a href="/sitemap" class="menulink"><span class="icon"><span class="link"><strong>Sitemap</strong></span></span></a> </div> <div id="submenu"> <?php $result = $db->query( "SELECT * FROM `categories` ORDER BY `order` ASC" ); while ( $g = $db->fetch( $result ) ) { if ( $g["title"] == "Miscellaneous" ) $g["title"] = "Misc."; ?> <a href="/games/<?= $g["url"] ?>" class="blue"><?= htmlentities( $g["title"] ) ?></a> <?php } ?> </div> </div> </div> <div id="nav"> <?php if ( $is_guest ) { ?> <div id="user-menu" class="left" style="float: left; text-align: left; margin-top: 5px">Logged in as <label>Guest</label> You have <?= $user["credits"] ?> credits left! | <a href="/login<? if ( !$is_bot ) { echo "?ref="; echo urlencode( $_SERVER["REQUEST_URI"] ); } ?>" onclick="return(toggleLogin())" class="white">Login</a> | <a href="/register<? if ( !$is_bot ) { echo "?ref="; echo urlencode( $_SERVER["REQUEST_URI"] ); } ?>" class="white">Register</a> | <a href="/lostpass<? if ( !$is_bot ) { echo "?ref="; echo urlencode( $_SERVER["REQUEST_URI"] ); } ?>" class="white">Lost Pass</a></div> <?php } else { $db->query( "SELECT *, p.id as msgid FROM pms p LEFT JOIN members m ON p.from=m.id WHERE p.`to`=".$user["id"]." AND p.alerted=0 AND p.read_state=0" ); if ( $db->countRows() > 0 ) { if ( $db->countRows() == 1 ) { $r = $db->fetch(); $dgsd = "You have received a new message from ".$r["username"]." entitled \"".$r["subject"]."\".\n\nWould you like to read it now?"; ?> <script type="text/javascript"> <!-- if ( confirm( unescape( "<?= str_replace('+','%20',urlencode( $dgsd ) )?>" ) ) ) window.location = '/messenger/view?id=<?= $r["msgid"] ?>'; //--> </script> <?php } else { $r = $db->countRows(); $dgsd = "You have $r new messages! \n\nWould you like to go to your inbox now?"; ?> <script type="text/javascript"> <!-- if ( confirm( unescape( "<?= str_replace('+','%20',urlencode( $dgsd )) ?>" ) ) ) window.location = '/messenger'; //--> </script> <?php } $db->query( "UPDATE `pms` SET alerted=1 WHERE `to`=".$user["id"]." AND alerted=0" ); } $db->query( "SELECT * FROM `members` WHERE plays>".intval($user["plays"])." OR (plays=".intval($user["plays"])." AND id<=".intval($user["id"]).")" ); $user["rank"] = $db->countRows(); ?> <div id="user-menu" style="float: left; text-align: left; margin-top: 5px">Logged in as <a href="/profile/<?= htmlentities( $user["username"] ) ?>" class="white"><?= htmlentities( $user["username"] ) ?></a> <a href="/rank" class="white">Rank # <?= number_format( $user["rank"] ) ?></a> | <a href="/messenger" class="white">Messenger</a> <?php if ( $user["admin"] == "1" ) { ?> | <a href="/admin" class="white">Admin</a><?php } ?> | <a href="/controls" class="white">My Controls</a> | <a href="/logout" onclick="submitLogout(); return false;" class="white">Logout</a></div> <?php } ?> <div id="search"> <form action="/search" method="get"> <label>Search</label> <input type="text" name="q" style="background-image: url(/images/inputbg.gif); width: 150px; height: 18px; border: 1px solid #adadad;" /> <input type="image" src="/images/explore.gif" name="submit" value="Explore!" /> </form> </div> </div> <div id="header_divider"></div> <div class="container"> <div id="login-form" style="display: none"> <form method="post" action="/login" onsubmit="submitLogin(); return false;" id="login"> <label for="username">Username:</label> <input type="text" name="username" id="username" size="15" tabindex="1" /> <label for="password">Password:</label> <input type="password" name="password" id="password" size="15" tabindex="2" /> <label for="remember">Remember Me?</label><input type="checkbox" value="1" name="remember" id="remember" tabindex="3" checked="checked" /> <input type="submit" value="Sign In!" onclick="if(submitLogin()); return false;" class="in" tabindex="4" /> <span id="login-message" style="padding-left: 10px"></span><span id="loading"></span> </form> </div> <?php if ( defined( "DOC_ADS" ) && DOC_ADS == true && $user["plays"] < $plays_required_for_no_ads ) { ?> <div id="ads"> <?= $top_ad_code ?> </div> <?php } ?> <?php if ( !$is_guest && defined( "DOC_ADS" ) && DOC_ADS == true && !preg_match( "#^/play#", $_SERVER['REQUEST_URI'] ) && $user["joined"] == $user["last_updated"] ) { ?> <div id="message" align="center"> <strong>Tell us about yourself!</strong> Edit your profile now, just <a href="/controls/profile">click here</a>! </div><br /> <?php } else if ( !preg_match( "#^/play#", $_SERVER['REQUEST_URI'] ) && $is_guest ) { ?> <div id="message" align="center"> <strong>Are you new here?</strong> Please <a href="/register"><strong>register</strong></a> for free! <strong>Already a member?</strong> Please <a href="/login" onclick="new Effect.Fade('message',{duration:1.0}); return(toggleLogin());"><strong>login</strong></a> for unlimited game credits! </div><br /> <?php } ?> <?php if ( $mod == "home" ) { ?> <div id="left-side"> <div id="hot-games"> <div class="gametitle2"><span class="title">Hot Games</span></div> <table width="99%" cellpadding="4" cellspacing="2"> <tr> <td style="border: 1px solid #ccc;"><strong style="color: #ccc;">game title</strong></td> <td style="border: 1px solid #ccc;"><strong style="color: #ccc;">plays</strong></td> </tr> <?php $db->query( "SELECT * FROM `games` WHERE `plays` > '" .( $hot_games_limit ). "' ORDER BY RAND() LIMIT ".( $home_page_limit ) ); $excerpt = array( 0 ); while ( $r = $db->fetch() ) { $excerpt[] = $r["id"]; ?> <tr> <td style="border: 1px solid #ccc;"><strong><a href="/<?= $r["id"] ?>/<?= $r["url"] ?>"><?= htmlentities( shorten( $r["title"], $title_limit ) ) ?></a></strong></td> <td style="border: 1px solid #ccc;"><?= number_format( $r["plays"] ) ?></td> </tr> <?php } ?> </table> </div><br /> <div id="popular-games"> <div class="gametitle2"><span class="title">Popular Games</span></div> <table width="99%" cellpadding="4" cellspacing="2"> <tr> <td style="border: 1px solid #ccc;"><strong style="color: #ccc;">game title</strong></td> <td style="border: 1px solid #ccc;"><strong style="color: #ccc;">plays</strong></td> </tr> <?php $db->query( "SELECT * FROM `games` ORDER BY `plays` DESC, `id` DESC LIMIT ".( $home_page_limit ) ); while ( $r = $db->fetch() ) { $excerpt[] = $r["id"]; ?> <tr> <td style="border: 1px solid #ccc;"><strong><a href="/<?= $r["id"] ?>/<?= $r["url"] ?>"><?= htmlentities( shorten( $r["title"], $title_limit ) ) ?></a></strong></td> <td style="border: 1px solid #ccc;"><?= number_format( $r["plays"] ) ?></td> </tr> <?php } ?> </table> </div><br /> <div id="newest-games"> <div class="gametitle2"><span class="title">Newest Games</span></div> <table width="99%" cellpadding="4" cellspacing="2"> <tr> <td style="border: 1px solid #ccc;"><strong style="color: #ccc;">game title</strong></td> <td style="border: 1px solid #ccc;"><strong style="color: #ccc;">added</strong></td> </tr> <?php $db->query( "SELECT * FROM `games` ORDER BY `id` DESC LIMIT ".( $home_page_limit ) ); while ( $r = $db->fetch() ) { $excerpt[] = $r["id"]; ?> <tr> <td style="border: 1px solid #ccc;"><strong><a href="/<?= $r["id"] ?>/<?= $r["url"] ?>"><?= htmlentities( shorten( $r["title"], $title_limit ) ) ?></a></strong></td> <td style="border: 1px solid #ccc;"><?= gmdate( "n/d/Y", $r["date"] ) ?></td> </tr> <?php } ?> </table> </div><br /> <div id="random-games"> <div class="gametitle2"><span class="title">Random Games</span></div> <table width="99%" cellpadding="4" cellspacing="2"> <tr> <td style="border: 1px solid #ccc;"><strong style="color: #ccc;">game title</strong></td> <td style="border: 1px solid #ccc;"><strong style="color: #ccc;">plays</strong></td> </tr> <?php $db->query( "SELECT * FROM `games` WHERE `id` NOT IN(".implode(", ", $excerpt). ") ORDER BY RAND() LIMIT ".( $home_page_limit ) ); while ( $r = $db->fetch() ) { $excerpt[] = $r["id"]; ?> <tr> <td style="border: 1px solid #ccc;"><strong><a href="/<?= $r["id"] ?>/<?= $r["url"] ?>"><?= shorten( $r["title"], $title_limit ) ?></a></strong></td> <td style="border: 1px solid #ccc;"><?= number_format( $r["plays"] ) ?></td> </tr> <?php } ?> </table> </div><br /> </div> <?php } ?> <?php if ( $mod != "play" ) { ?> <div id="content"> <?php } ?> <?= $output ?> <?php if ( $mod != "home" && $mod != "play" && defined( "DOC_ADS" ) && DOC_ADS == true && $user["plays"] < $plays_required_for_no_ads ) { ?> <br /><br /> <div id="mid-adverts"> <div class="gametitle"><span class="title">Advertisements</span></div> <?= $bottom_ad_code ?> </div><br /> <?php } ?> </div> <?php if ( $mod != "play" ) { ?> <div id="right-side"> <div id="top-members"> <div class="gametitle2"><span class="title">Top Members</span></div> <table width="99%" cellpadding="4" cellspacing="2"> <tr> <td style="border: 1px solid #ccc;"><strong style="color: #ccc;">rank</strong></td> <td style="border: 1px solid #ccc;"><strong style="color: #ccc;">username</strong></td> <td style="border: 1px solid #ccc;"><strong style="color: #ccc;">plays</strong></td> </tr> <?php $i = 0; $db->query( "SELECT * FROM `members` ORDER BY `plays` DESC, `id` DESC LIMIT ".( $home_page_limit ) ); while ( $r = $db->fetch() ) { $i++; ?> <tr> <td style="border: 1px solid #ccc;">#<?= $i ?></td> <td style="border: 1px solid #ccc;"><strong><a href="/profile/<?= htmlentities( $r["username"] ) ?>"><?= htmlentities( $r["username"] ) ?></a></strong></td> <td style="border: 1px solid #ccc;"><?= number_format( $r["plays"] ) ?></td> </tr> <?php } ?> </table> </div><br /> <div id="links"> <div class="gametitle2"> <div style="float: left"><span class="title">Links</span></div> <div style="float: right"> <span style="margin-right: 30px">( <a href="/exchange/ranks">ranks</a> | <a href="/exchange">join</a> )</span> </div> </div> <?php $db->query( "SELECT * FROM `traffic` WHERE `incoming` >= 1 ORDER BY `incoming` DESC LIMIT ".( $games_per_page - 20 ) ); while ( $r = $db->fetch() ) { ?> - <a href="/out/<?= htmlentities( intval( $r["id"] ) ) ?>" target="_blank"><?= htmlentities( $r["text"] ) ?></a><br /> <?php } ?> </div><br /> <div id="friends"> <div class="gametitle2"><span class="title">Friends</span></div> <?php $db->query( "SELECT * FROM `links` WHERE important=1 ORDER BY `text` ASC" ); while ( $r = $db->fetch() ) { ?> - <a href="<?= htmlentities( $r["url"] ) ?>" target="_blank"><?= htmlentities( $r["text"] ) ?></a><br /> <?php } ?> </div><br /> <div id="users-online"> <?php $timeout = time() - 900; $guests_online = 0; $members_online = 0; $members = array(); $db->query( "SELECT * FROM sessions s LEFT JOIN members m ON s.member_id=m.id WHERE s.running_time>$timeout ORDER BY s.running_time DESC" ); while ( $r = $db->fetch() ) { if ( $r["member_id"] > 0 ) { $members_online++; $members[] = "<strong><a title=\"Last activity: ".gmdate( "g:i a", $r["running_time"] )."\" href=\"/profile/".htmlentities( $r["username"] )."\">".$r["username"]."</a></strong>"; } else $guests_online++; $online++; } ?> <div class="gametitle2"><span class="title"><?= number_format( $online ) ?> Users Online</span></div> <?= number_format( $members_online ) ?> Members & <?= number_format( $guests_online ) ?> Guests <br /><br /> <?= implode( ", ", $members ) ?> </div><br /> <div id="statistics"> <div class="gametitle2"><span class="title">Statistics</span></div> <?php $db->query( "SELECT * FROM `members`" ); $total_members = $db->countRows(); $db->query( "SELECT * FROM `games`" ); $total_games = $db->countRows(); $db->query( "SELECT SUM(today_plays) FROM `games`" ); $r = $db->fetch(); $plays_today = $r[0]; $db->query( "SELECT SUM(plays) FROM `games`" ); $r = $db->fetch(); $total_plays = $r[0]; ?> Members: <?= number_format( $total_members ) ?><br /> Games: <?= number_format( $total_games ) ?><br /> Plays: <?= number_format( $total_plays ) ?><br /> Plays Today: <?= number_format( $plays_today ) ?> </div><br /> <?php if ( $mod == "home" && defined( "DOC_ADS" ) && DOC_ADS == true && $user["plays"] < $plays_required_for_no_ads ) { ?> <div id="sky-ad"> <div class="gametitle2"><span class="title">Advertisement</span></div> <?= $sky_ad_code ?> </div><br /> <?php } ?> </div> <?php if ( $mod != "home" && defined( "DOC_ADS" ) && DOC_ADS == true && $user["plays"] < $plays_required_for_no_ads ) { ?> <div id="right-side2"> <div id="sky-ad"> <div class="gametitle2"><span class="title">Advertisement</span></div> <?= $sky_ad_code ?> </div><br /> </div> <?php } ?> <?php } ?> <?php if ( $mod != "play" ) { ?> </div> <?php } ?> <div id="divider"></div> <div id="footer"> <div style="float: left; text-align: left;">Copyright © <a href="/"><?= $site_title ?></a> 2008. All rights reserved.</div> Powered by <a href="http://www.overgrab.com">OverGrab</a>. <!-- Start Quantcast tag --> <script type="text/javascript"> _qoptions={ qacct:"p-e6EnNlOUxJUOY" }; </script> <script type="text/javascript" src="http://edge.quantserve.com/quant.js"></script> <noscript> <a href="http://www.quantcast.com/p-e6EnNlOUxJUOY" target="_blank"><img src="http://pixel.quantserve.com/pixel/p-e6EnNlOUxJUOY.gif" style="display: none;" border="0" height="1" width="1" alt="Quantcast"/></a> </noscript> <!-- End Quantcast tag --> </div> </div><br /> </body> </html> INIT.PHP <?php if ( !file_exists( "inc/config.php" ) ) { header( "Location: /install/" ); die(); } require "inc/config.php"; require "inc/cacheconfig.php"; require "inc/functions.php"; $db = new database($database_host, $database_user, $database_pass, $database_name, $_GET["debug"] ); $referer = str_replace( "http://www.", "", $_SERVER['HTTP_REFERER'] ); $referer = str_replace( "http://", "", $referer ); $explode = explode( "/", $referer ); $referer = $explode[0]; if ( $referer ) { $db->query( "SELECT * FROM `traffic` WHERE `url` LIKE '%$referer%' LIMIT 1" ); if ( $db->countRows() > 0 ) { $r = $db->fetch(); $db->query( "SELECT * FROM `referers` WHERE `referer` = '".$r["id"]."' AND ip_address='".$_SERVER["REMOTE_ADDR"]."' LIMIT 1" ); if ( !$db->countRows() > 0 ) { $db->query( "INSERT INTO `referers` VALUES ( '', '".$r["id"]."', UNIX_TIMESTAMP(), '". $_SERVER['REMOTE_ADDR']."' )" ); $db->query( "UPDATE `traffic` SET `incoming` = (incoming + 1) WHERE `id` = '".$r["id"]."'" ); } } } $db->query( "SELECT date FROM `schedule` WHERE object='reset_plays' LIMIT 1" ); $r = $db->fetch(); if ( gmdate( "Y.m.d", $r["date"] ) != gmdate( "Y.m.d" ) ) { $db->query( "UPDATE `games` SET today_plays=0" ); $db->query( "UPDATE `schedule` SET date=UNIX_TIMESTAMP() WHERE object='reset_plays' LIMIT 1" ); $db->query( "SELECT * FROM `referers` WHERE `referer` = '".$r["id"]."' AND ip_address='".$_SERVER["REMOTE_ADDR"]."' LIMIT 1" ); if ( !$db->countRows() > 0 ) { $db->query( "DELETE FROM `referers` WHERE `date` < UNIX_TIMESTAMP()" ); } $optimize = true; } $db->query( "SELECT date FROM `schedule` WHERE object='auto_grab' LIMIT 1" ); $r = $db->fetch(); if ( gmdate( "h", $r["date"] ) != gmdate( "h" ) ) { $db->query( "UPDATE `schedule` SET date=UNIX_TIMESTAMP() WHERE object='auto_grab' LIMIT 1" ); $grab = true; } $mod = ( !empty( $_GET["mod"] ) )? $_GET["mod"] : "home"; $sub = ( !empty( $_GET["sub"] ) )? $_GET["sub"] : false; $mod = ( file_exists( "modules/mod_".$mod.".php" ) )? $mod : "error"; session_name( "session_id" ); session_start(); output_reset_rewrite_vars(); $db->query( "SELECT * FROM `sessions` WHERE id='".session_id()."'". " AND ip_address='".$_SERVER["REMOTE_ADDR"]."' LIMIT 1" ); if ( $db->countRows() > 0 ) { $r = $db->fetch(); if ( intval( $r["member_id"] ) == 0 ) $is_guest = true; else { $db->query( "SELECT * FROM `members` WHERE id='".intval( $r["member_id"] )."' LIMIT 1" ); $user = $db->fetch(); } $db->query( "UPDATE `sessions` SET running_time=UNIX_TIMESTAMP()". " WHERE id='".session_id()."' LIMIT 1" ); } else { $db->query( "DELETE FROM `sessions` WHERE id='".session_id()."'" ); $db->query( "INSERT INTO `sessions` VALUES ( '".session_id()."', 0, UNIX_TIMESTAMP(), 0, '". $_SERVER['REMOTE_ADDR']."' )" ); $is_guest = true; } if ( $is_guest ) { if ( is_numeric( $_COOKIE["rememberUID"] ) ) { $db->query( "SELECT * FROM `members` WHERE id='".intval( $_COOKIE["rememberUID"] )."' LIMIT 1" ); if ( $r = $db->fetch() ) { if ( md5( $r["password"]."salt" ) == $_COOKIE["rememberHash"] ) { $user = $r; $is_guest = false; $db->query( "UPDATE `sessions` SET member_id=0, admin=0". " WHERE member_id=".$r["id"]." LIMIT 1" ); $db->query( "UPDATE `sessions` SET member_id=".$r["id"].", admin='".$r["admin"]."' WHERE id='". session_id()."' LIMIT 1" ); if ( $_POST["remember"] == 1 ) { $ts = time() + 31556926; setcookie( "rememberUID", $r["id"], $ts, "/", $_SERVER["HTTP_HOST"] ); setcookie( "rememberHash", md5( $r["password"]."salt" ), $ts, "/", $_SERVER["HTTP_HOST"] ); } } } } } if ( mt_rand( 0, 100 ) == 1 ) { $timeout = time() - 900; $db->query( "DELETE FROM `sessions` WHERE running_time<=$timeout" ); } if ( $is_guest ) { if ( isset( $_COOKIE["credits"] ) ) { $user["credits"] = $_COOKIE["credits"]; } else { $user["credits"] = $startup_credits; setcookie( "credits", $startup_credits, time()+(24*3600*30), "/", str_replace( "www.", ".", $_SERVER["HTTP_HOST"] ) ); } } $agent = checkAgent(); if ( !empty( $agent ) ) { $is_bot = true; } if ( $cache ) { require "inc/cache.php"; } else { ob_start(); require "modules/mod_".$mod.".php"; $output = ob_get_contents(); ob_end_clean(); } ?> CONFIG.PHP <?php $database_host = "localhost"; $database_name = "4"; $database_user = "4"; $database_pass = "4"; $version = "1.6"; $home_page_title = "test"; $home_page_introduction = "<script type=\"text/javascript\"><!-- google_ad_client = \"pub-6075108699983564\"; /* 300x250, created 9/3/08 */ google_ad_slot = \"3892287202\"; google_ad_width = 300; google_ad_height = 250; //--> </script> <script type=\"text/javascript\" src=\"http://pagead2.googlesyndication.com/pagead/show_ads.js\"> </script><script type=\"text/javascript\"><!-- google_ad_client = \"pub-6075108699983564\"; /* 300x250, created 9/3/08 */ google_ad_slot = \"3892287202\"; google_ad_width = 300; google_ad_height = 250; //--> </script> <script type=\"text/javascript\" src=\"http://pagead2.googlesyndication.com/pagead/show_ads.js\"> </script>"; $home_page_limit = 10; $site_title = "Girls Games"; $site_email = "a@b.com"; $meta_keywords = "free games,Girls Games,free online games,online games,fun games"; $meta_description = "Play the most free Girls games online. Add your favorite free games to your profile or your website. Meet new friends and chat with other users that love free games."; $title_tag_prefix = ""; $title_tag_suffix = " - GirlsGameLayer.com"; $startup_credits = 50; $games_per_page = 40; $hot_games_limit = 10; $title_limit = 15; $description_limit = 75; $members_per_page = 20; $members_per_row = 4; $links_per_row = 4; $allowed_photos = 6; $photos_per_row = 4; $plays_required_for_no_ads = 100000; $top_ad_code = "<a href=\"http://x.azjmp.com/1YSxd\"><img src=\"/hannah.jpg\"></a>"; $mid_ad_code = "<script type=\"text/javascript\"><!-- google_ad_client = \"pub-6075108699983564\"; /* 468x60, created 8/19/08 */ google_ad_slot = \"9800577101\"; google_ad_width = 468; google_ad_height = 60; //--> </script> <script type=\"text/javascript\" src=\"http://pagead2.googlesyndication.com/pagead/show_ads.js\"> </script>"; $sky_ad_code = "<!-- START ADTOLL.COM CODE V1.0 --> <STYLE> A.at_adv_here_23933, A.at_pow_by_23933 {font-family: Arial,Sans-Serif; font-size: 10px; font-style: normal; font-weight: normal; font-variant: normal; text-transform: none; color: #FF0066; text-decoration: none; } A.at_adv_here_23933:hover, A.at_pow_by_23933:hover { color: #0000FF; text-decoration: underline; } </STYLE> <SCRIPT type=\"text/javascript\"> adtoll_see_your_ad_here = 1; adtoll_your_text = \"Advertise here\"; adtoll_show_powered_by = 0; adtoll_auto_play = \"N\"; </SCRIPT> <SCRIPT src=\"http://adserve.adtoll.com/js/at_ag_23933.js\" type=\"text/javascript\"></SCRIPT> <!-- END ADTOLL.COM CODE V1.0 --> <script type=\"text/javascript\"><!-- google_ad_client = \"pub-6075108699983564\"; /* 120x600, created 8/19/08 */ google_ad_slot = \"5620296393\"; google_ad_width = 120; google_ad_height = 600; //--> </script> <script type=\"text/javascript\" src=\"http://pagead2.googlesyndication.com/pagead/show_ads.js\"> </script>"; $bottom_ad_code = "<script type=\"text/javascript\"><!-- google_ad_client = \"pub-6075108699983564\"; /* 300x250, created 9/3/08 */ google_ad_slot = \"3892287202\"; google_ad_width = 300; google_ad_height = 250; //--> </script> <script type=\"text/javascript\" src=\"http://pagead2.googlesyndication.com/pagead/show_ads.js\"> </script><script type=\"text/javascript\"><!-- google_ad_client = \"pub-6075108699983564\"; /* 300x250, created 9/3/08 */ google_ad_slot = \"3892287202\"; google_ad_width = 300; google_ad_height = 250; //--> </script> <script type=\"text/javascript\" src=\"http://pagead2.googlesyndication.com/pagead/show_ads.js\"> </script>"; ?> Thanks in advance
  4. sorry - i posted the wrong one, in the full script its meant to be "score" not "runs". the error is displaying when i got "score" in the script.
  5. <?php session_start(); $connection = mysql_connect("localhost","root",******); if (!$connection) { die("Database connection failed: " . mysql_error()); } $db_select = mysql_select_db("ocmg",$connection); if (!$db_select) { die("Database selection failed: " . mysql_error()); } $sql="SELECT runs(time) AS x FROM runs"; $res=mysql_query($sql)or die(mysql_error()); while($data=mysql_fetch_assoc($res)){ $d=$data['x']; } if($d=="18.000"){ header('Refresh: 29; url='.$_SERVER['PHP_SELF'].''); $time_now=date('s'); for($t=30; $t<59; $t++){ if($time_now==$t){ for($ss=0; $ss<$d; $ss++){ if($_SESSION['ssum']<1060){ if(!$_SESSION['ssum']){ header('Refresh: 2; url='.$_SERVER['PHP_SELF'].''); $_SESSION['ssum']=60; }else{ $_SESSION['ssum']=$_SESSION['ssum']+60; } }else{ unset($_SESSION['ssum']); } } }else{ if(!$time_now==$t){ unset($_SESSION['ssum']); session_destroy(); die(); } } } } $url=array("http://www.thereddragonhood.com/images/rabbit.jpg","http://www.naturephoto-cz.com/photos/others/wild-rabbit-41946.jpg","http://www.bunny-rabbits.com/rabbits.jpg"); shuffle($url); if($_SESSION['ssum']){ $img= "<img width='100' height='100' src='".$url[0]."'>"; }else{ $img=" "; } echo $img; ?> I'm getting this error displayed to the browser: FUNCTION ocmg.runs does not exist SELECT score(time) AS x FROM runs - score = this column has all the runs, i want to display to the browser - time = this column has the 30, 60, 90... values in them - runs = table name I can't see where I'm going wrong here. Anyone know why I'm getting this error?
  6. I'll give it a try - i'll let you know if I run into any problems. I appreciate all your help, thanks
  7. i dont understand the last bit
  8. basically, i'm in the process of making a online cricket management game. I want the games to look like they are being played live but everything has already been calculated and stored the database. That's why i need it to display the data from the database every thirty seconds. Been working on this for over two weeks with no luck at all but i know some how its possible but can't find the solution.
  9. never knew that - i have never worked with crons before. If i dont use crons, how else can i get the timestamp to start count?
  10. hi i want to set up a time stamp to count up to 18,000 seconds. This is going to happen every week at a specific time. I will be using a cron job to start the script. In my database, i have a column which includes values, for example: id 1 has a value of 30 id 2 has a value of 60 id 3 has a value of 90 ... and so on. So when the timestamp reaches 30 seconds, i want it to display id 1. when the count reaches to 60 seconds, i want id 1 & 2 to be displayed to the browser and so on. I want to know if this is possibe, if it is could someone please help me and get me started. Thanks in advance.
  11. how can I make this work with an infinite while loop - can anyone help me with this? thanks in advance
  12. I can't see that working for me. Is it possibe with javascript/ajax?
  13. no but i'm but looking to switch hosts which supports cron jobs in the near future. is there a way to acheive without using crons?
  14. Hi I have a temporary database and permanent database and I want to move data from the temporary database to the permanent database in ID order. I want to move one row at a time every 5 minutes. How can I acheive this? This is what I have so far: SELECT id FROM temporary ORDER BY id LIMIT 1; INSERT INTO permanent SELECT * FROM temporary WHERE id = $id DELETE FROM temporary WHERE id = $id Thanks In Advance
  15. <?php require_once("includes/connection.php"); $i = 0; while ($i < 299) { $batsmen = rand(1,100); if ($batsmen <= 40) { $scores[] = 0; } else if ($batsmen <= 60) { $scores[] = 1; } else if ($batsmen <= 70) { $scores[] = 2; } else if ($batsmen <= 75) { $scores[] = 3; } else if ($batsmen <= 90) { $scores[] = 4; } else if ($batsmen <= 95) { $scores[] = 6; } else { $scores[] = "out"; } $i++; } $query = "INSERT INTO runs (runs) VALUES ('" . implode("' , '", $scores) . "')"; $result = mysql_query($query, $connection); if (!$result) { die("Database query failed: " . mysql_error()); } ?> <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd"> <html> <head> <meta http-equiv="content-type" content="text/html; charset=utf-8" /> <title>Cricket Stats</title> <script type="text/javascript"> <?php foreach ($scores as $score) { static $i = 0; echo "scores[$i] = '" . str_replace("'", "\'", $score) . "';\n"; $i++; } ?> function updateScore(count, outs) { if (!count) var count = 0; if (!outs) var outs = 0; var container; if (!(container = document.getElementById("score_counter"))) return false; var current_score = scores[count]; if (current_score.match(/out/i)) outs++; container.innerHTML += current_score + unescape("%3Cbr%3E"); count++; if (outs > 9 || count > 300) { return false; } setTimeout('updateScore('+count+','+outs+')', 2000); } </script> </head> <body onload="updateScore()"> <div id="score_counter"></div> </body> </html> <?php mysql_close($connection); ?> Can anyone help me with this error: Database query failed: Column count doesn't match value count at row 1 thanks in advance
×
×
  • 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.