
Octet
Members-
Posts
149 -
Joined
-
Last visited
-
Days Won
3
Content Type
Profiles
Forums
Events
Everything posted by Octet
-
Putting limits on names that users can sign up with
Octet replied to Daron's topic in Modification Support
Hello, putting limits on what your users can register with is extremely important. The first thing I suggest you do is include mysql_real_escape_string to help prevent MySQL injection (a form of hacking). The I also suggest you to strip all usernames to lowercase so that they can be queryed, otherwise someone can have a username 'bob' or 'BoB' or 'Bob' and even though they are the same, they are going to be classed as different. To do this, use: $Username = mysql_real_escape_string(strtolower($_POST['Username']); The second step, is to remove all spaces so that someone can't have Bob and B o b. To do this, use: $Username = preg_replace('/\s+/', '', $Username); Finally, you want to remove all numbers. You would want to use the is_numeric() function such as: if (is_numeric($Username)) { die ("That is not allowed"); } Hope this helps! Also, in my opinion I think between 5 and 25 for Usernames and between 6 and 25 for passwords. Admittedly I would normally use a password longer than six but considering you are addressing the public (which has varying views on security) then you need to have a line between security and usability. -
I still haven't seen it, I was out but I can't wait to watch it judging by what you've said about it.
-
Jamaica we have a bobsled team! I would agree though, you should be proud of each and every athlete regardless. Especially when you consider the age of them, but I find it disgraceful when they have this opportunity and then they throw it away such as the racist Twitter message by the Greek athlete.
-
Ok, no need for an all out war guys! For those who did see it, now it is almost over (30 minutes left or something?), what did you think of it?
-
I would agree that there is no point re-inventing the wheel, but that doesn't mean you can't improve the tires. The game as a whole works, and it is a good concept but what should be changed are things like the story line and the way you do such things in order to make it more interesting. For example, and as others have said, why would you play a game which is the same as the last? Even just changing the story line and the names of a few things would be a big improvement, you can't really call it your own game otherwise.
-
I agree, they had all this pointless publicity and these tacky things, such as wasting £930,000 on that Olympic ring barge which sailed up the river once and has now been put into storage (probably not to be seen again).
-
I think that is what a lot of people are saying at the moment, I shall probably watch the ceremony but more out of curiosity as to the bizarre concoction that they have put together.
-
Just wondering whether anyone was going, watching or looking forward to the London Olympics Opening Ceremony Tonight. Personally I'm not sure what the organisers of the Olympic opening ceremony where thinking when they decided to have two mosh pits, live farm animals, a cricket game, rain and 'green and pleasant meadows'.
-
I don't believe he/she is looking to fund an existing game, he/she is looking (from what I gather) for a person to completely start a game from scratch to create his own game.
-
Yeah, I noticed it in your comment when you isolated the line. Thanks again.
-
Thanks, I found my error :P I put a ; on the end of it meaning the results where being ignored. Stupid mistake, I knew it was going to be something simple
-
I am trying to check whether what the person entered is the day, although this isn't the best method to preventing spam it is the method I am going to be using for the time being. At the top of my webpage I have a clock, which the user needs to enter the day from in order to confirm that they are in fact a human. The problem is my script sends the message regardless, the script should be really simple but I cannot work out why it isn't doing what it is supposed to. <?php $ContactReason = mysql_real_escape_string($_POST['ContactReason']); $Title = mysql_real_escape_string($_POST['Title']); $Message = mysql_real_escape_string($_POST['Message']); $Human = mysql_real_escape_string($_POST['Human']); $BConfirmation = mysql_real_escape_string($_POST['BConfirmation']); $Date = date("Y/m/d H:i:s"); $HumanAnswer = date("d"); if ($BConfirmation) { die ("BOT WARNING - We have reason to believe you are a bot and have restricted your access to our servers"); } if ($Human == $HumanAnswer); { if ($ContactReason == "Null") { die (Header ('Location: Errors/Contact/Fields.php')); } if ($Title && $Message) { mysql_connect ("", "", "") or die ("Couldn't Connect to the Database Server"); mysql_select_db ("") or die ("Couldn't Find Database on the Server"); mysql_query ("INSERT INTO Contact (ContactReason, Title, Message, Date_Sent) VALUES ('$ContactReason', '$Title', '$Message', '$Date')"); mysql_close(); die (Header ('Location: Errors/Contact/Sent.php')); } die (Header ('Location: Errors/Contact/Fields.php')); } die (Header ('Location: Errors/Contact/Human.php')); ?> The problem is somewhere on line 17, I have killed the script early and got it to echo out the '$Human' and '$HumanAnswer' variables and they both are correct, the '$Human' being what I entered and '$HumanAnswer' being what is on the clock. Any ideas would be appreciated, I am sure it is really simple and something that I've overlooked. (Note: I've removed my information from the mysql_select_db and mysql_connect for security)
-
Ok thanks, shall look into memory tables then.
-
Thanks, I've never heard of memory tables before. I'm hosting it on my own server so providing I can set it up then I should be ok. I shouldn't be sharing it across sessions though, in theory I could do it without sessions all together as I am taking it from the database. The only thing I need sessions for is to update the position of the player?
-
Hmmm, I like the way you're thinking KyleMassacre. I could always incorporate it into my game by saying it should only fetch data for players within an X radius and say that they need to upgrade or whatever to be able to see enemies at a greater range.
-
My idea is that in the database there shall be a coordinate for each player, probably a single number so Pos = 4. That shall relate to a position in an array which shall be displayed as a map on the players screen. When the player is in game, every ten seconds they shall get an update from a variable holding that array (so every player that is online at the time shall query the array). That array gets the information from the database, so this way the database is only queried once (which shall be the most intensive operation). I don't think the number of players in the database shall matter too much, providing each player isn't querying that database. Not sure if that got my point across, do you think querying the database once then updating the players from the array shall be excessive work on the server?
-
It shouldn't as I am planning on making it global so it is only querying the database once and then it updates the table on a local basis. I did this because if I had it query the database every ten seconds, for every user then I would expect the server to be under huge amounts of strain, so instead it is only done once but I still have concerns that it is putting a lot of work on it.
-
For my game, I am thinking of having a real time map displaying all the players positions. The positions shall be stored in the database as coordinates such as $X = 5, $Y = 4 . I was then thinking of having a script which shall loop around constantly and get the new positions and then re-position them on the tile map. The concern I have is that this shall strain the server greatly, I have considered putting a sleep() in for about ten seconds to reduce the strain but even with that in do you think it shall be too much? The loop would be global, so it would only happen once as opposed to happening for every player but even so... not sure about it What do you guys think? Too much?
-
I have never used 123Reg for hosting but their domain service isn't bad, so it might be worth checking them out. I don't know how they compare in terms of prices but they do offer various package deals and discounts.
-
I think that would be the best option for your money, you can certainly get a lot more for it. Careful when selecting your hard drive though... the price of those vary so much between companies and models.
-
Probably the best piece of advice you can give to preventing SQL Injection! Good point.
-
It looks like you've opened and closed your echo in the same line without finishing it. Try echo "Sorry, the annoucement title is too short. <a href = 'staff_announce.php?addannouce' > Go Home</a>"; You ended the echo when you opened the anchor tag.
-
Maybe, but unfortunately he died in 2005.
-
I built my computer, and I can confirm that you shall certainly get A LOT more for your money. Yes, the OS is expensive but you make up your money through getting the actual hardware for cheaper. It is relatively easy to build, matching up the pins plus you can customize it more to your needs and in the future you can sell it as a 'Custom Built High End PC' and make more money from it than if you tried selling a stock PC :P
-
I remember seeing this about a year ago, eggs box 360... classic!