Skip to main content

Posts

Install Cakephp with Composer on Linux

How to Install Cakephp with Composer on Linux System Here is the complete tutorial for how to install cakephp letest version with composer on linux system. If you dont have install composer then first you should install composer To install composer run the following commands one by one- php -r "copy('https://getcomposer.org/installer', 'composer-setup.php');" php -r "if (hash_file('SHA384', 'composer-setup.php') === '55d6ead61b29c7bdee5cccfb50076874187bd9f21f65d8991d46ec5cc90518f447387fb9f76ebae1fbbacf329e583e30') { echo 'Installer verified'; } else { echo 'Installer corrupt'; unlink('composer-setup.php'); } echo PHP_EOL;" php composer-setup.php php -r "unlink('composer-setup.php');" OR you can install composer with curl by using this command curl -sS https://getcomposer.org/installer | php these commands will download the latest composer.phar in the current directory...

Cakephp 3.x cake bake on linux system

How to Cakephp 3.x cake bake on linux system Cakephp gives an awesome feature that is bake. by using bake you can create controller models and views without coding . you just need to type some commands and cake will create files for you. So here is the simple steps for cake bake in cakephp 3.x on linux system 1.First Open your terminal window 2. install php5 on your system by using this command and press enter       sudo apt-get install php5-mysql 3. Now download letest cakephp 3.x zip file from cakephp github and unzip into your local server (ex. /op/lampp/htdocs/newcake/here all files) 4. Now in terminal change directory by this command and press enter       cd /opt/lampp/htdocs/newcake/ 5. Then run following command   bin/cake bake When you hit enter then you will see output like this  Welcome to CakePHP v3.3.4 Console --------------------------------------------------------------- App : src Path: ...

Simply Create PDF with PHP mysql FPDF (2 steps)

Simply Create PDF with fpdf Sometimes we need to generate pdf based on mysql database so here is the example of How to create PDF with PHP mysql using FPDF in 2 Steps. Step1 First Download fpdf from Here Step 2 Create an index.php file and paste this code <?php include('../config.php'); require('webroot/fpdf/fpdf.php'); $aClassDb = new ClassDb(); class Getdata { public function all($getPostdata) { $getData = ""; try { $getApartment = $getPostdata['apartid']; $getYear = $getPostdata['invoiceyear']; $startdate = mktime(0,0,0,1,1, $getYear); $enddate = mktime(0,0,0,12,31, $getYear); $query = $aClassDb->getAllData("invoice", "AND appartment='$getApartment' AND date_invoice BETWEEN $startdate AND $enddate"); $getData = $query; /* PDO $db = new PDO('mysql:host=localhost;dbname=test;', 'root'...

Change page title with jquery

How to Change title with jQuery Change Document title with jQuery Here is the all ways that you can use to change title of webpage THE BEST METHOD TO CHANGE TITLE WITH JQUERY <script type="text/javascript">  document.title = "New Dynamic Title with Jquery"; </script> You just need one line to change document title dynamically. you can also update document title dynamically with this method. Other Methods METHOD 1 - <script type="text/javascript">   $('html head').find('title').text("New Dynamic Title with Jquery"); </script> METHOD 2 - <script type="text/javascript">   $(document).attr("title", "New Dynamic Title with Jquery"); </script> METHOD 3- //Not Supported in IE <script type="text/javascript"> $(document).ready(function() {       $(this).attr("title", "sometitle");    });...

Upload files and folders on GitHUB [tutorial]

Upload files and folders on GitHUB To upload your project or files and folder on github with files and folder on linux system you have to follow these simple steps. Open Console by Ctrl+Alt+T First make the repository (Name=RepositoryName) from your profile page-> repository tab and click on New button  on github. Open the terminal and make the new directory (mkdir NewDirectory) or create manually a new folder or directory. Copy your ProjectFolder to this NewDirectory. Change the present work directory to NewDirectory.              cd NewDirectory Run the following command one by one       git init       git add ProjectFolderName       git commit -m "first commit"       git remote add origin https://github.com/YourGithubUsername/RepositoryName.git       git push -u origi...

Upload Large CSV into mysql in a minute PHP Script

How to upload large CSV file in Mysql Database within a minute [ PHP SCRIPT ] IF you have large csv file and you want to upload in Mysql then mysql will take too much time to import that csv data . so here is the script that will  take less a minute and all csv data will uploaded in mysql. This Script contains a html form you have to fill information of your database and also insert file name in "Name of the file" column and also notice that your file and this script must be exist in same folder. SO here is the PHP script to upload large CSV file in mysql within a minute. <?php if(isset($_POST['username'])&&isset($_POST['mysql'])&&isset($_POST['db'])&&isset($_POST['username'])) { $sqlname=$_POST['mysql']; $username=$_POST['username']; $table=$_POST['table']; if(isset($_POST['password'])) { $password=$_POST['password']; } else { $password= ''; } $db=$_POST[...