<?xml version="1.0"?>
<rss version="2.0"><channel><title>Tips and tutorials Latest Topics</title><link>https://makewebgames.io/forum/70-tips-and-tutorials/</link><description>Tips and tutorials Latest Topics</description><language>en</language><item><title>fieldset and legend</title><link>https://makewebgames.io/topic/28508-fieldset-and-legend/</link><description><![CDATA[<p>
	Fieldset and Legend have some brilliant uses for your codes they can make a boring Announcement page look amazing
</p>

<p>
	 
</p>

<p>
	as you can see from the before and after it makes quite a nice effect
</p>

<p><a href="https://makewebgames.io/uploads/monthly_2022_09/before.JPG.637f18b0ac017967f7e0d9c7b3aa0faf.JPG" class="ipsAttachLink ipsAttachLink_image" ><img data-fileid="4692" src="https://makewebgames.io/applications/core/interface/js/spacer.png" data-src="https://makewebgames.io/uploads/monthly_2022_09/before.JPG.637f18b0ac017967f7e0d9c7b3aa0faf.JPG" data-ratio="22.31" width="605" class="ipsImage ipsImage_thumbnailed" alt="before.JPG"></a></p>
<p><a href="https://makewebgames.io/uploads/monthly_2022_09/after.JPG.907c1c4bee3a6f77163b8a1c4e97eea0.JPG" class="ipsAttachLink ipsAttachLink_image" ><img data-fileid="4693" src="https://makewebgames.io/applications/core/interface/js/spacer.png" data-src="https://makewebgames.io/uploads/monthly_2022_09/after.JPG.907c1c4bee3a6f77163b8a1c4e97eea0.JPG" data-ratio="27.57" width="827" class="ipsImage ipsImage_thumbnailed" alt="after.JPG"></a></p>]]></description><guid isPermaLink="false">28508</guid><pubDate>Tue, 13 Sep 2022 18:05:44 +0000</pubDate></item><item><title>Most Asked Questions</title><link>https://makewebgames.io/topic/26913-most-asked-questions/</link><description><![CDATA[
<p>So I'm making this thread to help myself and others find answers to some of the questions I have come across a lot.</p>

<p>
Here are some of the things I have learned.</p>

<p>
Undefined index (action).</p>

<p>
This is located for your "switch" function. In order to call a specific part of the file to run. Depending on the type of action you are calling you could use:</p>

<pre class="ipsCode">$_GET['action'] = isset($_GET['action'])  &amp;&amp; ctype_alpha($_GET['action']) ? $_GET['action'] : null;</pre>
<div></div>

<p>
when the ***.php?action= only uses letters</p>

<p>
You can use</p>

<pre class="ipsCode">$_GET['action'] = isset($_GET['action'])  &amp;&amp; ctype_alnum($_GET['action']) ? $_GET['action'] : null;</pre>
<div></div>

<p>
for when you need to use both letters and number values</p>

<p>
or</p>

<pre class="ipsCode">$_GET['action'] = isset($_GET['action'])  &amp;&amp; ctype_digit($_GET['action']) ? $_GET['action'] : null;</pre>
<div></div>

<p>
For only numbers</p>

<p>
ALOT of undefined functions are found in this line:</p>
<p data-double>&nbsp;</p>
<pre class="ipsCode">global $ir,$c,$userid, $db;</pre>
<div></div>
<p data-double>&nbsp;</p>
<p>
These are queries located in the global files. So if for instance you are trying to call $ir but your global line does not contain $ir you might get a undefined function. Simply by adding $ir to the global line can fix this in most cases. I have found $db and $h are the most common functions left out of the global line. $h is mostly to end a page, while $db is used to define the mysql or mysqli engine. They $c variable is included in a lot of the mods you will find, but basically is no longer used in the most recent version of McCodes.</p>

<p>
Using arrays over a single variable can add a wider range of functionality and choices for your members. They are no longer stuck to only one way, black &amp; white. Now there are grey areas where a member can choose their route over a time way road.</p>

