Jump to content

MiCR0

Members
  • Posts

    114
  • Joined

  • Last visited

    Never

Posts posted by MiCR0

  1. <?php
    require_once 'library/db.php';
    //require_once 'error.php';
    
    
    
    if (!($conn = mysql_connect('localhost', 'root', '')))
    {
    	showError();
    }
    
    if (!(mysql_select_db('itsupport', $conn)))
    {
    	showError();
    }
    
    $a = $_GET['User_ID'];// unsafe
    
    
    $result = mysql_query("SELECT * FROM contacts WHERE User_ID='" . $a . "'");
        $numrows = mysql_num_rows($result);
        if ($numrows == 1)
            {
    	// yes it has data
    	$row = mysql_fetch_assoc($result);  
    	}else{
    	$echo "error No data";
    	}
    mysql_close($conn);
    ?>

  2. Unsure about the best way to go about doing this, I do my best to explain the problem.

    I want to store tons like few mill text rows of data like.

     

    KEY Bah bah abh 35 325 bah  234 2535 25352 35325 bah bah abh bah date time etc

    *50 to *200 of the above

     

    There will be around 20k to 50k outputs a day like above that need to be stored and like 1k to 5k of the outputs will be read. Because of the amount of data I am unsure MySql could handle it fast enough as well as the size would be crazy even if I do it a text or BLOB therefore I am thinking of doing it flat database.

     

    Has anyone worked with this sort of data volume before and knows the best way to handle this. Problem with MySql is database Max size is 100MB on the server which I am using.

     

  3. function RemoveXSS($val) {
    
       $val = preg_replace('/([\x00-\x08][\x0b-\x0c][\x0e-\x20])/', '', $val);
       
       $search = 'abcdefghijklmnopqrstuvwxyz';
       $search .= 'ABCDEFGHIJKLMNOPQRSTUVWXYZ';
       $search .= '1234567890!@#$%^&*()';
       $search .= '~`";:?+/={}[]-_|\'\\';
       for ($i = 0; $i < strlen($search); $i++) {
    
          $val = preg_replace('/(&#[xX]0{0,8}'.dechex(ord($search[$i])).';?)/i', $search[$i], $val); 
    
          $val = preg_replace('/(&#0{0,8}'.ord($search[$i]).';?)/', $search[$i], $val); 
       }
       
       $ra1 = Array('javascript', 'vbscript', 'expression', 'applet', 'meta', 'xml', 'blink', 'link', 'style', 'script', 'embed', 'object', 'iframe', 'frame', 'frameset', 'ilayer', 'layer', 'bgsound', 'title', 'base');
       $ra2 = Array('onabort', 'onactivate', 'onafterprint', 'onafterupdate', 'onbeforeactivate', 'onbeforecopy', 'onbeforecut', 'onbeforedeactivate', 'onbeforeeditfocus', 'onbeforepaste', 'onbeforeprint', 'onbeforeunload', 'onbeforeupdate', 'onblur', 'onbounce', 'oncellchange', 'onchange', 'onclick', 'oncontextmenu', 'oncontrolselect', 'oncopy', 'oncut', 'ondataavailable', 'ondatasetchanged', 'ondatasetcomplete', 'ondblclick', 'ondeactivate', 'ondrag', 'ondragend', 'ondragenter', 'ondragleave', 'ondragover', 'ondragstart', 'ondrop', 'onerror', 'onerrorupdate', 'onfilterchange', 'onfinish', 'onfocus', 'onfocusin', 'onfocusout', 'onhelp', 'onkeydown', 'onkeypress', 'onkeyup', 'onlayoutcomplete', 'onload', 'onlosecapture', 'onmousedown', 'onmouseenter', 'onmouseleave', 'onmousemove', 'onmouseout', 'onmouseover', 'onmouseup', 'onmousewheel', 'onmove', 'onmoveend', 'onmovestart', 'onpaste', 'onpropertychange', 'onreadystatechange', 'onreset', 'onresize', 'onresizeend', 'onresizestart', 'onrowenter', 'onrowexit', 'onrowsdelete', 'onrowsinserted', 'onscroll', 'onselect', 'onselectionchange', 'onselectstart', 'onstart', 'onstop', 'onsubmit', 'onunload');
       $ra = array_merge($ra1, $ra2);
       
       $found = true; 
       while ($found == true) {
          $val_before = $val;
          for ($i = 0; $i < sizeof($ra); $i++) {
             $pattern = '/';
             for ($j = 0; $j < strlen($ra[$i]); $j++) {
                if ($j > 0) {
                   $pattern .= '(';
                   $pattern .= '(&#[xX]0{0,8}([9ab])';
                   $pattern .= '|';
                   $pattern .= '|(&#0{0,8}([9|10|13])';
                   $pattern .= ')*';
                }
                $pattern .= $ra[$i][$j];
             }
             $pattern .= '/i';
             $replacement = substr($ra[$i], 0, 2).'<x>'.substr($ra[$i], 2); 
             $val = preg_replace($pattern, $replacement, $val);
             if ($val_before == $val) {
                
                $found = false;
             }
          }
       }
       return $val;
    }

  4. I am creating a PHP / MySql Based Game bigger then I ever seen done before therefore I am looking for partnership to speed this project up.

    50-50 Split on the end result, Game Documentation, Game logic mostly worked out already.

     

    Just to give you an Idea how big this Project is when the database is finished it will need to be run on 8 to 10 Servers.

     

    If you Strong in PHP / MySql PM me your MSN address to chat more.

     

×
×
  • Create New...

Important Information

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.