Category: Php

MsSQL 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

Php Windows

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 ‘Analyse my phpinfo() output’ button. Download the provided module under Instructions Before pasting the below part make sure the ext downloaded is compatible […]

Apache Php

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 exceeded 1000. To increase the limit change max_input_vars in php.ini Update your max_input_vars in php.ini . Take note that this will […]

Php

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” => “process9”, “test10” => “process10”, ]; $pids = array(); $pid_count = 0; foreach ( $tasks as $seq => $task ) { […]

Php

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 method $cfile = curl_file_create($_FILES[“file”][“tmp_name”],$_FILES[“file”][“type”],$_FILES[“file”][“name”]); // try adding // Create a CURLFile object / oop method #$cfile = new CURLFile(“resource/test.png”,”image/png”,”testpic”); // uncomment […]

Php

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 => $value) { $_POST[$key] = cleanInput(strip_tags(rawurldecode(rawurldecode($value)))); } } function cleanInput($input) { $search = array( ‘@@si’, ‘@@si’, ‘@@siU’, ‘@@’ ); $output = […]

Back To Top