<p>
Code example thanks to [uSER=70347]NonStopCoding[/uSER] </p>
<p data-double>&nbsp;</p>
<pre class="ipsCode">if(in_array($r['itmtype'],array(15,19,33)))
</pre>
<div></div>
<p data-double>&nbsp;</p>
<p>
Adding an item to users inventory, you would use</p>
<pre class="ipsCode"> item_add(*userid*,*itemID*,*quantity*);</pre>
<div></div>

<p>
Removing an item from inventory </p>
<pre class="ipsCode">item_remove(*userid*,*itemID*,*quantity*);</pre>
<div></div>

<p>
Sending an event</p>
<pre class="ipsCode">event_add(*userid*,*message*);</pre>
<div></div>
<p data-double>&nbsp;</p>
<p>
Restrictions based on time - thanks to [uSER=70574]TheMasterGeneral[/uSER]</p>

<pre class="ipsCode">
require('globals.php');
$endtime=140000000;
$starttime=130000000;
$currenttime=time();
if ($endtime &lt; $currenttime)
{
//nope
}
</pre>
<div></div>
<p data-double>&nbsp;</p>
<p>
Delete logs after 24 hours - Thanks to [uSER=70574]TheMasterGeneral[/uSER]</p>

<pre class="ipsCode">$Time=time();
$DeleteTime=$Time-86400; //86400 is 24 hours
$db-&gt;query("DELETE FROM `your_logs_table` WHERE `timestamp` &lt;= {$DeleteTime}");</pre>
<div></div>
<p data-double>&nbsp;</p>

<p>
I'm curious as the what are the most common questions you see asked. As in relation to a new mod install and configuration into McCodes general details. Many mods have questions specific to just themselves. I'd like to keep this as a universal thread so we don't confuse readers with details unrelated to them. (such as myself!, lol)</p>
]]></description><guid isPermaLink="false">26913</guid><pubDate>Sun, 01 May 2016 12:13:09 +0000</pubDate></item><item><title>Pdo</title><link>https://makewebgames.io/topic/26939-pdo/</link><description><![CDATA[<p>Can anyone tell me how to switch my mccodes lite to pdo I started trying and can't figure it out and my site is down :/</p>]]></description><guid isPermaLink="false">26939</guid><pubDate>Mon, 23 May 2016 18:43:23 +0000</pubDate></item><item><title>print, EOF, and echo</title><link>https://makewebgames.io/topic/26905-print-eof-and-echo/</link><description><![CDATA[<p>So I'm just curious what exactly is the difference with these? I've heard echo is faster, but is that all? And does it matter if you use a single quote vs a double quote, or is that again just a speed thing?</p>]]></description><guid isPermaLink="false">26905</guid><pubDate>Mon, 25 Apr 2016 13:00:01 +0000</pubDate></item><item><title>secure it!</title><link>https://makewebgames.io/topic/26880-secure-it/</link><description><![CDATA[
<p>So, for those of you, like me, who are not sure about xss here's the cheat sheet to test your script!</p>

<p>
<a href="https://www.owasp.org/index.php/XSS_Filter_Evasion_Cheat_Sheet" rel="external nofollow">https://www.owasp.org/index.php/XSS_Filter_Evasion_Cheat_Sheet</a></p>

<p>
Click controls to see the filters and security options for them as well.</p>

<p>
And when in doubt just block em out!</p>

<p>
I check my awstats regularly to find out some important info on my visitors. First, the refer. Don't know the refer? google them. if they come off spammy. block that refer (.htaccess if nothing else). Had a recent injection? View your latest visitors to that specific page (assuming you know where the injection came form. Filter through the ips, and whois them. Then decide if you want to cdir or simply block that single ip. And do not forget to block AWS Amazon web service. They are mutterfutters for real! Amazon sells various crawlers (like a search engine crawlers) that basically let someone crawl anonymously as a test drive. </p>

