DizzyBone&Amy Posted July 21, 2010 Share Posted July 21, 2010 Ok, so i thought i might help out a little bit with some security techniques. If you have any questions or concerns or want to thank me feel free to reply. Otherwise, don't bother. So, for our first technique, its pretty simple. Say we want to make sure a variable (in this case $var) is a positive number. We would do the following.... <?php $var = 1; // Will Turn out true $var2 = -1; // False $var2 = abs((int) $var2); // Will return false and will be turned into positive ( i believe, feel free to tell me otherwise ) ?> Quote Link to comment Share on other sites More sharing options...
Dominion Posted July 21, 2010 Share Posted July 21, 2010 Ok, so i thought i might help out a little bit with some security techniques. If you have any questions or concerns or want to thank me feel free to reply. Otherwise, don't bother. So, for our first technique, its pretty simple. Say we want to make sure a variable (in this case $var) is a positive number. We would do the following.... $var = 1; // Will Turn out true $var2 = -1; // False $var2 = abs((int) $var2); // Will return false and will be turned into positive ( i believe, feel free to tell me otherwise ) ?> would not output anything since you did not tell it to (just being picky there) <?php $var = 1; // Will Turn out true echo "$var" ; $var2 = -1; // False echo "$var2" ; $var3 = abs((int) $var2); echo "$var3" ; // Will return false and will be turned into positive ( i believe, feel free to tell me otherwise ) ?> $var1 would show "1" $var2 = "-1" $var3 = 1 all 3 on the same line since i just just echo 3 times not telling it to go on a new line Quote Link to comment Share on other sites More sharing options...
Danny696 Posted July 21, 2010 Share Posted July 21, 2010 insead of doing: echo "$var"; just do echo $var; Quote Link to comment Share on other sites More sharing options...
rulerofzu Posted July 21, 2010 Share Posted July 21, 2010 Is it really really required to go over and over the same stuff? There is already posts about security. Make em sticky and add on to anything missing from there. Quote Link to comment Share on other sites More sharing options...
Jordan Palmer Posted July 21, 2010 Share Posted July 21, 2010 Is it really really required to go over and over the same stuff? There is already posts about security. Make em sticky and add on to anything missing from there. Yeah, It's a forum discussions are bound to take place, I love too see how people do things different to see if I like that way better and why, Sometimes it's better to see everyone else's style too :). MCCodes have so many ''security experts'' I like to see there experted work (: Quote Link to comment Share on other sites More sharing options...
rulerofzu Posted July 22, 2010 Share Posted July 22, 2010 Hence the point of making things sticky. As you can do on forums. :P Quote Link to comment Share on other sites More sharing options...
Haunted Dawg Posted July 22, 2010 Share Posted July 22, 2010 Im not intending to be harsh, or no offence intended here. But why make a fool of yourself when you know squat about security? :( Quote Link to comment Share on other sites More sharing options...
Dominion Posted July 22, 2010 Share Posted July 22, 2010 @danny - i know i don't need the "" should still work O-o @rulerofzu - if its in one topic its one members views that can be seen (new members never seem to read down thats why they post about errors that are fixed on page 2 of the mods) the more ways to do it that are around the better after all we don't all wish to follow one set of rules :) @haunted dawg - its basic no one is making a fool out of anyone posting getting help and learning ita what this fourm is for not just people who wish to pay you to fix things up (not trying to be mean) Quote Link to comment Share on other sites More sharing options...
Jordan Palmer Posted July 22, 2010 Share Posted July 22, 2010 Im not intending to be harsh, or no offence intended here. But why make a fool of yourself when you know squat about security? :( There's only one way too learn, You post what you think is right and get corrected then you learn :) Quote Link to comment Share on other sites More sharing options...
Djkanna Posted July 22, 2010 Share Posted July 22, 2010 Urgh please read Done simple enough said Quote Link to comment Share on other sites More sharing options...
Haunted Dawg Posted July 22, 2010 Share Posted July 22, 2010 @haunted dawg - its basic no one is making a fool out of anyone posting getting help and learning ita what this fourm is for not just people who wish to pay you to fix things up (not trying to be mean) I understand your concept, but my price's are cheap, and no, im not saying come to me. Ask anyone, if they ask me via PM, i'll secure the script they sent me, but now if it become's the hole site, then there is where my cheap price come's in. Now that that is out of the way, but only just yesterday there was a post on also securing number's, which you can see here which contain's the same type of security. Now, would you like it if there is a bunch of thread's from different people all stating how to secure number's, yet, all of them work the same, but just coded different? Why not just post your method in that thread? Then who ever is looking for another way, will simply go look through the thread! Quote Link to comment Share on other sites More sharing options...
Dominion Posted July 22, 2010 Share Posted July 22, 2010 you pointing me to my own thread O-o the hope when i posted that was to help people if there are 100 posts about the same thing it just makes it easy to find nothing wrong with it (in my opinion) as it is posted more people may even start to change it thats what is so good with stuff like this everyone does it in there own little way. what i said was in no way aimed at you i am well aware you are able to create well made pages i have edits of your code running on my site (still only on wamp being tested) Quote Link to comment Share on other sites More sharing options...
Haunted Dawg Posted July 22, 2010 Share Posted July 22, 2010 you pointing me to my own thread O-o the hope when i posted that was to help people if there are 100 posts about the same thing it just makes it easy to find nothing wrong with it (in my opinion) as it is posted more people may even start to change it thats what is so good with stuff like this everyone does it in there own little way. what i said was in no way aimed at you i am well aware you are able to create well made pages i have edits of your code running on my site (still only on wamp being tested) What i was trying to say was that I'd prefer to have your thread which is more detailed, than this one which lack's ALOT. Quote Link to comment Share on other sites More sharing options...
Dominion Posted July 22, 2010 Share Posted July 22, 2010 o ummm i did not read that right then. both seem to lack a lot but to be fair title does say not finished Quote Link to comment 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.