Top Menu

Category Archives Cakephp

What Are HTTP And HTTPS? HTTP  is the cornerstone web technology that helps to transmit and share information across the WWW. HTTPS is the second version of HTTP. It will make the Internet a safe haven for day-to-day transactions like eCommerce, Internet banking, instant messaging, video chat, file transfer, cloud storage, etc. SSL Makes All The Difference The key point…

Users can upload images with uploadify and when uploadify sends the image to my controller I simply attach the sessionid as a parameter. Step One. Create function on own controller  app/controller/PagesController.php Step 2 create view file for display  <h1>Uploadify Demo</h1> <?php echo $this->Form->create('Setting', array('url'=>'#','type' => 'file')); ?> <div id="queue"></div> <?php echo $this->Form->input('file_upload',array('type' => 'file', "id"=>'file_upload', 'div'=>false,'label'=>false,"multiple"=>"true"));?> <?php echo $this->Form->input('police_no',array('id'=>'police_no', 'div'=>false,'label'=>false));?>…

Upload file without refreshing page in cakephp 1.controller/controlername_controller.php class DoctorsController extends AppController { var $name = 'Doctors'; public $uses= array('Doctor'); function changeprofilephoto() { $doctor_id = “14”; // $path = "../../app/webroot/profilepic/";//set path $valid_formats = array(".jpg", ".png", ".gif", ".bmp", ".jpeg");// if($this->data) { $this->Doctor->set( $this->data ); $name = $this->data["Doctor"]['profile_pic']['name']; $size = $this->data["Doctor"]['profile_pic']['size']; if(strlen($name)) { $fileExt = substr(strrchr($name, '.'), 0); if(in_array($fileExt,$valid_formats)) { if($size<(1024*1024)) {…

1. Controller/controllername.php class ControllerNameController extends AppController { var $name= 'ControllerName'; public $uses = array('TablesName');function inbox() { $this->paginate = array( 'conditions' => array('TablesName.receiver_delete'=>'0', 'AND'=>array('TablesName.user_to'=>$parameters ['id'])),'limit' => 10,'order' => array('TablesName.sent_date'=>'desc' ) ); $data = $this->paginate('TablesName'); $this->set('messages', $data); }views/elements/paging.ctp<?php echo "<div align='left' class='l1'>". $this->Paginator->counter(array('format' => 'Showing %page% to %pages% of %count% entries' )). "</div><div align='right' class='r1'>". $this->Paginator->first('First', null, null, array('class' => 'disabled'))."&nbsp;&nbsp;&nbsp;". $this->Paginator->prev('«…

Auto Generate Password and User Function  class GeneratorComponent extends Object{                // Numeric Arrayvar $_array_numeric      = array(1,2,3,4,5,6,7,8,9);                // Alphabet Array                var $_array_alpha            = array('a','b','c','d','e','f','g','h','i','j','k','l','m','n','o','p','q','r','s','t','u','v','w','x','y','z');                /**                # Function                           : GeneratePassword                # Create Date    : 02-12-2011                # Description     : Generate password in random order.                # Arguments                      : None                # Return                              : Password                */                function GeneratePassword(){                                                $array_pass        =  $this->_array_numeric;                                $array_pass_alpha          =            …

12
Close