<p>
Amazon full cdir as published by amazon at <a href="http://docs.aws.amazon.com/general/latest/gr/aws-ip-ranges.html" rel="external nofollow">http://docs.aws.amazon.com/general/latest/gr/aws-ip-ranges.html</a></p>
<p data-double>&nbsp;</p>

]]></description><guid isPermaLink="false">26880</guid><pubDate>Fri, 08 Apr 2016 03:33:49 +0000</pubDate></item><item><title>V2.0.5.b Conversion Tutorial</title><link>https://makewebgames.io/topic/25320-v205b-conversion-tutorial/</link><description><![CDATA[
<p>Just wondering if there is a Tutorial to convert v2 to v2.0.5b? There are some mods on here that wont work on the updated version and it would be good to know what to edit to convert to it. I know <span style="color:#333333;">MWG's syntax highlighter inserts strange characters but what else needs to change?</span></p>
<p><span style="color:#333333;"> </span></p>
<p><span style="color:#333333;">
Any thoughts on this would greatly help the community i think?</span></p>
<p><span style="color:#333333;"> </span></p>
<p><span style="color:#333333;">
</span></p>
]]></description><guid isPermaLink="false">25320</guid><pubDate>Sun, 03 May 2015 00:37:09 +0000</pubDate></item><item><title>Mods! - No code iside, do it yourself!</title><link>https://makewebgames.io/topic/24807-mods-no-code-iside-do-it-yourself/</link><description><![CDATA[
<p>I'm not posting the code here. You will have to do it yourself! Learn something ;D</p>

<p>
Okay guys, some basic mods you can do really easy to make your game more fun for your users!</p>

<p>
In gym you should make it possible to gain more stats based on luck!</p>
<p>
How do we do this? Simple!</p>

<p>
add a simple if statment with a rand();</p>

<p>
Why would this be fun for your users? Well maybe they get sick of seenig the same value every time they train?!</p>
<p>
Giving them a chance to get more stats out of luck strives players to train more!</p>

<p>
Jobs!</p>
<p>
The standard jobs in mccodes requires nothing but stats.</p>
<p>
Add something along the lines of active time (in game time)</p>
<p>
say if they want to be a manager at said job, they would have to be active for 4 hours in game a day!</p>

<p>
Energy Refills!</p>
<p>
What if sometimes a player got it for free while doing things in the game?</p>
<p>
Say idk, while mailing someone? they get a free energy refill!</p>
<p>
Simple stuff like this keeps players in the game longer and thus makes a more active game.</p>

<p>
Simple mini games!</p>
<p>
One of the better mini games is tag "your it".</p>
<p>
This wouldn't be hard to set up at all!</p>
<p>
With very minimal coding needed</p>
<p>
no more than 20 lines and you could have a nice little game going on.</p>

<p>
Post some of your idea's below. </p>
<p>
If any of them look really fun i'll help code them up! (nothing too advanced as i suck!)</p>
]]></description><guid isPermaLink="false">24807</guid><pubDate>Thu, 11 Dec 2014 18:15:41 +0000</pubDate></item><item><title>need your help</title><link>https://makewebgames.io/topic/24313-need-your-help/</link><description><![CDATA[
<p>hey...</p>

<p>
Ive been working on a test site recently which will contribute to a game I will be making soon.</p>
<p>
However I don't feel im completely ready and confident with mccodes so I need someone to help me</p>
<p>
Here and there with functions etc. Ive left my Skype below for you all. :)</p>
<p>
Thanks in advance! </p>

<p>
Skype: jamesrage4</p>
]]></description><guid isPermaLink="false">24313</guid><pubDate>Sat, 24 May 2014 20:55:47 +0000</pubDate></item><item><title>cron jobs</title><link>https://makewebgames.io/topic/20819-cron-jobs/</link><description><![CDATA[<p>looking for help setting up my cron jobs, will pay for fast service, offer staff positions and direct you to a game you will LOVE</p>]]></description><guid isPermaLink="false">20819</guid><pubDate>Sun, 05 Feb 2012 03:33:56 +0000</pubDate></item><item><title>Some Good Tips.</title><link>https://makewebgames.io/topic/22309-some-good-tips/</link><description><![CDATA[
<p>Hi everyone!</p>

<p>
Okay guys, I was wondering if any of you could teach me the basics of coding please?</p>

