Monthly Archives: March 2012

Hide HTML fields with Javascript

Description: Hide or show different HTML fields when markup is changed. Solution: There are 3 aspects to take into consideration. First, we have to identify which element will dictate the change. This is done by adding the property onchange or … Continue reading

Posted in Script | Tagged | 1 Comment

One line if / else clause in PHP

Description: Create an “if / else” check in one line. Solution: For assigning a value, or triggering a special function based on an “if / else” clause we can use the one line clause from PHP: $our_variable = (is_this_true()) ? … Continue reading

Posted in PhP | Tagged | Leave a comment

Pull single commits with GIT cherry picking

Description: We need to pull into a separate branch a few number of commits from another branch. Solution: GIT version control tool offers the solution: cherry picking. Commit your changes to the branch, and tell GIT you want to use … Continue reading

Posted in Tools | Tagged | Leave a comment

Create more / less button with CSS

Description: Create a button labeled “more” that changes into “Less” when area is expanded. Can be used also for other similar situations like “Expand / Contract”, “Maximize / Minimize” and so on. Solution: First, create the image, containing both sides … Continue reading

Posted in Script | Tagged | Leave a comment

PHP Fatal error: Call to undefined function curl_init()

Description: CURL is not enabled in the server. Solution: Open php.ini , navigate to ;extension=php_curl.dll (around line 950) and uncomment it by removing the semi colon in front. Then restart the server. Also you can check if is enabled by … Continue reading

Posted in PhP | Tagged , , | Leave a comment

Get time difference in PHP with microtime()

Description: Detect how long a script, query or function takes to run in php. Solution: PHP offers the microtime() function, which returns the number of microseconds (a millionth of a second) that passed since 1st of January 1970, the PHP … Continue reading

Posted in PhP | Tagged , , , | 3 Comments

MySQL database import using Command Line under Windows

Description: Import larger databases can cause timeouts or errors in phpMyAdmin. For this situations we need to use the command line import. Solution: The file we need is mysql.exe¬†situated in the xampp directory under \xampp\mysql\bin\ . Then 2 steps are … Continue reading

Posted in SQL | Tagged , , | Leave a comment