Skip to content

Tag: php

PHP to serve download for a Java application

I am wondering how to make a download server more robust. For now, I have a server, on https, storing zip files, named with a random hash, indexed by my database. The directory containing does not permit listing (htaccess) to avoid manual download directly browsing the directory on the server. The Java app di…

Displaying BLOB image from Mysql database into dynamic div in html

I have a BLOB image that is stored when the user submits an advert form, they have the choice of uploading one image. The image is stored in the database with the other information. Every time my page loads it dynamically creates the advert divs and also fills in the matching information from my database into…

php try catch not working properly

I have code like this: and problem is that, when file_get_contents can not read url (may be site not responding or something like this..) my code writes error: failed to open stream: HTTP request failed! and execution goes direct to finally block bypass catch block without entering in it.. any ideas? Answer Y…

How do I get a list of all models in Laravel?

I would like to find a list of all models, database tables as a backup, in a Laravel project. I want to do this to build a dashboard that displays the way data in all of the models has changed over time, I.E. if there is a user model, how many users have been added or modified each day for

How to escape Twig like variables on JS

I need to escape some JS twig-like variables in a twig template, but I couldn’t find anything about how to do that. This variables are used in a js templating plugin that uses the same pattern as twig for variables which is causing the twig rendering to fail Unexpected token “punctuation” of…