L96A1 Posted November 19, 2010 Posted November 19, 2010 i just edited and updated jail user.php so here it is You're unable to view this code. Viewing code within this forum requires registration, you can register here for free. rate please Quote
Jordan Palmer Posted November 20, 2010 Posted November 20, 2010 While I see where you was going with this I simply recoded the file, Now you can see what over the top is xD There was no errors when I did a quick test however my version of MCCodes is highly edited and restructured so there may be errors, however i'll happily fix :) You're unable to view this code. Viewing code within this forum requires registration, you can register here for free. meh. was bored so thought I'd help Quote
Blade Maker Posted November 20, 2010 Posted November 20, 2010 I liked the first version better...don't ask why. Quote
Jordan Palmer Posted November 20, 2010 Posted November 20, 2010 This isn't a competition, I was bored noticed that things could be slightly improved so went ahead and did what I thought could be improved. Not saying my version is better at all :) Quote
L96A1 Posted November 20, 2010 Author Posted November 20, 2010 i only started coding yesterday :( Quote
Equinox Posted November 20, 2010 Posted November 20, 2010 Jordan, why do you escape 'user' twice? You establish it's a number with ctype_digit() And you don't need to end the page when using else, I also don't get why in some instances you force echo to be a function and others you don't ? Also, on your INSERT $userid will insert as "$userid" - not a number as you haven't defined it. This will happen when using single quotes, you can get away with it using double quotes because it looks for a variable Otherwise, nice. Quote
Blade Maker Posted November 20, 2010 Posted November 20, 2010 i only started coding yesterday :( Bud I am sorry, when I said I liked the first version better I honestly meant your version, I guess you got mixed up with the words, but yeah I liked yours. Quote
joshuawdams Posted November 20, 2010 Posted November 20, 2010 While it's a good effort, the First Version is unsecure. A malicious staff member could do some damage to your database with a few simple key strokes ;) Good Effort though! Quote
Djkanna Posted November 20, 2010 Posted November 20, 2010 You're unable to view this code. Viewing code within this forum requires registration, you can register here for free. Quote
Equinox Posted November 20, 2010 Posted November 20, 2010 Again with the Exceptions, Djkanna XD Maybe you should explain what they do, not everyone will know what the try/catch method is. I'd much prefer to use Djkanna's version :P Quote
Djkanna Posted November 20, 2010 Posted November 20, 2010 Um this may help people understand it a little better (manual) Here The exceptions class isn't exactly suitable in this situation I would much prefer to use an actual error class however as it's a built-in class therefore available to everyone so I didn't think it would do much damage to use it like this in this example. Thanks Equinox in my opinion it's much clearer and cleaner this way. Quote
Jordan Palmer Posted November 20, 2010 Posted November 20, 2010 @Equinox my version was only to give a general idea, It was early in the morning and basically i couldn't be arsed, I have a habbit of using abs(intval( because i rarely use the ctype_digit on my project due to having a function that handles that, so i started off then realised i could actually use that, so yeh lol djk great job :) Quote
Equinox Posted November 20, 2010 Posted November 20, 2010 So you have a function that does the same as ctype_digit() and you still use abs(intval()) ? Or you have a function that does part of what ctype_digit() does and doesn't check it's completely a number so you need abs(intval()) aswell? Seems a bit pointless to me :/ Quote
Jordan Palmer Posted November 20, 2010 Posted November 20, 2010 I have a function that does the same as ctype_digit, however i could not use that in the script so I started of by using abs(intval then decided to use the ctype_digit() function but basically couldn't be bothered moving the abs/intval Quote
Equinox Posted November 20, 2010 Posted November 20, 2010 Why do you have a function that does the same as ctype_digit() surely you can't of altered it to be more flexible than ctype_digit() as it's only verifying a number ? Quote
Jordan Palmer Posted November 20, 2010 Posted November 20, 2010 It does the exact same however I like things to make functions so I only have to do blah() and it's controlled via one file. makes much more sense to me Quote
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.