Categories
PHP

redirecting urls of a certain pattern to another site

I have a website. The root directory of my site in cpanel was like this: http://www.example.com/b. But, I have changed my root directory to http://www.example.com/s. Now I want to redirect every url of the pattern like http://www.example.com/b, www/example.com/b/c/text/php etc. to this url: http://www.example.com/s. Is there any way to do this in cpanel?

Categories
PHP

Where do I find the file in wordpress /PHP project that I can edit the menu?

I have project which was done in php. But I couldn’t find the menu bar. In inspect element I find that it comes from navigation.html. But I couldn’t find this file. Can any one help me with this? Thank you!

Categories
PHP

How to compare variables correctly?

How to compare variables correctly? if ($adults->name >= $data[‘adults’] && $adults->name !== ‘Adults’)

Categories
PHP

Change default redirect after login in Laravel 5.6

I am beginner in laravel. i’m using udemy videos to learn laravel. I wanna to change default redirect after login. I change route to Route::group([‘prefix’ => ‘admin’, ‘middleware’ => ‘auth’],function (){ Route::get(‘/home’, ‘HomeController@index’)->name(‘home’); }); and in Http/Middleware/RedirectIfAuthenticated.php public function handle($request, Closure $next, $guard = null) { if (Auth::guard($guard)->check()) { return redirect(‘/admin/home’); } return $next($request); } […]

Categories
PHP

Put div in Woocommerce single-product page

I need to do some styling to the Woocommerce single product page: I need a border around the price(which I moved above the add to cart button), in stock status, add to cart button and meta data. So basically a visual border around these items: https://postimg.cc/image/jp6e1hpa9/ Since they are not in one specific div, I […]

Categories
PHP

PHP array_merge nulls array

I’m trying to populate existing array with found values from another array. Code looks like: $aAttachmentsList = array(); foreach($aAttachments as $sAttachment) { foreach ($oDocumentManifestEntry as $property => $value) { $aAttachmentsList = $aAttachmentsList + $value->content; } } where the content can looks like [ { “attachment”: { “url”: “Binary/1848766036104970”, “title”: “Test” } }, { “attachment”: { […]

Categories
PHP

Isn’t there any way to solve CSRF perfectly?

If you want to use HTTP_REFERER to validate, the hacker can forge it. If you want to use CSRF token to solve CSRF, the hacker can use cURL to get the CSRF token and can also get the cookie of response by cURL. So isn’t there any perfect solution to solve CSRF?

Categories
PHP

Deploy Laravel project to hosting

I downloaded repo and I am trying to deploy it on host. I moved files on serwer. Root looks like this: ROOT- –lsapp —app —bootstrap —config —database —resources —routes —storage … –public_html —css —fonts —js —vendor —index.php … In my public_html/index.php i have : require __DIR__.’/../lsapp/bootstrap/autoload.php’; $app = require_once __DIR__.’/../lsapp/bootstrap/app.php’; but i have an error: […]

Categories
PHP

OWL ontologies on the cloud

My goal is to make a web application that imports an owl ontology that we created in e.g. protege that represents a learning domain e.g. “Math”. The admin of the web app will then create lessons/learning targets using a subset of that ontology (for example “multiplication of 2 integer numbers”). What tools will allow me […]

Categories
PHP

Adding my custom post type as its own menu item in WordPress Dashboard

I am currently building a Website for a company with multiple locations. Using the WordPress Multi-site system I have everything functioning as needed. I now have created an area for Location Information. This is things like address, phone, etc. I am using ACF to create this area. There is a custom post type I created […]