Stenno
Members-
Content Count
22 -
Joined
-
Last visited
Everything posted by Stenno
-
Yeah i probably can make you one indeed. Just tell me the details, for which pupose are you using it and so on.
-
How To Prevent My Site From Being Hacked?
Stenno replied to satyaparija's topic in Websites and Web Designing
The most important part is to be very carefull with input from the visitor, always check it. All the $_GET's the $_POST's make sure they won't be able to use bugs in your code to get in. Because 80% of all sites can be hacked because of bugs in their scripts.take a look at the following functions:htmlspecialchars();is_numeric(); // very helpfull with $_GET['id'];also take care of the include methods and upload and file management systems. So they can't fake files, by changing their extentions and so on. Lots of articles about it on the net. Please watch them -
Ouch, this will get you hacked easily. They create a file x.php and put this in it: for example: <?$fHandle = fopen($fileName , 'r+');while (!feof ($handle)) { $buffer = fgets($handle, 4096); echo $buffer;}?> They just run their script after they created it and it gives them login info from your database and so on. It's very important to built in a safety check, so you can check their code first before they can run it. They could also create a injection bug on purpose in the script: <? $page = $_GET['page']; include($page);?> Makes them able to include every file on your server, even files that aren't in that specific map. So watch out with it Make sure only you can run the script, so for instance make a login for it.
-
Your code is fine, but you could also do it this way: SELECT * FROM `users`, `events_attend` WHERE users.userid != events_attend.ea_user_id I guess this has the same output
-
<? if(preg_match("/ /", $_POST['user'])){ echo "The user name have spaces"; }else{ echo "The user name is correct"; }?> This is exactly the same result in way shorter code. Besides to remove the spaces and to set the username and password to lowercase [when you have case-insensitive login system] and to prepare them for inserting to the database just use this code: <?$username = htmlentities(strtolower(trim($_POST['user'])),ENT_QUOTES);$password = htmlentities(strtolower(trim($_POST['password'])),ENT_QUOTES);?>
-
Yes there is away to select info from mutiple tables out your database. This is the way: SELECT p.date, p.time, o.name, o.blabla FROM `preformance` AS p AND `organization` AS o WHERE o.id = p.org_id; or SELECT preformance.date, preformance.time, organization.name, organization.blabla FROM `preformance` AND `organization` WHERE organization.id = preformance.org_id; But as you can see the first method is way more efficient. Good luck with it
-
Get A Image Indentifier With Gd Library GD library question
Stenno replied to Stenno's topic in Programming
I already found the method to retrieve an image indentifier with only the weird code. It's like this: <? $data = 'iVBORw0KGgoAAAANSUhEUgAAABwAAAASCAMAAAB/2U7WAAAABl' . 'BMVEUAAAD///+l2Z/dAAAASUlEQVR4XqWQUQoAIAxC2/0vXZDr' . 'EX4IJTRkb7lobNUStXsB0jIXIAMSsQnWlsV+wULF4Avk9fLq2r' . '8a5HSE35Q3eO2XP1A1wQkZSgETvDtKdQAAAABJRU5ErkJggg=='; //$data is the base64_encoded weird data$data = base64_decode($data);$im = imagecreatefromstring($data);if ($im !== false) { header('(anti-spam-content-type:) image/png'); imagepng($im);}else { echo 'An error occurred.';} ?> Thanks for your help though, and sorry for the weird explenation -
Get A Image Indentifier With Gd Library GD library question
Stenno replied to Stenno's topic in Programming
And i don't have a file, i only have a string with those weird chars. Or maybe there is some function to create a file first and then use imagecreatefromjpeg() ?? -
Get A Image Indentifier With Gd Library GD library question
Stenno replied to Stenno's topic in Programming
Ohw sorry, thanks for warning. But that's not my question. It's just a quick sample script to explain my question better. Please read it carefully: i would like to know how i can recreate an image with only the weird data (in the quotes). -
Hey fellow coders, I'm having a problem. If you output a im indentifier in php with gd libary. With this method for example: <?header("(anti-spam-(anti-spam-(anti-spam-content-type:))) image/png");$imgWidth = 50;$imgHeight = 50;$image=imagecreate($imgWidth, $imgHeight);$colorBlack = imagecolorallocate($image, 0, 0, 0); // first color you define with colorallocate is also the color of the background of your imageimagepng ($image);imagedestroy ($image);// This gives you a page with a black image of 50x50 pixels.?> If i look at the source code of that page, i see: I get something similair to that. Now my question: How can i get back the image indentifier (the var $image in the sample code above), with only this weird code ?? Thanks very much in advance, Though i fear not many people here know how this can be done
-
Yeah Heroes of Might and Magic indeed is a very cool game, I used to play it with 3 other friends in groups. So we could lan 2vs2. Real fun times! My favourite factions were humans and elves - I believe - because they had the best archers. Crossbow men, Monks (humans) and Elves.The idea of the game is very good, it's a turn based game. Meaning you can walk in a certain range, then build something in your fortress and when your finished you can click "Next Day" and then the opponents can do their things. You have a big vairity of maps and with map builder you are also able build your own maps. Though the graphics suck *bottom*, i would recommend to all of you guys that love strategie games, it's one of the best!
-
I'm a real bad designer and i'm active on a lot of different forums for a long time now. So I think it's time for a sig And i could really use some help with it, from a decent designer I have no favours, but it would be very nice if the theme would be Lord of The rings, for example: Legolas. I hope someone can help me out, i have seen lots of great stuff in the showoff forum So push yourself to the limit! Thank you very much in advance.
-
It indeed is a very good First person shooter. TBH i have been addicted for a real long time: it just gave me a kick especially when i was on a real high killingspree or i was winning 2vs1 fights or at least fights/battles in which i was outnumbered.Real good game and totally free, great and active community.
-
Whats Your Favourite Rts Game? favourite rts game.
Stenno replied to TeamOuT's topic in Computer Gaming
I really like Lord of The Ring Battle For Middle Earth I, in short: LoTR BFME I. I and almost all of the BFME I players prefer BFME I over BFME II, which is why BFME I still has a very active community. You can find the official ladder on this page: Official BFME I ladder Site and the official strategies and replay site here: http://forums.xisto.com/no_longer_exists/ My nickname is called: Topalov, currently ranked 17th from all the 230,000 players [once i was ranked 6th]. My favourite faction to play with is Gondor. Any other guys, playing BFME ?? -
K well first of all you posted in the wrong section, you have PHP code there and this is the HTML/XML section.Secondly you don't need ( if you make an echo statement. echo("</form>"); Better is: Echo "</form>";. Finally, if you want to grab info from an url you need the super global $_GET. For example you have: index.php?age=7&blabla=nothing echo $_GET['age']; // gives 7 as output echo $_GET['blabla']; // gives nothing as output hope this will help you out. PS. could an admin or moderator move this too PHP section
-
I think you forgot TURNICATE, to empty tables EDIT: after a double check, it turned out to be TRUNCATE instead of TURNICATE. Sorry guys, hope i editted it soon enough!
-
You can use a header, so the browser knows what kind of file it is. (anti-spam-content-type:) Html/Text for example. You can do it in html with a Meta-Tag <meta blabla> or in php with a header: Header("(anti-spam-content-type:) ");So i think it is possible
-
Double Dropdown Disable the second until first is selected
Stenno replied to tdktank59's topic in Programming
You need this code: -
Use strtolower() function to make your login script NOT case sensitive. Case sensitive login system are safer but could be annoying for the visitor.if (strtolower($_POST['txtUsername'])!= strtolower($username) || strtolower($_POST['txtPassword']) != strtolower($password)) {
-
You scripted that function kinda weird :/ Why not a complete rewrite ??lets say:function cacheItem($key,$data) {$key = md5($key);$fw = fopen($this->folder.$key, "w");fwrite($fw, $data);fclose($fw);return true;}
-
How do you mean, auto surf ?? To fetch contents from other sites through sockets and curl: Something like a proxy browser ??
-
Addiction to the games exists I am addicted to mmorpg's and I am not ashame with. Internet it's own gets u addicted at a point. Ppl don't go to other relaxing stuff no more. It's about my neighbourhood. I don't see kids playing soccer or hide and seek here anymore. They just chat and navigate all day when they are free.