572
Hello to all, welcome to therichpost.com. In this post, I will tell you How to remove index.php from url? and you need to add this code into your .htaccess file.
Here is the working code and you need to add this .htaccess file:
RewriteEngine on
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule ^(.*)$ index.php?/$1 [L]
There are so many codes in htaccess and I will let you know all. Please do comment if you any query related to this post. Thank you. Therichpost.com
You Might Also Like
- How to Save Angular 6 Form Data into Php Mysql with Laravel 5.7?
- Angular 10 FullCalendar Add Event Demo Part 1 with Source Code
- Reactjs Ecommerce Site – Show Dynamic Products
- Angular 6 Material Datatables example with Php Mysql data
- Reactjs Crud Tutorial – Update User
- Angular 10 Crud Tutorial – Delete User
- how to stay on the last view after refreshing the page fullcalendar with php?
- How to remove .php extension from url?
- How to create ajax middleware in laravel with php artisan command?
- Laravel 7.2 Best Practices Database Queries
- Reactjs Datatable with Dynamic Columns and Data
- How to save php mysql data in Excel sheet?
- Angular 11 Crud Tutorial with Service – Delete User
- How to set Laravel Default Auth with custom User type Field?
- How to create custom middleware in laravel for user authorize?
- Reactjs Save User Register Form Data into PHP MySQL Database
- Angular 11 Crud Tutorial – Delete User
- Ionic 5 Angular 12 Chartjs with Dynamic Data
- Database Seeding in Laravel 5.7 With Faker Package
- Reactjs Upload & Save Multiple Images PDF Video Files with Preview and Delete functionality
6 comments
good post…working well
Thank you
update query in laravel:
with pdo:
public function update(Request $request)
{
parse_str($request->formdata, $data);
$client_id = \Hashids::decode($request->client_id);
$data[‘birthday’] = date(‘Y-m-d’, strtotime($data[‘birthday’]));
// return response()->json([
// ‘firstname’ => $data[‘firstname’]
// ]);
$QUERY = $this->PDO->prepare(“UPDATE user SET firstname = :firstname,
lastName = :lastName,
dob = :dob,
email = :email,
phone = :phone,
client_notes = :client_notes WHERE objectId = :objectId”);
$QUERY->bindParam(“firstname”, $data[‘firstname’],\PDO::PARAM_STR);
$QUERY->bindParam(“lastName”, $data[‘lastname’],\PDO::PARAM_STR);
$QUERY->bindParam(“dob”, $data[‘birthday’],\PDO::PARAM_STR);
$QUERY->bindParam(“email”, $data[’email’],\PDO::PARAM_STR);
$QUERY->bindParam(“phone”, $data[‘phone’],\PDO::PARAM_STR);
$QUERY->bindParam(“client_notes”, $data[‘clientnote’],\PDO::PARAM_STR);
$QUERY->bindParam(“objectId”, $client_id[0],\PDO::PARAM_STR);
$QUERY->execute();
return response()->json([
‘client_id’ => $client_id[0],
‘message’ => ‘success’
]);
}
basic laravel:
public function updateUserDetails(Request $request, $id)
{
$this->validate($request, [
‘first_name’ => ‘required|min:2’,
‘last_name’ => ‘required|min:2′,
’email’ => ‘required|email|unique:users,id,’.$id,
‘phone_no’ => ‘required’,
‘birthday’ => ‘required|date’,
‘roles’=> ‘required’
]);
$user = Sentinel::findById($id);
$updates = [
‘first_name’ => $request->first_name,
‘last_name’ => $request->last_name,
’email’ => $request->email,
‘phone_no’ => $request->phone_no,
‘birthday’ => $request->birthday
];
$user = Sentinel::update($user, $updates);
return redirect(‘/super/users’);
}
jquery
jQuery(“#tab11 .col-lg-3.col-md-3.col-sm-12.nopadding a”).each(function() {
var textlimit = jQuery(this).text().replace(/^(.{20}[^\s]*).*/, “$1”) + “…”;
//var textlimit = jQuery(this).text().substring(0, 65) + “…”;
textlimit = textlimit.replace(“(moreā¦)”, “”);
jQuery(this).text(textlimit);
});
jQuery(‘body’).keypress(function(e) {
if (e.keyCode == 27) { // escape key maps to keycode `27`
jQuery(“.request-form-container”).hide(200);
jQuery(“.page-template-contact-us-template .buttons-div”).show(200);
jQuery(“body”).css(“overflow-x”, “”);
}
});
// 2. This code loads the IFrame Player API code asynchronously.
// 3. This function creates an (and YouTube player)
// after the API code downloads.
var player;
function onPlayerReady(event) {
//event.target.playVideo();
}
// 5. The API calls this function when the player’s state changes.
// The function indicates that when playing a video (state=1),
// the player should play for six seconds and then stop.
var done = false;
function onPlayerStateChange(event) {
if (event.data == YT.PlayerState.PLAYING && !done) {
setTimeout(stopVideo, 38000);
done = true;
}
}
function stopVideo() {
player.stopVideo();
}
function onYouTubePlayerAPIReady() {
player = new YT.Player(‘player’, {
height: ‘360’,
width: ‘640’,
videoId: ‘IJ4BFjOMnpg’,
events: {
‘onReady’: onPlayerReady,
‘onStateChange’: onPlayerStateChange
}
});
}
$(‘#notify [value=selectvalname]’).attr(‘selected’,’selected’);
$(“input[name=gender][value=name]”).attr(‘checked’, ‘checked’);
private function custom_date_diff($previous_date){
$fdate = $previous_date;
$tdate = Carbon::now()->toDateTimeString();
$datetime1 = new \DateTime($fdate);
$datetime2 = new \DateTime($tdate);
$interval = $datetime1->diff($datetime2);
$hours = $interval->h;//now do whatever you like with $hours
$days = $interval->format(‘%a’);//now do whatever you like with $days
return $hours;
}
==use in view===
toDateTimeString();
$datetime1 = new \DateTime($fdate);
$datetime2 = new \DateTime($tdate);
$interval = $datetime1->diff($datetime2);
echo $hours = $interval->h;//now do whatever you like with $hours
//echo $days = $interval->format(‘%a’);//now do whatever you like with $days
?>
Am yet to try this option, i have had quiet alot of trouble working with .htaccess in my previous web site, where turning it on messes with my everything and pages fail to load correctly.
Hi Newtoxtox, are you doing this in core php? Show me your page error and coding. I will help you.
Thank you.