JavaScript

javascript

This section will provide you with the basics of what JavaScript is, and why you should use it. Objectives     JavaScript versus JAVA     Interpreted programs versus Compiled programs     Why JavaScript     What you can use JavaScript for     About JavaScript JavaScript is a lightweight, interpreted programming language. It is designed for creating network-centric … Read more

Linux Server Hardening Security Tips

Linux yum

Linux Server Hardening Security Tips Linux Server Hardening Checklist and Tips The following instructions assume that you are using CentOS/RHEL or Ubuntu/Debian based Linux distribution. Minimize Software to Minimize Vulnerability Do you really need all sort of web services installed? Avoid installing unnecessary software to avoid vulnerabilities in software. Use the RPM package manager such … Read more

curl api using variable post/get method

HI every one there are lot of confusion about curl may be you understand easily …    $url= “phone=$phone&leadid=$leadid”; //initialized other variable $header = array(“Accept: application/json”);                        //optional for json format. $ch = curl_init();                        … Read more

convert backslash to forward slash vice versa

Hi Guys, this is very easy method to replace the special character with in string  . Example $var  = “/var/xyz/html/uploaddata/xyz.html”; “/”replace with “-”  $str = str_replace(‘/’, ‘-‘,  $var); result is -var-xyz-html-uploaddata-xyz.html Example     $var  = “var-xyz-html-uploaddata-xyz.html”; “-“replace with “/” $str = str_replace(‘-‘, ‘/’,  $var); result is /var/xyz/html/uploaddata/xyz.html “/”replace with “\”  Example $var  = “/var/xyz/html/uploaddata/xyz.html”; $test = str_replace(‘/’, “\\”, $var … Read more

Convert datetime to specific formats in PHP

There are many way to use date time with specific combination with format  in PHP.. dd/mm/yyyy 18/04/2016 $userdefine = date(“d/m/Y”, $datetime); echo $userdefine; mm/dd/yyyy 04/18/2016 $userdefine= date(“m/d/Y”, $datetime); echo $userdefine; Without mins/seconds 18 April 2016  $userdefine= date(“d F Y”, $datetime); echo $userdefine; With mins/seconds 18 April 2016 10:12:59  $userdefine= date(“d F Y H:i:s”, $datetime); echo $userdefine;   There are same other formats like $userdefine= date(“m-d-Y”, $datetime); echo $userdefine; —output like … Read more

PHP Video File Upload in Server

Configure The “php.ini” File in local server or Linux ,Centos.for In your “php.ini” file, search for the file_uploads directive, and set it to On: For centos or linux you need to configure the these changes in server. /etc/php.ini upload_max_filesize = 2M file_uploads = On change the upload_max_filesize = userdefine size ;upload_tmp_dir = uncomment the variable … Read more