Altec Posted December 6, 2009 Share Posted December 6, 2009 Hello everyone, I've never formally introduced myself, and what with this new style and all I figured I'd take the opportunity and say hello. I've been a forum stalker for a while now and have only posted when my other communities draw a blank. First, my name is Steven. I'm a 16 year old self-taught web developer from Colorado, USA. I have 5 years with (X)HTML and CSS, and almost 5 with PHP. I never really succeed at getting a decent site up and maintaining it, so I generally let my server sit around and do nothing but store random files for me. I've most recently become addicted to MyBB development, and I've been wasting a fair amount of hours developing plugins and other random stuff for it. I have OCD and will probably rewrite your code if you have horrendous code practices, even if I have nothing to contribute. I'm a pretty big Grammar Nazi as well. I hope I'll fit in somewhere here. With all due respect, Steven Quote Link to comment https://forums.phpfreaks.com/topic/184140-never-formally-introduced-myself/ Share on other sites More sharing options...
PugJr Posted December 6, 2009 Share Posted December 6, 2009 PHP at 11 huh? Something tells me this was more along of declaring variables and adding them together type PHP? Aka, you didn't really know what you were doing? My compliments if you understood what you were doing at 11 though. I know I never would have been able to. Quote Link to comment https://forums.phpfreaks.com/topic/184140-never-formally-introduced-myself/#findComment-972257 Share on other sites More sharing options...
Daniel0 Posted December 6, 2009 Share Posted December 6, 2009 I have OCD and will probably rewrite your code if you have horrendous code practices, even if I have nothing to contribute. Ha... you better watch out now. I'll hunt your topics with comments on your code style and quality Anyways, welcome Quote Link to comment https://forums.phpfreaks.com/topic/184140-never-formally-introduced-myself/#findComment-972381 Share on other sites More sharing options...
Altec Posted December 6, 2009 Author Share Posted December 6, 2009 PHP at 11 huh? Something tells me this was more along of declaring variables and adding them together type PHP? Aka, you didn't really know what you were doing? My compliments if you understood what you were doing at 11 though. I know I never would have been able to. haha, from what I remember it wasn't anything special; just experimentation. I'll hit up the archives of the forum I was on at that time and see if I can find what the hell I was doing. Ha... you better watch out now. I'll hunt your topics with comments on your code style and quality Anyways, welcome haha, I'll be sure to tailor my practices just for you. Thanks everyone! Quote Link to comment https://forums.phpfreaks.com/topic/184140-never-formally-introduced-myself/#findComment-972425 Share on other sites More sharing options...
nrg_alpha Posted December 6, 2009 Share Posted December 6, 2009 Welcome to the phpfreaks, grammer nazi, Altec Glad to see some people who are not lazy in writing and actually care about how they present themselves. Granted, by divulging that you have OCD and will rewrite poor code, you've done two things; a) run the risk of driving yourself nuts as there is plenty of poor code to go around, and b) in essence painted a large target on your back for those who are knowledgeable enough in good coding practices and have read this thread. Something tells me you'll be watched more closely now (as Dan mentioned). No pressure. lol In any case, I'm sure you'll fit in nicely here. Cheers Quote Link to comment https://forums.phpfreaks.com/topic/184140-never-formally-introduced-myself/#findComment-972450 Share on other sites More sharing options...
Altec Posted December 8, 2009 Author Share Posted December 8, 2009 Welcome to the phpfreaks, grammer nazi, Altec Glad to see some people who are not lazy in writing and actually care about how they present themselves. Granted, by divulging that you have OCD and will rewrite poor code, you've done two things; a) run the risk of driving yourself nuts as there is plenty of poor code to go around, and b) in essence painted a large target on your back for those who are knowledgeable enough in good coding practices and have read this thread. Something tells me you'll be watched more closely now (as Dan mentioned). No pressure. lol In any case, I'm sure you'll fit in nicely here. Cheers Thanks. I hope people don't kill me too much. Quote Link to comment https://forums.phpfreaks.com/topic/184140-never-formally-introduced-myself/#findComment-973223 Share on other sites More sharing options...
448191 Posted December 9, 2009 Share Posted December 9, 2009 Whoaoohahahaha (or whatever an evil laugh looks like in writing)... Anyway, I assume you know die() for error handling is frowned upon? I'm really at a loss as to why this is happening. Here is my code: <?php mysql_connect('localhost','user','pass') or die('Error connecting to database: '.mysql_error()); mysql_select_db('database') or die('Error selecting database: '.mysql_error()); if(isset($_POST['submit']) && $_SERVER['REQUEST_METHOD'] == "POST") { $ipcheck = "SELECT `ip` FROM `iplog`"; $ips = mysql_fetch_array(mysql_query($ipcheck)); foreach($ips as $ip) { if(stristr($ip,$_SERVER['REMOTE_ADDR'])) { die('You have already signed.'); } } function clean($string) { $string = trim(stripslashes(strip_tags($string))); return $string; } foreach($_POST as $key => $value) { $data[$key] = clean($value); } if(empty($data['name'])) { die('Name is a required field.'); } if(empty($data['comments'])) { $data['comments'] = 'No comment.'; } $namecheck = "SELECT `name` FROM `signatures`"; $namelist = mysql_fetch_array(mysql_query($namecheck)); foreach($namelist as $names) { if(stristr($names,$data['name'])) { die('You have already signed.'); } } $data['ip'] = $_SERVER['REMOTE_ADDR']; $data['timestamp'] = time(); $data['name'] = mysql_real_escape_string($data['name']); $data['comments'] = mysql_real_escape_string($data['comments']); $ipquery = "INSERT INTO `iplog` (name,ip,timestamp) VALUES ('{$data['name']}','{$data['ip']}','{$data['timestamp']}')"; mysql_query($ipquery) or die('Error inserting IP into log: '.mysql_error()); $query = "INSERT INTO `signatures` (name,comments,timestamp) VALUES ('{$data['name']}','{$data['comments']}','{$data['timestamp']}')"; mysql_query($query) or die('Error inserting signature: '.mysql_error()); header("Location: http://www.tf2petition.phreakyourgeek.com/index.php?show=1"); } ?> As you can see from 487 and the following signatures, something is wrong: www.tf2petition.phreakyourgeek.com/index.php?page=7 I should probably get this fixed as traffic is incredibly high right now, but I don't see a loophole or a bug that would cause someone to be able to post four times. Database structure for the iplog table is: www.media.phreakyourgeek.com/db_structure.png I count 7 of them. But, without having seen any code from MyBB, I imagine it is a big fat mess as well. Quote Link to comment https://forums.phpfreaks.com/topic/184140-never-formally-introduced-myself/#findComment-974136 Share on other sites More sharing options...
Altec Posted December 12, 2009 Author Share Posted December 12, 2009 Whoaoohahahaha (or whatever an evil laugh looks like in writing)... Anyway, I assume you know die() for error handling is frowned upon? I count 7 of them. But, without having seen any code from MyBB, I imagine it is a big fat mess as well. Actually, I started MyBB development a while after that post and the development standards drastically changed my personal style. The actual MyBB code is actually pretty clean, although a majority of it goes against their own development standards. Quote Link to comment https://forums.phpfreaks.com/topic/184140-never-formally-introduced-myself/#findComment-975904 Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.