Category: Php

PHP MSSQL PDO

You can download the PDO for sql server here. Next you would want to add the dll or so into your php.ini. ;;;;;;;;;;;;;;;;;;;;;; ; Dynamic Extensions ; ;;;;;;;;;;;;;;;;;;;;;; extension=php_pdo_sqlsrv_74_ts_x64.dll extension=php_sqlsrv_74_ts_x64.dll

Netbeans PHP Xdebugger

https://www.codewall.co.uk/debug-php-with-xdebug-on-netbeans/ Highlight all of the information on the page and copy it. Go to theĀ XDebug Wizard tool. Paste the information into the Text Box input on the wizard tool page. Locate and click the...

PHP config for max_input_vars

Today i’ve encounter a problem where there are too many inputs and it failed silently. It did not update the database. If you see this in your error log PHP Warning: Unknown: Input variables...

PHP Forking with child process limit

function runProcessor() { $max_fork = 2; $tasks = [ “test1” => “process1”, “test2” => “process2”, “test3” => “process3”, “test4” => “process4”, “test5” => “process5”, “test6” => “process6”, “test7” => “process7”, “test8” => “process8”, “test9″...

PHP Curl with attachment ( CurlFile)

Sender PHP Code <form method=”post” action=”<?=$_SERVER[“PHP_SELF”] ?>” enctype=”multipart/form-data”> <input name=”file” type=”file” /> <input type=”submit” value=”Upload” /> </form> <?php if(!empty($_FILES)){ $target=”https://juliusgoh.life/tut/attachment-receiver.php”; echo “<pre>”; print_r($_FILES); echo “</pre>”; # http://php.net/manual/en/curlfile.construct.php // Create a CURLFile object / procedural...

PHP Script uses bash command to find file created within mins ago

$dir = “/home/ec2-user/julius/tmp/”; $file_type = “json”; $min = “5”; #Created How Many Min Ago $output = shell_exec(“find $dir -cmin -$min -type f -name ‘*.$file_type'”); $json_file = explode(“\n”,$output); array_pop($json_file); # To remove last \n if(empty($json_file)){exit();}...

PHP Code Injection Prevention

Hi, this would be great if you place @ the very first line of your script. if(isset($_GET)){ foreach ($_GET as $key => $value) { $_GET[$key] = cleanInput(strip_tags(rawurldecode(rawurldecode($value)))); } } if(isset($_POST)){ foreach ($_POST as $key...