I have an urge to detect when a user leaves my site in order to record accurately the session length of the user in question. I have thought of a couple possible solutions for this: I first thought I could use onbeforeunload and send a simple ajax to record the last activity but what practice has shown me is …
Tag: php
Download tracks from Soundcloud via their API
I have around 1000 liked tracks on Soundcloud and I’d like to download the ones available for download. Is it possible to use the API to download these where a download option is available? Thanks …
Safely remove migration In Laravel
In Laravel, there appears to be a command for creating a migration, but not removing. Create migration command: If I want to delete the migration, can I just safely delete the corresponding migrations file within the database/migrations folder? Migrations file: Answer I accidentally created a migration with a…
PHP: stream remote pdf to client browser
there’s a pdf generated on an external service and I would like to stream the pdf to the browser in my php server while streaming to client so that I don’t need to download the pdf from the remote file and then start initializing download. I would just have the file immediately download or stream …
Select box Onchange: autosubmit() option with php
So it’s like I have a selectbox, with while loop as option as I want to bring out the options from database, is it possible to click on the option and link? The while loop is like this This is the select box But on clicking the option I want to link it to How can I do this? Answer
automatic login to wordpress dashboard from another site
I want to log in automatically to WP admin/dashboard from another site without going thru the login process.. I’ve tried the following but with no luck:
Laravel Add a new column to existing table in a migration
I can’t figure out how to add a new column to my existing database table using the Laravel framework. I tried to edit the migration file using… In terminal, I execute php artisan migrate:install and migrate. How do I add new columns? Answer To create a migration, you may use the migrate:make comma…
Getting an error using constants
I have a lot of pages, all of which require the file characters.php. This file contains constants which define many things in my website. They are defined like this, for example: const $humanHEALTH = …
Build documentation from PHP code
I heard that the .NET manual was built from code and the most important parts have manually been improved later. Googleing has not turned up with anything so far. Most of the stuff I found wore …
I just can’t destroy a session in php
When I logout by destroying the session and start another one it always shows me the first session info I started $_SESSION[‘username’]; What I mean here is that : I started a session the first time I logged with this username –> AAAAAA And destroyed the session using the file logout.php …