MadnessRed
Members-
Posts
262 -
Joined
-
Last visited
Never
Everything posted by MadnessRed
-
sorry, I can't edit for some reason, anyway it works perfectly now, many thanks.
-
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."
-
* * 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.
-
will joining tables be permanent?
-
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.
-
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.
-
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,
-
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\
-
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.
-
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
-
how are the two files you posted linked?
-
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,
-
$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)
-
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); ?>
-
when a user registers how to i add values to another table?
MadnessRed replied to berry05's topic in Third Party Scripts
$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') ;" -
Can you recommend a good php Gantt charting development?
MadnessRed replied to _giles_'s topic in Other Libraries
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. -
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 }
-
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.
-
[SOLVED] Select rand from an array, but slightly differnt.
MadnessRed replied to MadnessRed's topic in PHP Coding Help
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]; -
ok, thanks
-
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.
-
can't stop the emails
MadnessRed replied to MadnessRed's topic in PHP Installation and Configuration
ok, thanks for the help, -
can't stop the emails
MadnessRed replied to MadnessRed's topic in PHP Installation and Configuration