Questions tagged as 'php'

1
answer

Verify that the completed email already exists in the database without refresh

I need to fill in an email in the email field, search the database and return a message telling me if this email is already registered in the database. We developed jQuery + PHP according to the answers posted in a question that we sent, but in...
asked by 26.07.2015 / 01:47
2
answers

How to escape the percent character (%) in LIKE?

I have a system where I use Laravel to query the database. This is a search form. I use the following code: $search = trim(Input::get('search')); return Empresa::where('nome_fantasia', 'LIKE', $search)->get(); The problem is t...
asked by 16.02.2016 / 19:53
2
answers

How to find out which extensions are installed in my PHP?

Is there any way to find out which extensions are installed in my PHP? I already know I can do it with phpinfo , but I find it confusing to view. Is there a simpler way, that is, only the lists of installed extensions?     
asked by 05.01.2016 / 14:49
1
answer

How to serialize an exception with closure

I'm trying to serialize the exceptions generated by errors to write a log with all the information, but the problem is that some exceptions may come with a closure within the trace and trigger the message below:   Uncaught exception...
asked by 17.11.2014 / 19:16
2
answers

How to make a mysql query from an array coming from html?

I know that $cores returns me the values of the form. What is the best way to query the database with the $cores array values to find the cars that are present in that color? <?php //PHP if(isset($_POST['env...
asked by 05.09.2014 / 23:24
3
answers

Use PHP variable in JS file

I want to put PHP code in a JavaScript file, it is not an HTML file. Like for example here: document.getElementById('lbljour').innerHTML = "Jour " + date_today; With the PHP code would it be something like this? document.getElementByI...
asked by 24.10.2014 / 11:29
1
answer

What status can I return in an attempt to submit a form without a TOKEN?

I'd like to know what status http I should return in my application if someone is trying to forge a request via form. The application I developed is done in Laravel 4 and I'm using that CSRF_TOKEN . The CSRF_TOKEN...
asked by 13.02.2015 / 14:02
2
answers

Write in image with php

I'm trying to print online certificates dynamically populated with PHP. The code I'm using is: class Certificado { public $nome_para_certificado = ''; public $modelo_de_certificado = ''; function __construct($nome) {...
asked by 20.09.2015 / 10:58
1
answer

How to generate PDF contract using PHP directly?

I need to generate a contract, which will come from an HTML form, whose data will be processed by a PHP. I need the user-entered data to appear in the contract and this contract is generated in PDF. Is it possible to generate the entire co...
asked by 07.09.2014 / 20:13
3
answers

Detect browser language and redirect

I'm using Wordpress and wanted to redirect my page to the "/ br /", "/ es /" versions when the browser language is one of those and when it does not stay on the default page, which is the ".com ". I tried to use this code, but it did not work...
asked by 11.11.2015 / 21:41