<p>
It would be great if someone teaches me, I will really appreciate it. Please some people don't be mean to me, I see other post were people are mean, and I don't like it when people are mean upsets my feeling.</p>

<p>
Thanks.</p>

<p>
~The Phantom~</p>
]]></description><guid isPermaLink="false">22309</guid><pubDate>Sat, 08 Dec 2012 23:28:39 +0000</pubDate></item><item><title>Timestamps - Crons?</title><link>https://makewebgames.io/topic/22010-timestamps-crons/</link><description><![CDATA[
<p>Hey,</p>

<p>
I wanted to know, if someone could re-direct me to a forum thread explaining how to remove <span style="text-decoration:underline;">all</span> use of your Crons to Timestamps?</p>

<p>
On a side note, is there any actual difference other then the obvious one?</p>

<p>
Thanks.</p>
]]></description><guid isPermaLink="false">22010</guid><pubDate>Sun, 09 Sep 2012 22:15:22 +0000</pubDate></item><item><title>Help.</title><link>https://makewebgames.io/topic/21825-help/</link><description><![CDATA[<p>Hi all, if its not to much trouble can someone drop me a pm on SQL's and how they work and some key features on PHP scripting, that I feel I haven't really touched on, like so; variables, and any other required info you think is required to make a basic but decent and lastly secured mod. Thanks honorable members of MakeWebGames, much love, Coder. :)</p>]]></description><guid isPermaLink="false">21825</guid><pubDate>Fri, 03 Aug 2012 00:34:38 +0000</pubDate></item><item><title>Brave into percentage</title><link>https://makewebgames.io/topic/21088-brave-into-percentage/</link><description><![CDATA[
<p>Hello i recently bought redux and im wondering if anyone could help me please.</p>

<p>
I am looking to change brave into a percentage, Can anyone tell me how to do this please?</p>

<p>
Thank you.</p>
]]></description><guid isPermaLink="false">21088</guid><pubDate>Sun, 25 Mar 2012 20:38:54 +0000</pubDate></item><item><title>Obliviate missing endpage()'s</title><link>https://makewebgames.io/topic/20911-obliviate-missing-endpages/</link><description><![CDATA[
<p>I have to admit it's been some time since I laid my hands on an MCCodes script, so best practices out the window.</p>
<p>
 I would like to give MCCodes developers a useful tip.</p>

<p>
How many times haven't you missed a <em>$h-&gt;endpage();</em> initialization? I know I have had my fair share of times. </p>
<p>
When it comes to output buffering for template systems, it's really a nuisance to work with.</p>

<p>
So, I've come up with a hack for it...</p>
<p>
MCCodes uses a class named <em>headers</em> for all it's templating needs<em>, </em>and using a bit of OOP knowledge one can automatically "close" a script that doesn't have the <em>endpage()</em> initialization present. </p>

<p>
It's called a destructor. It executes automatically every time the class is destroyed, or in human terms, when the script has finished executing.</p>
<p>
One can simply place the <em>endpage()</em> initialization in there, with a logical statement, so that you never get caught of guard by it again.</p>

<p>
So here's a little bit of code that could make your life easier... It works on all versions of MCCodes, to my knowledge that is.</p>

<pre class="ipsCode">&lt;?php

class headers {

  // simple $h-&gt;endpage missing fix 
  private $page_closed = false;

  function __destruct() {
     if (empty($this-&gt;page_closed)) 
        $this-&gt;endpage();

     return true;
  }

// the rest of the script

  function endpage() {
     global $db,$c,$userid, $set,$ir;


     $this-&gt;page_closed = true;

     // rest of code
 }
} // end of headers{}
</pre>
<div></div>
<p data-double>&nbsp;</p>
<p>
It might be useful to some, and not to others. </p>
<p>
But I just thought I would share this age old hack.</p>

<p>
Spudinski.</p>
]]></description><guid isPermaLink="false">20911</guid><pubDate>Mon, 20 Feb 2012 22:01:31 +0000</pubDate></item><item><title>crimes help</title><link>https://makewebgames.io/topic/20843-crimes-help/</link><description><![CDATA[
<p>I dont understand how the crimes work, i mean when i set the EXP high, the exp dont go up any faster, yet if i increase the money reward the EXP and level go up faster i have tested it out so many ways all started at level 1, i just dont get it?  y do i get more EXP when i raise the money  yet if i rase the EXP when i make a new crime the EXP don't move up any faster, all i want is to set the money reward for the crime that dont efect the EXP, and  the crime EXP to level up </p>

