Jump to content
MakeWebGames

runthis

Members
  • Posts

    309
  • Joined

  • Last visited

Everything posted by runthis

  1. I can assist in moderation of the community and/or forum. My msn/email is [email protected]
  2. Recently i wanted the same thing and found a class that takes care of all of this. To use the class simply use   sanitizeOne($var, $type);   Examples: sanitizeOne($_POST['string'], "plain");   sanitizeOne($_GET['numbers'], "int");   Here is the actual code with creators credit.   <?php /* Sanitize class Copyright (C) 2007 CodeAssembly.com This program is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with this program. If not, see http://www.gnu.org/licenses/ */ /** * Sanitize only one variable . * Returns the variable sanitized according to the desired type or true/false * for certain data types if the variable does not correspond to the given data type. * * NOTE: True/False is returned only for telephone, pin, id_card data types * * @param mixed The variable itself * @param string A string containing the desired variable type * @return The sanitized variable or true/false */ function sanitizeOne($var, $type) { switch ( $type ) { case 'int': // integer $var = (int) $var; break; case 'str': // trim string $var = trim ( $var ); break; case 'nohtml': // trim string, no HTML allowed $var = htmlentities ( trim ( $var ), ENT_QUOTES ); break; case 'plain': // trim string, no HTML allowed, plain text $var = htmlentities ( trim ( $var ) , ENT_NOQUOTES ) ; break; case 'upper_word': // trim string, upper case words $var = ucwords ( strtolower ( trim ( $var ) ) ); break; case 'ucfirst': // trim string, upper case first word $var = ucfirst ( strtolower ( trim ( $var ) ) ); break; case 'lower': // trim string, lower case words $var = strtolower ( trim ( $var ) ); break; case 'urle': // trim string, url encoded $var = urlencode ( trim ( $var ) ); break; case 'trim_urle': // trim string, url decoded $var = urldecode ( trim ( $var ) ); break; case 'telephone': // True/False for a telephone number $size = strlen ($var) ; for ($x=0;$x<$size;$x++) { if ( ! ( ( ctype_digit($var[$x] ) || ($var[$x]=='+') || ($var[$x]=='*') || ($var[$x]=='p')) ) ) { return false; } } return true; break; case 'pin': // True/False for a PIN if ( (strlen($var) != 13) || (ctype_digit($var)!=true) ) { return false; } return true; break; case 'id_card': // True/False for an ID CARD if ( (ctype_alpha( substr( $var , 0 , 2) ) != true ) || (ctype_digit( substr( $var , 2 , 6) ) != true ) || ( strlen($var) != 8)) { return false; } return true; break; case 'sql': // True/False if the given string is SQL injection safe // insert code here, I usually use ADODB -> qstr() but depending on your needs you can use mysql_real_escape(); return mysql_real_escape_string($var); break; } return $var; } /** * Sanitize an array. * * sanitize($_POST, array('id'=>'int', 'name' => 'str')); * sanitize($customArray, array('id'=>'int', 'name' => 'str')); * * @param array $data * @param array $whatToKeep */ function sanitize( &$data, $whatToKeep ) { $data = array_intersect_key( $data, $whatToKeep ); foreach ($data as $key => $value) { $data[$key] = sanitizeOne( $data[$key] , $whatToKeep[$key] ); } } ?>   With this code you can also use some of the functions people seem to forget about, like ucwords.
  3. This doesnt work, i used this for a plus one i created to test and google alreadyfound me out and took away all the plus ones. Not worth losing googles trust probably
  4. runthis

    Wow

    Sorry Dominion, it was late night and this community has been good to me, haha reading it again it seems rather harsh.
  5. Thanks, i intend to kick it off with a few scripts and tips, hopefully it can build.
  6. Its a stolen copy
  7. runthis

    Wow

    Although several peoples rating on this forum is "Beginner", yours is shown for an entirely different reason. Edit: Look at his recent posts, this guy is balls deep in mccodes and cannot solve the most minuscule of problems, WHY ARE YOU TRYING TO RUN A GAME? You obviously cant provide any updates, additions, upgrades, addons, plugins whatever you want to call it so what is the point? How far do you intend a game script that is passed around [bad joke went here(ish) so much to take you with no programming knowledge of your own? Get a clue! Here i got an idea, go buy a car and when it runs out of gas or needs an oil change, take it back to the dealership and tell them its a piece of ****. Edit2: i see your profile says "0 Friends Zerk has not made any friends yet", wonder why Fuck it, Edit3: You are the genius who bought a game script that is old and outdated, from where i am sitting, your sir, are dumb. Of course a newer website that is not a standalone game script from 2006 or older is not going to have the features of a constantly updated game development website from 2011. Since your just making random purchases without research or investigation i am sure there are plenty of people here that will take your pocketbook ... good luck kid, try not to lose your shirt when you go out into the real world. Also considering by your posts you have no programming knowledge at all, your work will always be someone else's, never have originality and your games will never be updated, ew. just give up now, why waste your time? We don't want you here, programming is for certain people and you are not one of them, bugger off back to your games(yes I changed it. - Dominion) and let the big kids talk, thanks shirley. PS: your quote [Edited out - Dominion] Also according to one of your previous posts you bought mccodes from mccodes.com and it did not have instructions or installer.php. Sir we are no stupid here, you stole/copied/downloaded mccodes from somebody/somewhere else and now this community is to blame for your copyright infringed script where the previous owner already deleted the installer, setup info and made their own (probably horrible) edits to it. The script is not flawed, you are :/ If i was you i wouldn't even publish your game for 2 more reasons, because of your actions here you lose out on a huge amount of your clientèle, and two, i will personally attempt to confirm the legality of your license with McCodes developers. Go play on your mafiagame making website, its perfect for kiddies like you.
  8. I cant wait for the responses to the above post
  9. Neat website. Might i also offer http://www.captcha.net
  10. if the only thing you want is what is called "ajax" nowadays i am assuming you just want to call a page to a div, or maybe you want to post. Jquery is not needed for such an issue, as if you just want ajax that is a simple few lines code. However, if you are looking for effects like shrink, or blink (although i can show you how to to do these without) it is recommended by most to use a framework considering that the dial-up age is dead. Here is a script that will call your ajax into an "id" of your choice   function replace(id,file){ var xmlhttp; if(window.XMLHttpRequest){ xmlhttp=new XMLHttpRequest() }else{ xmlhttp=new ActiveXObject("Microsoft.XMLHTTP") } xmlhttp.onreadystatechange=function(){ if(xmlhttp.readyState==4&&xmlhttp.status==200){ document.getElementById(id).innerHTML = xmlhttp.responseText; } } xmlhttp.open("GET",file,true); xmlhttp.send(); }   You will place this in the head section of your document you intend to use it on, or in the .js file you include in your header. This is called in your page simply like this   <a onclick="replace("idTolLoadTo","fileToLoad.php")">Click Me</a>   What this will do is it will load whatever the content from "fileToLoad.php" into the element that has an id of "idTolLoadTo" Now your probably thinking, this is too hard, but.. whether you are using a function or framework, there is no easy answer. Google these frameworks (when you have a question, ask me on here or google that question) "prototype", "jquery","scriptaculous(based on prototype)" and find one that is most easiest for you.
  11. I would like to make a request for a new Forum Board for Javascript rather than "Other". I would be happy to moderate this board and i would initially write several topics on javascript techniques with example scripts to take. As javascript is my favorite language i would take the burden/responsibility on performing the action/duties needed for this new Board to bring in new visitors, and possible sign-ups. I know this forum is already large and i think thats why we have more visitors than users logged in, but this is an opportunity to tap into a resource not yet seen in your common McCodes game. I can teach and more importantly learn along the way. Sincerely, Jesse
  12. If you log into Google Webmaster tools they explain that it does not imporve your search results on google, but rather gives other people an idea of how much they liked your site. Its kinda cheating
  13. Neat, if this becomes too popular, google might change their setup involving +1's
  14. runthis

    Security

    :) i think we settled already dominion
  15. I like it. My favorite part is it isn't mafia styled.
  16. I appreciate your honesty and candor. So far it is pretty customizable in the game, even down to the font-size. Also while testing it on my Samsung Exhibit it looks .... so great.
  17. http://pure-game.blogspot.com/ As a few of you may already know i have been working on this multiplayer online hacking game 2011 2012 and i must say things are progressing very nicely. Someone had an idea recently, they said i should instead make an online hacking game engine/script. What do you think? The screenshots: http://pure-game.blogspot.com/2011/07/some-screenshots.html
  18. Hey Admin Cw in a new name, try this Removed so to not confuse with working post
  19. Danny. Although this might not be the best place to ask for help on a free game for obvious reasons. There are programmers out there who just want to build up the portfolio and would work for free just to do that. It is not so far fetched that he wants a partner. Back in the day i would have jumped in, programmed it and added the screenshot to my portfolio.
  20. The header was not made by you, see mafiacorruption.com
  21. If your looking to tickle your nickel, I could probably use some missions for this hacking game i am developing. Some screenshots and info at http://pure-game.blogspot.com/ and my msn is [email protected]
  22. And that someone isme. Switching over to mysqli on your current projects will probably be a hassle. However in the creation of new projects, you might consider giving it a look see. It seems as its simply classes instead of direct. http://www.php.net/manual/en/mysqli.query.php Also i wouldnt be too concerned for this reason. Your webhost when the time comes, will probably let you choose which one you want to use, if you host yourself, you know what you want, and if you host on a free server ... Start learning one of the many more db services out there, theres over 20 http://www.php.net/manual/en/refs.database.php
  23. Maybe someone could offer a quick look, or example of mysqli in action
  24. Looks Nice, name suggestion : use the first letter of each of the words from your slogan, 'tuar' <- you can keep it
×
×
  • Create New...