Jump to content
MakeWebGames

[Not Finished] Quick Look into Security


Recommended Posts

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 )
?>
Link to comment
Share on other sites

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

Link to comment
Share on other sites

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 (:

Link to comment
Share on other sites

@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)

Link to comment
Share on other sites

@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!

Link to comment
Share on other sites

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)

Link to comment
Share on other sites

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.

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...