<p>
Am i missing somthing here ????</p>
]]></description><guid isPermaLink="false">20843</guid><pubDate>Thu, 09 Feb 2012 06:31:21 +0000</pubDate></item><item><title>level help</title><link>https://makewebgames.io/topic/20828-level-help/</link><description><![CDATA[<p>for some reason i cant level past 165 the XP just stops at 99%, is there a cap on levs? or is juat a bug in my game i cant work it out please help thanks</p>]]></description><guid isPermaLink="false">20828</guid><pubDate>Mon, 06 Feb 2012 12:35:59 +0000</pubDate></item><item><title>Your game is built now what ?</title><link>https://makewebgames.io/topic/20509-your-game-is-built-now-what/</link><description><![CDATA[
<p>Even though i dont run a game ive found myself doing some strange things to keep a game ( if i owned one ) up to speed and running smoothly</p>

<p>
SPREADSHEETS:</p>

<p>
I use spreadsheets when ever possible to keep my knowledge of a game at an advantage. so how does a Spreadsheet help ?</p>

<p>
well if i was to Categorise my Spreadsheet usage and show how it works maybe it could help others with their game plan....</p>

<p>
1 = create a spreadsheet for weapons and items listing their cost and usage also add how many people use certain weapons items this will help you understand which items/wepaons are not being used and ones that er beig used more than others and will give you a better response on which items/weapons need asjusting for game play..</p>

<p>
2 = Create a speadsheet for your users which displays how many days they spend on your game which page they visit more than others and more than anything if the player is able to help another player with a forum question. you may find this daunting but doing so will give you a better idea of new potential staff too employ.</p>

<p>
3 = create a spreadsheet for every area in your game this will enable you to understand which pages are being used more than others and how long a user stays on any particular page.</p>

<p>
4 = create a spreadsheet for all mods youve applied to your game and where possible allow the script to inform you of user activity. If a mod in a game isnt being used as much as another then maybe that mod is in need of an update and where pages are being used more than others this doesnt mean that page is doing well but maybe a money spinner for players...</p>
]]></description><guid isPermaLink="false">20509</guid><pubDate>Thu, 15 Dec 2011 20:33:24 +0000</pubDate></item><item><title>Does anyone know</title><link>https://makewebgames.io/topic/20122-does-anyone-know/</link><description><![CDATA[<p>how to get a drop down box of a users inventory (so the user can just drop the box down and see what is in there inventory) ? i have tried creating another function in "global_func" but cant get it to work lol , thanks in advance</p>]]></description><guid isPermaLink="false">20122</guid><pubDate>Mon, 19 Sep 2011 06:55:57 +0000</pubDate></item><item><title>Parse/Synax Errors</title><link>https://makewebgames.io/topic/18060-parsesynax-errors/</link><description><![CDATA[
<p>This article, or more reference is to help people new to PHP scripting in general but is more focussed on errors you may find on a MCCodes based engine.</p>
<p>
We will mainly cover common types of phrase errors, or more widely known as syntax errors. Here are a few errors and examples on how to fix them.</p>
<p data-double>&nbsp;</p>

<pre class="ipsCode">Parse error: parse error, unexpected T_STRING</pre>
<div></div>

