Jump to content

MadnessRed

Members
  • Posts

    262
  • Joined

  • Last visited

    Never

Everything posted by MadnessRed

  1. sorry, I can't edit for some reason, anyway it works perfectly now, many thanks.
  2. so what I want is "SELECT * FROM {{table}}statpoints LEFT JOIN {{table}}users ON {{table}}statpoints.id = {{table}}users.id WHERE `{{table}}statpoints.stat_type` = '1' AND `{{table}}statpoints.stat_code` = '1' AND `{{table}}users.bana` <> '1' ORDER BY `{{table}}statpoints.". $Order ."` DESC LIMIT ". $start .",100;" however when I try that I get edit: found the bug in that it was the "evo1_statpoints."
  3. * * Network Timeout The server at www.devshed.com is taking too long to respond. * What should you do now? The requested site did not respond to a connection request and the browser has stopped waiting for a reply. * Could the server be experiencing high demand or a temporary outage? Try again later. * Are you unable to browse other sites? Check the computer's network connection. * Is your computer or network protected by a firewall or proxy? Incorrect settings can interfere with Web browsing. * Still having trouble? Consult your network administrator or Internet provider for assistance.
  4. I have a table of peoples statistics, and I want to show a table with the stats of everyone who is not banned. Actually I think if found a better way of doing it, as I am already calling the user table to get the username, I may as well get the banned data from that and just end the while loop there if they are banned.
  5. ok, so how to I go up a level if that makes sence? "SELECT * FROM `{{table}}statpoints` WHERE `stat_type` = '1' AND `stat_code` = '1' AND (SELECT `bana` FROM `{{table}}users` WHERE `id` = `^id`) <> '1' ORDER BY `". $Order ."` DESC LIMIT ". $start .",100;" ^id <= Should be the `id` from the main query, not the sub query.
  6. is it possible to excute a command like SELECT * FROM `table1` WHERE `id` = (SELECT `id` FROM `table2` WHERE `banned` = '0') ; rather than having to execute the first command then do an if statement on the second,
  7. sorry that was wrong ../ means directory above ./ means this directory. the ttf and image should both be in same directory as the php file so C:\wamp\www\captcha\
  8. php ian thats exatcly what I want my page has a template engine, so what I did was rather than "echo $page;" I did echo sortlink($page); I then in sortlinks did an ireplace to change "./?page=" to "./?session=".$_GET['session']."&page=" and now it works perfectly.
  9. basically what I would like, is to be able to open testpage.php, that then say sets $_SESSTION['time'] to time. Then i open teh same page in a new tab, and set a $_SESSION['time'] to the current time there. Then those two sessions on pages on different tabs can work together. So I can have the same session loaded twice if that makes sence. atm I am trying to do a regex replace on all links and to put a get variable onto all pages to see if that works but and easier way would be better.
  10. HI, I have online game, it works fine, however you cant log in more to more than 2 sections at once, (which is needed). Is there a way to store user data without sessions or cookies, i just want to store 1 integer <100, which will tell the game what section the user is in. Is there a way to ad a $_GET to every link without doing it manually. Or can you have to SESSIONS runnign at once? I hope I am making sense Anthony
  11. how are the two files you posted linked?
  12. ok, have you installed to script no your server yet?? if so are you getting any errors? if so what? if not then what is displayed no the site,
  13. $query = mysql_query($sql); try replacing with $query = mysql_query($sql) or die(mysql_error()); Then that gives us a reason for it to fail (sometimes)
  14. I think i have the script for you, 1 sec... <?php $file = $_GET['source']; list($width,$height)=getimagesize($file); $type = exif_imagetype($file); //Types /* 1 IMAGETYPE_GIF 2 IMAGETYPE_JPEG 3 IMAGETYPE_PNG 4 IMAGETYPE_SWF 5 IMAGETYPE_PSD 6 IMAGETYPE_BMP 7 IMAGETYPE_TIFF_II (intel byte order) 8 IMAGETYPE_TIFF_MM (motorola byte order) 9 IMAGETYPE_JPC 10 IMAGETYPE_JP2 11 IMAGETYPE_JPX 12 IMAGETYPE_JB2 13 IMAGETYPE_SWC 14 IMAGETYPE_IFF 15 IMAGETYPE_WBMP 16 IMAGETYPE_XBM */ if($type == 2){ $src = imagecreatefromjpeg($file); }elseif($type == 3){ $src = imagecreatefrompng($file); }elseif($type == 1){ $src = imagecreatefromgif($file); }else{ die("Unsupported file type (".$type.")"); } if($width > $height){ $newwidth=200; $newheight=($height/$width)*$newwidth; }else{ $newheight=200; $newwidth=($width/$height)*$newheight; } $tmp=imagecreatetruecolor($newwidth,$newheight); imagecopyresampled($tmp,$src,0,0,0,0,$newwidth,$newheight,$width,$height); header("Content-type: image/jpeg"); imagejpeg($tmp, NULL,100); imagedestroy($src); imagedestroy($tmp); ?>
  15. $q = "INSERT INTO `user_stats` (`gold`) VALUES ('100') ;"; mysql_query($q) or die(mysql_error()); Though that code doesn't look right, surely you want something like "INSERT INTO `user_stats` (`user_id`,`gold`) VALUES ('".$id."','100') ;"
  16. I don't know of any that already exist, though i don't see how hard it would be to make. please post the kind of things you want it to do, then can see what you are looking at. personally I can see 2 possobilities, having generated via php or useing the imaging side of php.
  17. you could do that, set an array up $cats = array( '1+1=' = > '2', 'The day after Tuesday us' = > 'Wednesday', 'Another question' => 'Another Answer'); Then just do if($_POST['cat_ans'] == $cats[$_POST['cat_qu']]){ some code }
  18. if you want to build your own it is very simple. 1) Create a random string. $string = mt_rand(0,9).mt_rand(0,9).mt_rand(0,9).mt_rand(0,9); 2) Declare that string in a session. $_SESSION['captcha'] = $string; 3) Use GD to create a catchpa img. // Create an image bg of captcha.png $im = ImageCreateFromPNG('captcha.png'); //Define black $black = imagecolorallocate($im, 0, 0, 0); // Path to our font file $font = './arial.ttf'; // Write it imagettftext($im, 10, 0, 0, 10, $black, $font, $_SESSION['captcha']); // Output to browser header('Content-type: image/png'); imagepng($im); imagedestroy($im); requires you to have arial.ttf and catchpa.png in the same folder.
  19. the thing is I dont want the a,b,c bit, i want the 1,2,3 bit. Also the array is in a specific order, so I can't shuffle. But I think I got any idea. $array = array( 1 => array(1,'a'), 2 => array(2,'b'), 3 => array(3,'c)', 4 => array(4,'d)', 6 => array(6,'e')); $temp = array_rand($array) $id=$temp[0];
  20. What i want is to do is pick a random value from an array. eg $aray = array( 1 => 'a', 2 => 'b', 3 => 'c', 4 => 'd', 6 => 'e'); I want it to pick a number out of 1,2,3,4,6 (but not 5) and then to return that number and nothing else. Any idea how I would got about doing that.
  21. Hi I was wondering if there was already a function that did this. For example, Say I have 3 items, 1,2 and 3, and I had an array saying how much of each I had eg. $items = array(1 => 75, 2 => 25, 3 => 0); Then it would pick and random item, so there would be a 75% chance if picking item 1, 25% of picking an item 2 and % chance of picking an item 3. I was wondering if there already was a function for this. if not I can make one myself easy enough.
×
×
  • 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.