I’m getting some strange permissions problems. I’m using Laravel on a vagrant box. I regularly have to reset my app/storage permissions. Here’s my process: in terminal, run sudo chmod -R 777 app/…
Tag: php
Replace number and email with XXXX in a sentence using jQuery
I’d like to replace the numbers and email from the sentences. Example $message = “Hi this is john, my personal no is 1213456789 and my email address is john@gmail.com”. Output: Hi this is john, my personal no is 1213456789 and my email address is john@gmail.com I want the Output to be like t…
Laravel Shared Hosting .htaccess
I am trying to deploy a Laravel project onto a share hosting, I’ve managed to get most of the hard work done but I cannot strip off the /public directory without a Forbidden issue. The website works and shows same pages for these links www.mywebsite.com/test/index.php www.mywebsite.com/test/public/ But …
Datepicker in wrong position
I am developing an php aplication and I used datepicker javascript. The problem with this is that if I scroll down it does not appear in the right position. It gets really bad if the page gets too long, the date picker is not even visible. I am using IExplorer, it might be outdated. It is not a solution to
Remove/Redirect index.php from url to prevent duplicate urls
Please read the question carefully before marking as duplicate. We all know, that using in .htaccess: RewriteCond %{REQUEST_FILENAME} !-d RewriteCond %{REQUEST_FILENAME} !-f RewriteRule ^ index.php […
How do I use @media queries in PHP?
I’m trying to add a width-responsive element to a client’s page. The website was made in PHP, which I’m not familiar with. I believe he’s also using WordPress (which I’m also not familiar with). …
Pretty URLs with .htaccess
I have a URL http://localhost/index.php?user=1. When I add this .htaccess file I will be now allowed to use http://localhost/user/1 link. But how about http://localhost/index.php?user=1&action=update how can I make it into http://localhost/user/1/update ? Also how can I make this url http://localhost/user…
Array Intersection – only once
Newbie here, so I have a problem with the array_intersect function. I am comparing two arrays with intersection but I get some results twice. For example: 2 arrays $result = array_intersect($array1, $array2); This returns: But I want this: I want this to return apple and orange ONCE each. Currently it returns…
How can I run only one test from a suite?
I have this test class below, and I want to run only one test from it, for example the “aboutPage”. Any ideas how? This is how I run only this file: But now I want to run only one test from the file. Answer You simply append a colon and the function name, like this: or a shorter version: (Notice
How do i use conditional parameters in Laravel Auth::attempt?
Using Laravel 4.1.30 I got this following code which test a sign-in attempt via Auth. I like to implement a conditional value such as: I am using the active (field) as a level of authentication for users signing in. Anything above 0 (zero) should satisfy the next condition. How can it be done in one statement…