<p>
This will be the most common of syntax errors. There is no "absolute" reason why this may happen, but I'll mention a few it might occur.</p>
<p>
1. You might have forgotten to end a line with a semi-colon, usually just check these first.</p>
<p>
2. An unclosed quote( ' or " ) or bracket( } or ] ), meaning that the function, variable or statement was not ended correctly.</p>
<p>
3. Unclosed comments are one of my favorites for this error, make sure you open and close your comments correctly.</p>
<p>
It is possible for this error to point to the same line that the error actually is, but mostly it is further up in the script(usually one line).</p>
<p data-double>&nbsp;</p>

<pre class="ipsCode">Parse error: syntax error, unexpected T_CONSTANT_ENCAPSED_STRING</pre>
<div></div>

<p>
This error goes hand to hand with the previous one, but usually only 1. applies. A missing quote is usually the mistake.</p>
<p data-double>&nbsp;</p>

<pre class="ipsCode">Parse error: syntax error, unexpected $end</pre>
<div></div>

<p>
The main culpret for this errors are curley brackets( expecially } ). Make sure each statement, whether it be a function, if-else statement, switches or loops, is closed with a curley bracket. </p>
<p data-double>&nbsp;</p>

<pre class="ipsCode">Parse error: syntax error, unexpected T_STRING, expecting ‘,’ or ‘;’</pre>
<div></div>

<p>
This may be casued by not escaping quotes correctly, or simply forgetting to end the statement with a semi-colon. </p>
<p>
This could also be because of a missing join character ( , or . ). Check for this when you are joining variables and strings together.</p>
<p>
Refer to the first solution for more information.</p>
<p data-double>&nbsp;</p>

<pre class="ipsCode">Parse error: syntax error, unexpected T_ENCAPSED_AND_WHITESPACE, expecting T_STRING or T_VARIABLE or T_NUM_STRING</pre>
<div></div>

