Jump to content

DeanWhitehouse

Members
  • Posts

    2,527
  • Joined

  • Last visited

Everything posted by DeanWhitehouse

  1. Ok, well i am going to be recoding and redesigning the forum's. When i am i will post the code in the forum , for people to advise security on.
  2. http://random-game-design.awardspace.com/ Ok, so this is my new site, the look i am going for is the modern stylish look and proffesional look. At the moment i think it looks a bit plain and dull , but i can not think of any ideas. Any one got any suggestions and/or designs they may have (any designs will be credited)
  3. We are still fixing bugs and adding features, but we need people to test the site, there is a forum on there to post any bugs. One main exploit we are having a problem with is someone posting in a locked forum , without a post form, if someone here can do that can you show me how and how to stop it. http://www.asia-underworld.com/ Thanks, Blade
  4. nope in smarty you don't put PHP tags in you have to use smarty tags, the problem is basically that the variable is not going into the welcome.htm
  5. This is my code welcome.php <?php session_start(); require_once('global.php'); $is_id = $_SESSION['userid']; $query = "SELECT * FROM mf_user WHERE ID = '{$is_id}' "; $result = mysql_query($query); $row = mysql_fetch_assoc($result); $image_select = $row['visits']; $smarty = new MySmarty(); $smarty->assign('visits',$image_select); $smarty->assign('title', SITE_TITLE.' :: Cast'); $smarty->assign('site_title', SITE_TITLE); $smarty->assign('base_url', BASE_URL); $smarty->assign('tpl_url', BASE_URL.TPL_URL."default/"); $smarty->assign('hiddenstr', $hiddenstr); //right side data require_once('right_data.php'); //right side data echo $image_select; $smarty->display('welcome1.htm'); ?> and this is welcome.htm <html> <head> <title>.:Asia Underworld:.</title> <meta name="author" CONTENT="tom"> <link href="../../css/main.css" rel="stylesheet" type="text/css"><meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1"><style type="text/css"> <!-- {literal} body { background-image: url(../../images/indexbg.jpg);{/literal} } --> </style> {include file="css_js.htm"} </head> <body onLoad="grabit()" onkeypress="screenshotHide(event)"> <div id="dhtmltooltip"></div> <p> </p> <table width="95%" border="0" align="center" cellpadding="0" cellspacing="0" class="cat"> {include file="header.htm"} <tr> <td width="120" background="" valign="top"> {include file="left.htm"} </td> <td width="99%" background="" bgcolor="#333333" valign="top"><p> </p> <table width="75%" align="center" cellpadding="0" cellspacing="0" class="cat"> <tr> <td height="20" class="headerbar">- Welcome!</td> </tr> <tr> <td class="sub3"><div align="center"> <p> </p> <p><img src="../../images/test.png" width="500" height="150"></p> <p>{if ($image_select < 2)}<img src="../../images/welcome1.jpg" width="500" height="500">{else}<img src="../../images/welcome2.jpg" width="500" height="500">{/if}</p> <p> </p> </div></td> </tr> </table> <p><br> </p> </td> <td width="120" background="" valign="top"> {include file="right.htm"} </td> </tr> </table> </body> </html> this statement does not seem to work <p>{if ($image_select < 2)}<img src="../../images/welcome1.jpg" width="500" height="500">{else}<img src="../../images/welcome2.jpg" width="500" height="500">{/if}</p> it always shows welcome1.jpg, i have echoed out the variable and it says four.
  6. well on everypage,so you could just put it in the header.php (or something similar) and then everypage they go to it will update the db with when they went there
  7. Check for there session, if they close the browser the session wont be present, and set users offline after a certain amount of inactivity
  8. I could but it is based on a number of factors that are set right_data.php
  9. Ok, so basically what i want to is show an image on everypage depending on a variable if statment, but there are a few pages that use the same variable's and i cannot place the variable in the right_data.php (where the image is) becuase it will stop the pages with the variables working properly. Here is the code for one page where the variables are used, crime.php <?php session_start(); require_once('global.php'); $error= ""; $msg= ""; $success = 0; $isShowCode = false; $interval = 0; $exp = $db->getOne("select Experience from ".TBL_USER_DETAIL." where UserID = '".$_SESSION['userid']."'"); $cityID = $db->getOne("select CityID from ".TBL_USER." where Username = '".$_SESSION['username']."'"); $userRank = GetUserRank($exp); $sql = "select count(*) from ".TBL_USER_CRIME." where User = '".$_SESSION['username']."'"; $crimeCount = $db->getOne($sql); if ( $crimeCount > 0 && ( $crimeCount % VERIFY_TIMES ) == 0 ) { $isShowCode = true; } if ($_POST) { $crime = trim($_POST['crime']); $levelRequest = $db->getOne("select LevelNeed From ".TBL_CRIME." where ID = '".$crime."'"); $interval = $db->getOne("select count(*) from ".TBL_USER_CRIME." where User = '".$_SESSION['username']."' and DATE_SUB(NOW(), INTERVAL 2 MINUTE) < AddDate"); if ($interval > 0 ) { $error .= "You cannot do another crime yet.<br>"; } if ($userRank < $levelRequest) { $rankName = $db->getOne("select Title From ".TBL_RANK." where ID = '".$levelRequest."'"); $error .= "You must be at least a ".$rankName." to do this crime.<br>"; } elseif ($isShowCode) { $randomcode = safeStr($_POST['randomcode']); if ($randomcode != $_SESSION['key'] ) { $error = "Code is not verified."; } } if ($error == "") { $sql = "select Chance from ".TBL_CRIME_CHANCE." where User = '".$_SESSION['username']."' and CrimeType = '".$crime."'"; $chance = $db->getOne($sql); if ($chance == "" ) $chance = 0; if (mt_rand(1, 100) < $chance ) { $success = 1; //successful } else { $temp = mt_rand(1, 100); $success = (($temp < 90) ? 2 : 3); } $crimeTitle = $db->getOne("select Title from ".TBL_CRIME." where ID = '".$crime."'"); $sql = "insert into ".TBL_USER_CRIME." set User = '".$_SESSION['username']."', AddDate = NOW(), Crime = '".$crime."', Success = '".$success."'"; $db->query($sql); if ($success == 1) { $profitRow = $db->getRow("select MinProfit, MaxProfit from ".TBL_CRIME." where ID = '".$crime."'"); $profit = mt_rand($profitRow[0],$profitRow[1]); $userGetMoney = UptCrewMoney("Crime",$profit); $sql = "update ".TBL_USER_DETAIL." set Cash = (Cash + ".$userGetMoney.") where UserID = '".$_SESSION['userid']."'"; $db->query($sql); $addExp = mt_rand(3,; RankUpdate($addExp); $sql = "update ".TBL_USER_DETAIL." set Experience = (Experience + ".$addExp.") where UserID = '".$_SESSION['userid']."'"; $db->query($sql); } else { //unsuccessful or get caught $addExp = mt_rand(2,4); RankUpdate($addExp); $sql = "update ".TBL_USER_DETAIL." set Experience = (Experience + ".$addExp.") where UserID = '".$_SESSION['userid']."'"; $db->query($sql); } $MaxCrime = $db->getOne("select ID from ".TBL_CRIME." where LevelNeed <= '".$userRank."' order by LevelNeed Desc limit 0,1"); for ($i = 1;$i <= $MaxCrime;$i++) { $chance = $db->getOne("select Chance from ".TBL_CRIME_CHANCE." where User = '".$_SESSION['username']."' and CrimeType = '".$i."'"); $chance = (($chance == 100) ? (100 - mt_rand(5, 10)): ($chance + mt_rand(1, 2)) ); if ($chance > 100 ) $chance = 100; $sql = "update ".TBL_CRIME_CHANCE." set Chance = '".$chance."' where User = '".$_SESSION['username']."' and CrimeType = '".$i."'"; $db->query($sql); } $isShowCode = false; } } if ($success == 0 ) { $interval = $db->getOne("select count(*) from ".TBL_USER_CRIME." where User = '".$_SESSION['username']."' and DATE_SUB(NOW(), INTERVAL 2 MINUTE) < AddDate"); } $arrCrime = $db->getAll("select ID,Title,LevelNeed from ".TBL_CRIME." order by ID desc"); for ($i=0; $i < count($arrCrime);$i++ ) { $sql = "select Chance from ".TBL_CRIME_CHANCE." where User = '".$_SESSION['username']."' and CrimeType = '".$arrCrime[$i][0]."'"; $arrCrime[$i][3] = $db->getOne($sql); $arrCrime[$i][3] = ($arrCrime[$i][3]=="") ? 0 : $arrCrime[$i][3]; } $smarty = new MySmarty(); $smarty->assign('title', SITE_TITLE.' :: Crime'); $smarty->assign('base_url', BASE_URL); $smarty->assign('hiddenstr', $hiddenstr); //right side data require_once('right_data.php'); //right side data $smarty->assign('success', $success); $smarty->assign('error', $error); $smarty->assign('msg', $msg); $smarty->assign('interval', $interval); $smarty->assign('isShowCode', $isShowCode); $smarty->assign('userRank', $userRank); $smarty->assign('arrCrime', $arrCrime); $smarty->assign('arrCrimeCount', count($arrCrime)); if ($success == 1 ) { $smarty->assign('crime', $crime); $smarty->assign('profit', $profit); } if ($success == 2) { $smarty->assign('crimeTitle', $crimeTitle); } require_once('injail.php'); //when user is in jail require_once('inhospital.php'); //when user is in hospital require_once('inshooting.php'); //when user is in shooting range if ($success == 3) { // get caught $duration = mt_rand(40, 80); //$isBreakable = (mt_rand(1, 100) <= 70) ? 1 : 0; $isBreakable = 1; $sql = "insert into ".TBL_JAIL." set User = '".$_SESSION['username']."', City = '".$cityID."', AddDate = NOW(), Duration = '".$duration."', IsBreakable = '".$isBreakable."', IsBurst = 0"; $db->query($sql); } $smarty->display('crime.htm'); ?> this is right_data.php <?php $rowDetail = $db->getRow("select ShootSkill,ProtectionID,GunID,Experience,Cash, BoozeTimes from ".TBL_USER_DETAIL." where UserID = '".$_SESSION['userid']."'"); $rowDetail[1] = ($rowDetail[1] == "" ) ? 0 : $rowDetail[1]; $rowDetail[2] = ($rowDetail[2] == "" ) ? 0 : $rowDetail[2]; $userRank = GetUserRank($rowDetail[3]); if ($userRank < 12) { $nextRank = $db->getOne("select Title from ".TBL_RANK." where ID = '".($userRank+1)."'"); $nextRankRatio = intval( ($rowDetail[3]-GetRankValue($userRank)) / (GetRankValue($userRank+1)-GetRankValue($userRank)) * 100); } $smarty->assign('nextRankRatio', $nextRankRatio); $sql = " select C.Title, G.Title, D.Bullet, P.Title, D.Cash, D.Experience, D.Health, Cr.Title, (100-D.Health) as HealthLeft from ".TBL_USER_DETAIL." D INNER JOIN ".TBL_USER." U ON U.ID = D.UserID LEFT JOIN ".TBL_GUN." G ON G.ID =D.GunID "; $sql .= " INNER JOIN ".TBL_CITY." C ON C.ID =U.CityID LEFT JOIN ".TBL_PROTECTION." P ON P.ID =D.ProtectionID LEFT JOIN ".TBL_CREW." Cr ON Cr.ID =D.CrewID where U.UserName = '".$_SESSION['username']."'"; $row_userdetail = $db->getRow($sql); $row_userdetail[4] = number_format($row_userdetail[4]); $row_userdetail[5] = GetUserRankName($row_userdetail[5]); $row_userdetail[9] = $db->getOne("select count(*) from ".TBL_MESSAGE." where Recipient = '".$_SESSION['username']."' and IsViewed = 0 and IsSaved = 0"); //echo "select count(*) from ".TBL_MESSAGE." where Recipient = '".$_SESSION['username']."' and IsViewed = 0 and IsSaved = 0";exit(); $row_userdetail[10] = $db->getOne("select count(*) from ".TBL_JAIL." where DATE_SUB(NOW(), INTERVAL Duration SECOND) < AddDate and IsBurst = 0"); $smarty->assign('arrUserDetail', $row_userdetail); $smarty->assign('currTime', date("D h:i A", time())); ?> and this is right.htm <!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> <link href="../../css/main.css" rel="stylesheet" type="text/css" /> <script type="text/javascript" src="skinnytip.js"> <!-- SkinnyTip (c) Elliott Brueggeman --> </script> <style type="text/css"> <!-- {literal}.style1 {font-size: 10}{/literal} --> </style> </head> <body> <div id="tiplayer" style="position:absolute; visibility:hidden; z-index:10000;"></div> <table width="150" align="center" cellpadding="0" cellspacing="0" class="rightborder"> <tr> <td class="headertop"><div align="center">.:Stats:.</div></td> </tr> <tr> <td bgcolor="#666666" class="body"><table width="150" border="0" align="center" cellpadding="0" cellspacing="0"> <tr> <td height="73" background="../../images/earth.jpg"><div align="center"><span class="biggrey">{$arrUserDetail[0]}</span></div></td> </tr> </table> <table width="150" border="0" align="center" cellpadding="0" cellspacing="0"> <tr> <td><div align="center"> <p align="center" class="biggrey"></font></p> <script src="http://www.clocklink.com/embed.js"></script><script type="text/javascript" language="JavaScript">obj=new Object;obj.clockfile="0002-black.swf";obj.TimeZone="JST";obj.width=150;obj.height=150;obj.Place="";obj.wmode="transparent";showClock(obj);</script> </div></td> </tr> </table> <table width="150" border="0" align="center" cellpadding="0" cellspacing="0"> <tr> <td height="36" background="../../images/images/statsright_01.png"> </td> </tr> <tr> <td background="../../images/images/statsright_02.png" class="statsright"><table width="100%" border="0" cellpadding="0" cellspacing="5" class="statsright"> <tr> <td>- Crew: {if ($arrUserDetail[7]=="")}None{else}{$arrUserDetail[7]}{/if}</td> </tr> <tr> <td>- Rank: {$arrUserDetail[5]}</td> </tr> <tr> <td>- Money: ${$arrUserDetail[4]}</td> </tr> <tr> <td>- Armor: {if ($arrUserDetail[3]=="")}None{else}{$arrUserDetail[3]}{/if} </td> </tr> <tr> <td>- Bullets: {$arrUserDetail[2]}</td> </tr> <tr> <td>- Gun: {if ($arrUserDetail[1]=="")}None{else}{$arrUserDetail[1]}{/if}</td> </tr> </table> </td> </tr> <tr> <td height="22" background="../../images/images/statsright_03.png"> </td> </tr> </table> <p align="center"><a href="{$base_url}mailbox.php"><img src="{$base_url}images/{if ($arrUserDetail[9]== 0) }msg2{else}msgmail{/if}.gif" border="0" onMouseOver = "return tooltip('('{$arrUserDetail[9]} new messages!')', 'You have', 'width:75, titletextcolor:#222222, bordercolor:#999999, backcolor:#666666, fontsize:10');" onmouseout="return hideTip();" onClick=""></p> </tr> <tr> <td bgcolor="#666666" class="body"><table width="100%" border="0" cellspacing="0" cellpadding="0" class="rightbars"> <tr> <td width="{$nextRankRatio}%" align="right" background="../../images/gunbar.gif"><div align="center">Rank:({$nextRankRatio}%)</div></td> <td width="{math equation=" align="left"x-y" x=100 y=$nextRankRatio}%"></td> </tr> </table> </tr> <tr> <td bgcolor="#666666" class="body"><table width="100%" border="0" cellpadding="0" cellspacing="0" class="rightbars2"> <tr> <td width="{$arrUserDetail[6]}%" align="right" background="../../images/healthbar.gif"><div align="center">Health({$arrUserDetail[6]}%)</div></td> <td width="{$arrUserDetail[8]}%" align="left"></td> </tr> </table> </tr> <tr> <td height="100%" nowrap="nowrap" bgcolor="#999999"><table width="60%" border="0" align="center" cellpadding="5" cellspacing="0"> <tr> <td><div align="center"><a href="crime.php">{ if ($interval > 0 ) }<img src="../images/WigetCrime.jpg" border="0" onClick="" onMouseOver = "return tooltip('Crime', 'Timer', 'width:75, titletextcolor:#222222, bordercolor:#999999, backcolor:#666666, fontsize:10');" onmouseout="return hideTip();" onClick="">{else}<img src="../images/WigetCrimeGreen.jpg" border="0" onClick="" onMouseOver = "return tooltip('Crime', 'Timer', 'width:75, titletextcolor:#222222, bordercolor:#999999, backcolor:#666666, fontsize:10');" onmouseout="return hideTip();" onClick="">{/if} <td><div align="center"><a href="burglary.php"><img src="../images/WigetGTA.jpg" border="0" onClick="" onMouseOver = "return tooltip('GTA', 'Timer', 'width:75, titletextcolor:#222222, bordercolor:#999999, backcolor:#666666, fontsize:10');" onmouseout="return hideTip();" onClick=""> </tr> <tr> <td><div align="center"><a href="fight.php"> <img src="../images/WigetFight.jpg" border="0" onClick="" onMouseOver = "return tooltip('Work Out!', 'Timer', 'width:75, titletextcolor:#222222, bordercolor:#999999, backcolor:#666666, fontsize:10');" onmouseout="return hideTip();" onClick=""> <td><div align="center"><a href="airport.php"><img src="../images/WigetTravel.jpg" border="0" onClick="" onMouseOver = "return tooltip('Airport', 'Timer', 'width:75, titletextcolor:#222222, bordercolor:#999999, backcolor:#666666, fontsize:10');" onmouseout="return hideTip();" onClick=""> </tr> </table> <p> </p> <p> </p> <p> </p> </tr> </table> <script type="text/javascript" src="../../skinnytip.js"></script> </td> </tr> </table> </body> </html>
  10. At the moment this is just in my mind , but how can i work out when an action was last performed from a mysql timestamp. What i need to do is work out when how long ago they did this task and if it was within a certain limit they can't do it until after. e.g. they can attack every two minutes.
  11. my bad, echoing the wrong thing
  12. I am now trying to capitalixe it, with this <title><?php $pagetitle = $_SERVER['REQUEST_URI']; $parts = explode('/', $pagetitle); list($page_title) = explode('.', end($parts)); $page = ucwords($page_title); echo $site_title." - ".$page_title; ?></title> but this does not do it, is this because it is the title?
  13. thanks, that works
  14. try chaging if ($row2['status'] > 0) {
  15. how can i explode this twice <title><?php $pagetitle = $_SERVER['REQUEST_URI']; $page_title = (explode("/",$pagetitle); echo $site_title." - ".$page_title[1]; ?></title> </head> i need to get it to be home not home.php or /home.php any ideas, i tried exploding my explode but that didn't work
  16. I have this code for a dynamic dropdown list. These are my lists. i need the second one to be decided from the first option, but without refreshing the page. The first one shows main catergory's and the second sub-catergory's. Can anyone help. <tr><td><span class="style7">Gallery:</td><td> <?php $query = "SELECT catergory FROM `image_catergory`"; $result = mysql_query($query) or die("Error:" . mysql_error()); ?> <select name='folder'> <?php if (mysql_num_rows($result) > 0) { while ($row = mysql_fetch_assoc($result)) { echo "<option>".$row['catergory']."</option>"; } } ?> </select> </span></td> <?php if(mysql_num_rows($result) < 1) { echo "<tr><td><a href='".$_SERVER['HTTP_HOST']."/add_catagories.php'>Add Catergory</a></td></tr>"; } ?> <tr><td><span class="style7">Sub-Gallery:</td><td> <?php $quey = "SELECT sub_cat FROM `sub_cat`"; $reult = mysql_query($quey) or die("Error:" . mysql_error()); ?> <select name='subfolder'> <?php if (mysql_num_rows($reult) > 0) { while ($ow = mysql_fetch_assoc($reult)) { echo "<option>".$ow['sub_cat']."</option>"; } } ?> </select> </span></td> </tr><tr><td><input type="submit" name="upload" value="Upload"></td></tr></td></tr></table></form> </form> <?php if(mysql_num_rows($result) < 1) { echo "<tr><td><a href='".$_SERVER['HTTP_HOST']."/add_catagories.php'>Add Catergory</a></td></tr>"; } } ?>
  17. solved. Heres the code <?php require_once 'header.php'; $time_stamp = date("d.m.Y"); $date = $time_stamp; ///////////////////////////////////////////////////////////// if(isset($_GET['image_subcat'])) // If the URL ends in ?image_cat do everything in the brakets { $sub_cat = $_GET['image_subcat']; $query = "SELECT folder_name,image_link,image_id,image_name,sub_folder FROM `image_gallery` WHERE `sub_folder` = '{$sub_cat}' ORDER BY image_id ASC"; $result = mysql_query($query) or die("Error:" . mysql_error()); $i = 0; ?> <table align="center"><tr> <?php while ($row = mysql_fetch_assoc($result)) { if ($i == 4) { $i = 0; // reset variable echo "</td></tr><tr></tr><tr><td>"; // break the line } ?><a href="<?php echo $row['image_link']; ?>" rel="lightbox [main]" title="<?php echo $row['image_name']; ?>" ><img width="150px" src="<?php echo $row['image_link']; ?>"></a></td><td> <?php $i++; // increase $i each time through the loop } ?> </td></tr></table> <?php require_once 'footer.php'; exit(); } ///////////////////////////////////////////////////////////// if(isset($_GET['image_cat'])) { $cater = $_GET['image_cat']; $query = "SELECT sub_cat FROM `sub_cat` WHERE `parent_cat` = '{$cater}'"; $result = mysql_query($query) or die("Error:" . mysql_error()); $result1 = mysql_query($query) or die("Error:" . mysql_error()); $r = mysql_fetch_assoc($result1); $car = $r['sub_cat']; $sql = "SELECT * FROM image_gallery WHERE `sub_folder`='{$car}' ORDER BY RAND() LIMIT 1"; $reslt = mysql_query($sql) or die ("Error:" . mysql_error()); $rw = mysql_fetch_assoc($reslt); $i = 0; ?> <table align="center"><tr> <?php while ($row = mysql_fetch_assoc($result)) { if ($i == 4) { $i = 0; // reset variable echo "<tr>"; // break the line } ?><td><font style="font-size:large"><b><?php echo $car; ?></b></font><br><a href="?image_subcat=<?php echo $row['sub_cat']; ?>"><img width="150px" src="<?php echo $rw['image_link']; ?>"></a></td><td> </td> <?php $i++; // increase $i each time through the loop } ?> </td></tr></table> <?php if (mysql_num_rows($result) < 1) { echo "No Images Yet. <br>Keep Checking Backs<br>"; } require_once 'footer.php'; exit(); } ///////////////////////////////////////////////////////////// //No ID passed to page, display user list: $query = "SELECT catergory,image_link FROM `image_catergory` ORDER BY catergory ASC"; $result = mysql_query($query) or die("Error:" . mysql_error()); $sql = "SELECT * FROM image_gallery WHERE `folder_name`='{$cate}' ORDER BY RAND() LIMIT 1"; $reslt = mysql_query($sql) or die ("Error:" . mysql_error()); $rw = mysql_fetch_assoc($reslt); $cate = $row['catergory']; $i = 0; ?> <table align="center"><tr> <?php while ($row = mysql_fetch_assoc($result)) { if ($i == 4) { $i = 0; // reset variable echo "<tr>"; // break the line } ?><td><a href="?image_cat=<?php echo $row['catergory']; ?>"><font style="font-size:large" color="#000000"><b><?php echo $row['catergory']; ?></b></font><br><img width="150px" src="<?php echo $row['image_link']; ?>"></a></td><td> </td> <?php $i++; // increase $i each time through the loop } ?> </td></tr></table> <?php if (mysql_num_rows($result) < 1) { echo "No Images Yet. <br>Keep Checking Back<br>"; } if($_SESSION['log_in'] == true) { ?> <a href="http://chrisdavies.awardspace.com/add_catagories.php">Add Images</a><br> <a href="http://chrisdavies.awardspace.com/upload.php">Add Categorys</a> <?php } require_once 'footer.php'; ?>
  18. alrite, with lots of debugging. I have found that my while loop is not working. this is the code for it <?php if(isset($_GET['image_cat'])) { $cater = $_GET['image_cat']; $query = "SELECT sub_cat FROM `sub_cat` WHERE `parent_cat` = '{$cater}'"; $result = mysql_query($query) or die("Error:" . mysql_error()); $r = mysql_fetch_assoc($result); $car = $r['sub_cat']; $sql = "SELECT * FROM image_gallery WHERE `sub_folder`='{$car}' ORDER BY RAND() LIMIT 1"; $reslt = mysql_query($sql) or die ("Error:" . mysql_error()); $rw = mysql_fetch_assoc($reslt); $i = 0; echo "<br>"; echo "image link=".$rw['image_link']; echo "<br>"; echo "sub cat=".$r['sub_cat']." and ".$car; echo "<br>"; echo "get=".$cater; ?> <table align="center"><tr> <?php while ($row = mysql_fetch_assoc($result)) { if ($i == 4) { $i = 0; // reset variable echo "<tr>"; // break the line } ?><td><font style="font-size:large"><b><?php echo $row['sub_cat']; ?></b></font><br><a href="?image_subcat=<?php echo $row['sub_cat']; ?>"><img width="150px" src="<?php echo $rw['image_link']; ?>"></a></td><td> </td> <?php $i++; // increase $i each time through the loop echo "<br>"; echo "image link=".$rw['image_link']; echo "<br>"; echo "sub cat=".$r['sub_cat']." and ".$car; echo "<br>"; echo "get=".$cater; } ?> </td></tr></table> any ideas why, and any ideas on how to fix it?
  19. try echoing the username and password out, to make sure they are being read
  20. this is a bit more of the code <?php if(isset($_GET['image_cat'])) { $cater = $_GET['image_cat']; $query = "SELECT sub_cat FROM `sub_cat` WHERE `parent_cat` = '{$cater}'"; $result = mysql_query($query) or die("Error:" . mysql_error()); $sql = "SELECT * FROM image_gallery WHERE `sub_folder`='{$cat}' ORDER BY RAND() LIMIT 1"; $reslt = mysql_query($sql) or die ("Error:" . mysql_error()); $rw = mysql_fetch_assoc($reslt); $cat = $row['catergory']; $i = 0; echo "catergory=".$cat; echo "<br>"; echo "image link=".$rw['image_link']; echo "<br>"; echo "sub cat=".$row['sub_cat']; echo "<br>"; echo "get=".$cater; ?> <table align="center"><tr> <?php while ($row = mysql_fetch_assoc($result)) { if ($i == 4) { $i = 0; // reset variable echo "<tr>"; // break the line } ?><td><font style="font-size:large"><b><?php echo $row['sub_cat'] ?></b></font><br><a href="?image_subcat=<?php echo $row['sub_cat']; ?>"><img width="150px" src="<?php echo $rw['image_link']; ?>"></a></td><td> </td> <?php $i++; // increase $i each time through the loop } ?> </td></tr></table>
  21. when i tried to log in,without a username i got a white screen, they may be something wrong with the form?
  22. ok, thanks , i changed that now, now this is what is now being echoed catergory= image link= sub cat= get=test can anyone see why it is not finding the data i need this is the code that should find it <?php if(isset($_GET['image_cat'])) { $cater = $_GET['image_cat']; $query = "SELECT sub_cat FROM `sub_cat` WHERE `parent_cat` = '{$cater}'"; $result = mysql_query($query) or die("Error:" . mysql_error()); $sql = "SELECT * FROM image_gallery WHERE `sub_folder`='{$cat}' ORDER BY RAND() LIMIT 1"; $reslt = mysql_query($sql) or die ("Error:" . mysql_error()); $rw = mysql_fetch_assoc($reslt); $cat = $row['catergory']; $i = 0; echo "catergory=".$cat; echo "<br>"; echo "image link=".$rw['image_link']; echo "<br>"; echo "sub cat=".$row['sub_cat']; echo "<br>"; echo "get=".$cater; ?>
  23. with part of my code if(isset($_GET['image_cat'])) // If the URL ends in ?image_cat do everything in the brakets { $i = $_GET['image_cat']; echo "get=".$i; this shows 0 not what it should why is this , the url ending is ?image_cat=test anyone. here is my complete code <?php if(isset($_GET['image_cat'])) // If the URL ends in ?image_cat do everything in the brakets { $i = $_GET['image_cat']; $query = "SELECT sub_cat FROM `sub_cat` WHERE `parent_cat` = '{$i}'"; $result = mysql_query($query) or die("Error:" . mysql_error()); $sql = "SELECT * FROM image_gallery WHERE `sub_folder`='{$cat}' ORDER BY RAND() LIMIT 1"; $reslt = mysql_query($sql) or die ("Error:" . mysql_error()); $rw = mysql_fetch_assoc($reslt); $cat = $row['catergory']; $i = 0; echo "catergory=".$cat; echo "image link=".$rw['image_link']; echo "sub cat=".$row['sub_cat']; echo "get=".$i; ?> <table align="center"><tr> <?php while ($row = mysql_fetch_assoc($result)) { if ($i == 4) { $i = 0; // reset variable echo "<tr>"; // break the line } ?><td><font style="font-size:large"><b><?php echo $row['sub_cat'] ?></b></font><br><a href="?image_subcat=<?php echo $row['sub_cat']; ?>"><img width="150px" src="<?php echo $rw['image_link']; ?>"></a></td><td> </td> <?php $i++; // increase $i each time through the loop } ?> </td></tr></table> <?php if (mysql_num_rows($result) < 1) { echo "No Images Yet. <br>Keep Checking Backs<br>"; } require_once 'footer.php'; exit(); } ?>
  24. should be ,and change the header to a complete address like header("Location:http://".$_SERVER['HTTP_HOST']."/info.php")
×
×
  • 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.