-
Posts
114 -
Joined
-
Last visited
Never
Posts posted by MiCR0
-
-
trim(string,charlist)
The trim() function removes whitespaces and other predefined characters from both sides of a string.
string
* Required. Specifies the string to check
charlist
* "\0" - NULL
* "\t" - tab
* "\n" - new line
* "\x0B" - vertical tab
* "\r" - carriage return
* " " - ordinary white space
-
Should be fine
-
-
try
py_eval($code);
as in put all your Python Code into the php and use it using that.
$code = <<<EOD
import php
bah bah bah
EOD;
py_eval($code);
-
really depends on the actions of the pl you are running.
system("cd /home/bahbah/; nohup ./scripted > /dev/null & echo $!;");
exec()
shell_exec()
etc tons of ways
-
-
ok, so anyone know anyway I can protect myself against XSS?
-
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.
-
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,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,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; }
-
Or you could just use explode on the </td> and then echo them out from the array.
-
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.
-
need more code there is no form there
Updating MYSQL
in PHP Coding Help
Posted