SetEnv APPLICATION_ENV development
Redirect /olddir /newdir
Redirect / http://www.myphphelper.com/
RewriteEngine On RewriteBase / RewriteCond %{HTTP_HOST} !^olddomain\.com$ [NC] RewriteRule ^(.*)$ http://newdomain.com [R=301,L]
RewriteEngine On RewriteCond %{HTTP_HOST} !^www\. RewriteRule ^(.*)$ http://www.%{HTTP_HOST}/$1 [R=301,L]
RewriteEngine on RewriteCond %{HTTPS} off RewriteRule ^(.*)$ https://www.%{HTTP_HOST}/$1 [R=301,L]
RewriteEngine on RewriteCond %{HTTPS} off RewriteRule ^(.*)$ https://%{HTTP_HOST}/$1 [R=301,L]
/* create zip folder */ public function zip(){ $getImage = $this->cart_model->getImage(); $zip = new ZipArchive; $auto = rand(); $file = date(“dmYhis”,strtotime(“Y:m:d H:i:s”)).$auto.’.zip’; if ($zip->open(‘./download/’.$file, ZipArchive::CREATE)) { foreach($getImage as $getImages){ $zip->addFile(‘./assets/upload/photos/’.$getImages->image, $getImages->image); } $zip->close(); $downloadFile = $file; $download = Header(“Location:http://localhost/projectname/download/”.$downloadFile); } }
public function image(){ $files = $_FILES; $cpt = count($_FILES[‘userfile’][‘name’]); for($i=0; $i<$cpt; $i++) { $_FILES[‘userfile’][‘name’]= time().$files[‘userfile’][‘name’][$i]; $_FILES[‘userfile’][‘type’]= $files[‘userfile’][‘type’][$i]; $_FILES[‘userfile’][‘tmp_name’]= $files[‘userfile’][‘tmp_name’][$i]; $_FILES[‘userfile’][‘error’]= $files[‘userfile’][‘error’][$i]; $_FILES[‘userfile’][‘size’]= $files[‘userfile’][‘size’][$i]; $this->upload->initialize($this->set_upload_options()); $this->upload->do_upload(); $fileName = $_FILES[‘userfile’][‘name’]; $images[] = $fileName; } $image = implode(‘,’,$images); $this->image_model->addimages($image); } Upload an image options public function set_upload_options() { $config = array(); $config[‘upload_path’] = ‘assets/upload/package/’; //give the path …
WordPress is an online, open source website creation tool written in PHP. But in non-geek speak, it’s probably the easiest and most powerful blogging and website content management system (or CMS) in existence today.