Skip to content

Instantly share code, notes, and snippets.

View ronykader's full-sized avatar
🏠
Working from home

Md.Tarikul Islam ronykader

🏠
Working from home
View GitHub Profile
@ronykader
ronykader / gist:859834a7b8d96c0f4f9e2e39046e99e9
Last active March 16, 2024 20:55
For resolving permission-related errors in Laravel Sail, consider the following helpful tips.
If you're facing permission problems while running your project in a browser, creating a controller, using Composer, or adjusting configurations, this method can assist in resolving your issues.
sudo chmod -R 777 storage/
sudo chmod -R 777 bootstrap/cache
./vendor/bin/sail bash
cd ..
chown -R sail:sail html
@ronykader
ronykader / WordPressDB.php
Created September 14, 2018 10:14
WordPress Database Tutorial
<?php
//absolute path to wp-load.php, or relative to this script
//e.g., ../wp-core/wp-load.php
include( 'trunk/wp-load.php' );
//grab the WPDB database object, using WP's database
//more info: http://codex.wordpress.org/Class_Reference/wpdb
global $wpdb;
@ronykader
ronykader / How to pass a parameter by CI redirect Function
Created March 2, 2017 11:13
When you want to pass a parameter by redirect function ( Codeigniter ) the you can follow this way
$hometeam = $this->input->post('home_team');
$awayteam = $this->input->post('away_team');
if( $hometeam == $awayteam ) :
$this->session->set_flashdata('FlsMsgCheckteam', $this->alert->danger('please selete proper home team and away team'));
$id = $this->uri->segment(3);
$leagueid = $this->uri->segment(4);
redirect(base_url()."football/update_matchform/".$id.'/'.$leagueid);
endif;
@ronykader
ronykader / CI Validation
Created February 18, 2017 11:08
You can validation when you will insert data in your database by codeigniter
public function save_football()
{
$login_info = $this->session->userdata('login_info');
if ($login_info['logged_in'] == 1 && $login_info['user_details']['status'] == 1):
$this->form_validation->set_error_delimiters($this->alert->dmStart(), $this->alert->dmEnd());
$data = array('required' => 'Please write %s');
$this->form_validation->set_rules('team_name', 'team name', 'trim|required', $data);
@ronykader
ronykader / Image Preview by JavaScript
Created February 14, 2017 12:26
Image Preview function by javaScript when we upload image by php
Html Code
----------------------------------
<div class="showpreloadimage">
<img id="showimageurl1" width="100%">
</div>
<input type="file" class="filestyle" name="team_image" data-placeholder="No file" id="postimage1" onchange="upload_teamimage(this)" tabindex="-1" style="position: absolute; clip: rect(0px 0px 0px 0px);">
<div class="bootstrap-filestyle input-group">
<input type="text" class="form-control " placeholder="No file" disabled="">
<span class="group-span-filestyle input-group-btn" tabindex="0">
Controller
---------------------------
if ( !empty($_FILES['gallery_images']['name'] ))
{
$gallery_images = $this->Gallery_model->uploadImage('gallery_images','gallery_images','gif|jpg|png',1);
$attachment = $gallery_images['file_name'];
if ( $gallery_images['file_name'] == '' )
{
$this->session->set_flashdata('FlsMsg',$this->alert->danger($gallery_images['upload_error']));
redirect( 'Gallery/gallery_form' );