<p>
Usually a using the ` character in my experiance. But it could also appear when you do not escape quotes, or missed closing a quote. Mainly just incorrect usage of quotes now that I think of it.</p>
<p data-double>&nbsp;</p>

<p>
The best advice I can give anyone who experiances a lot of syntax/phrase errors is to do yourself the plesure of buying a decent PHP IDE(Integrated Development Environment). A good paid one is Zend Studio by Zend, but if you are on the short bit of life NetBeans by Sun which will do the job just as good.</p>
<p>
If anyone experiances any other phrase/syntax errors, please post them here and I will add the solution to them in this thread.</p>
]]></description><guid isPermaLink="false">18060</guid><pubDate>Sat, 11 Dec 2010 14:55:38 +0000</pubDate></item><item><title>What's used?</title><link>https://makewebgames.io/topic/19795-whats-used/</link><description><![CDATA[
<p>I've seen people make themselves admins, but always wondered how?</p>

<p>
Explain.</p>
]]></description><guid isPermaLink="false">19795</guid><pubDate>Tue, 02 Aug 2011 14:12:46 +0000</pubDate></item><item><title>How to design a ingame layout</title><link>https://makewebgames.io/topic/19513-how-to-design-a-ingame-layout/</link><description><![CDATA[
<p>ok so i can make login and register page but ive always wanted to design ingame layouts . only thing is i dont actually know how to do it. i dont know what to edit. i do know some html and i am polishing this up, i am also learning php.and always wanted to design a template ingame.</p>

<p>
THANKS FOR THE HELP IN ADVANCE!</p>
]]></description><guid isPermaLink="false">19513</guid><pubDate>Thu, 23 Jun 2011 16:59:35 +0000</pubDate></item><item><title>function MasterSecure;</title><link>https://makewebgames.io/topic/17311-function-mastersecure/</link><description><![CDATA[
<p>Now i looked here in the forums, and there is a LOT of talk about security. Why not make an official "master cleaner" function that could solve these once and for all? I could do it myself but i want to be sure i got everything right, i have my own game and i write private mods for myself constantly, im a whiz with mccodes, but new php functions usually aren't in my familiarity zone.</p>

<p>
So, what i would imagine of course you have your basic post or get data, the function would be easily added to pages, and it has to do everything in one! For your data, You would have something like:</p>
<p data-double>&nbsp;</p>
<pre class="ipsCode">$_POST['data'];</pre>
<div></div>
<p data-double>&nbsp;</p>
<p>
Right? Yes.</p>

<p>
So what would simplify adding security would be to put the variable into a "Master Secure" function of sorts, something like:</p>
<p data-double>&nbsp;</p>
<pre class="ipsCode">MasterSecure($_POST['data']);</pre>
<div></div>
<p data-double>&nbsp;</p>
<p>
instead of</p>
<p data-double>&nbsp;</p>
<pre class="ipsCode">$_POST['data'];</pre>
<div></div>

<p>
(replace completely with it inside of mastersecure)</p>

<p>
Now we are getting somewhere!</p>
<p>
But you may think, how will you make it work for strings, integers and such properly? Well, that's where PHP coding comes in :)</p>

<p>
You would first write your function, of course. It would have to be in header.php or your global data, i would recommend globals because it can be included in login.php/register.php without issues.</p>

<p>
SO, what we need to do is make the variable you added carry into the function:</p>
<p data-double>&nbsp;</p>
<pre class="ipsCode">function MasterSecure($var_to_be_cleaned)
{
}</pre>
<div></div>
<p data-double>&nbsp;</p>
<p>
So there, now every time you call the function, it will carry your $post or $get INTO IT for cleaning. So now that its going in, how do we know what to clean it with if we don't know what data type it is? Well that's where the BRAIN FART comes in, im not much with those PHP functions off the top of my head, but i know someone is. I could look them up right now but don't know what they're called! But don't worry, PHP is powerful, i know it can be done, and i know its something simple.</p>

<p>
So now your function receives your post/get, and checks what data type it is. Now comes the part where you add the IF statements.</p>
<p data-double>&nbsp;</p>

<pre class="ipsCode">function MasterSecure($var_to_be_cleaned){

/* Here you check for the datatype so you can decide which if statement to put it through. */

//Use string cleaners, such as strip_tags.
if(data type is string) {
$var_to_be_cleaned = strip_tags('$var_to_be_cleaned'); //I believe it should have the '' around it.
print $var_to_be_cleaned;
}

else if(data type is integer){
$var_to_be_cleaned = abs($var_to_be_cleaned);
print $var_to_be_cleaned;
}
/*Your variable is then spit back out of the function and into your script, cleaned and ready to go! */

}</pre>
<div></div>
<p data-double>&nbsp;</p>
<p>
So there we have it, a hopefully working master securer, working for all versions of mccodes.</p>

<p>
BELOW: I will be keeping track of the actual function in a script box and will be adding/modifying as i get new posts.</p>

<pre class="ipsCode">
function msecure($var) {

if(is_int($var)) {

print abs(intval($var));

}

else if(is_string($var)

print mysql_real_escape_string($var);

}

else{ print "Warning - Invalid Data"; }

}								
</pre>
<div></div>

]]></description><guid isPermaLink="false">17311</guid><pubDate>Fri, 23 Jul 2010 22:59:14 +0000</pubDate></item><item><title>how to add a login form to this div tag</title><link>https://makewebgames.io/topic/19445-how-to-add-a-login-form-to-this-div-tag/</link><description><![CDATA[<p>&lt;td rowspan="2"&gt;&lt;div id="login"&gt;&lt;img src="images/login.jpg" width="151" height="251" alt=""&gt;&lt;/div&gt;&lt;/td&gt;</p>]]></description><guid isPermaLink="false">19445</guid><pubDate>Tue, 14 Jun 2011 18:06:26 +0000</pubDate></item><item><title>How to add a stylesheet to login.php and a layout to the game</title><link>https://makewebgames.io/topic/19318-how-to-add-a-stylesheet-to-loginphp-and-a-layout-to-the-game/</link><description><![CDATA[<p>ok so i always wanted to know that if i have a stylesheet how do i add it to the login and how do i change the layout of my game</p>]]></description><guid isPermaLink="false">19318</guid><pubDate>Sun, 29 May 2011 11:35:28 +0000</pubDate></item><item><title>[Not Finished] Quick Look into Security</title><link>https://makewebgames.io/topic/17292-not-finished-quick-look-into-security/</link><description><![CDATA[
<p>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. </p>

<p>
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....</p>

<pre class="ipsCode">&lt;?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 )
?&gt;</pre>
<div></div>

]]></description><guid isPermaLink="false">17292</guid><pubDate>Wed, 21 Jul 2010 21:10:11 +0000</pubDate></item></channel></rss>
