Jump to content
xisto Community

Stenno

Members
  • Content Count

    22
  • Joined

  • Last visited

Posts posted by Stenno


  1. 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


  2. 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.

  3. <? 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);?>


  4. 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

  5. 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

  6. 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:

     

    ˙Ř˙ŕJFIF˙ţ;CREATOR: gd-jpeg v1.0 (using IJG JPEG v62), quality = 70

    ˙ŰC

     

     

    #%$""!&+7/&)4)!"0A149;>>>%.DIC<H7=>;˙ŰC

    ;("(;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;˙ŔnĆ"˙Ä

    ˙Äľ}!1AQa"q2Ą#BąÁRŃđ$3br

    %&'()*456789:CDEFGHIJSTUVWXYZcdefghijstuvwxyz˘Ł¤ĽŚ§¨ŠŞ˛ł´ľśˇ¸šşÂĂÄĹĆÇČÉĘŇÓÔŐÖ×ŘŮÚáâăäĺćçčéęńňóôőö÷řůú˙Ä

    ˙Äľw!1AQaq"2BĄąÁ #3RđbrŃ

    $4á%ń&'()*56789:CDEFGHIJSTUVWXYZcdefghijstuvwxyz˘Ł¤ĽŚ§¨ŠŞ˛ł´ľśˇ¸šşÂĂÄĹĆÇČÉĘŇÓÔŐÖ×ŘŮÚâăäĺćçčéęňóôőö÷řůú˙Ú?ń(˘


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


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


  8. 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 :P 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 :D So push yourself to the limit! Thank you very much in advance.


  9. 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.


  10. 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 ??


  11. 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


  12. Some basic statements

     

    Now we're going to see the following statements:

     

    - CREATE

    - SELECT

    - INSERT

    - UPDATE

    - DROP

    - ALTER

    - DELETE


    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!


  13. 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


  14. You need this code:

    echo "<form name=\"sort\">
    <select name=\"sort_by\" onChange=\"java script:document.sort.sort_by1.disabled = false;\">
    <option value=\"default\">Please select!</option>
    <option value=\"Name\">Name</option>
    <option value=\"level\">Level</option>
    <option value=\"email\">Email</option>
    <option value=\"cash\">Cash</option>
    </select>
    <select name=\"sort_by1\" disabled>
    <option value=\"DSC\">DSC</option>
    <option value=\"ASC\">ASC</option>
    <option value=\"RAND\">RAND</option>
    </select>
    </form>"



  15. 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.

×
×
  • Create New...

Important Information

Terms of Use | Privacy Policy | Guidelines | We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.