Skip to content

Tag: php

Symfony get connected user id from entity

In a Symfony2.8/Doctrine2 application, I need to store in each row of my SQL tables the id of the user who created or updated the row (users can connect with Ldap). So all my entities inherited of a GenericEntity which contains this variable (type would be string if I want to store Ldap username): And I use t…

How to set laravel 5.3 logout redirect path?

Is there no elegant solution to redirect to a specific page after logging out in Laravel 5.3? The function being called is from the trait AuthenticatesUsers: This is a default function from the core of laravel. So I have to override the whole function I cannot edit the core. But isn’t there a more simpl…

500 status code for symfony functional test

I’m performing a test just to see if a certain route is working. The page/route is found at http://localhost/login and when I go there in the browser it works fine and I’ve tested this with no cookies and my cache cleared. However, as soon as I test it in the phpunit LoginControllerTest class I re…

Escape a pdo query, is that necessary?

My question of to day is. Do i need to escape PDO in my script? $columns = implode(“, “,$column); $query = ”.$query.’ ‘.$columns.’ FROM ‘.$table.”; $dbh_query = $dbh->prepare($query); $dbh_query-…

How to send a SMS through PHP form?

I have one simple PHP form for sending SMS, I’m trying to send a SMS to one number but it gives me a success message “SMS has sent…” along with the error “Invalid Username/Password”. I manually …