Questions tagged as 'php'

2
answers

PHP - Latest Selection Question

Good, I created a cryp that shows all messages from the user limited to 3. My goal is for messages to show like this every time they're recent. MSG hora: 12:30 - OLA MSG hora: 12:31 - OLA MSG hora: 12:32 - OLA The problem...
asked by 28.05.2018 / 01:38
1
answer

Apache2 does not interpret PHP

I usually installed PHP and APACHE2 but it does not interpret the PHP code, follow test code: <?php echo "teste"; It returns me an "html" page with this typed, and comes from a "print" written test Files not found in the / var / www...
asked by 05.06.2018 / 17:47
3
answers

count the same database text in php

Good morning, my question is this: in my case I have a table in the database that allows to evaluate a service, the classification is made by colors "red, yellow and green", ie the type is text . What I wanted to do is query in...
asked by 07.06.2018 / 10:22
2
answers

Search with regular expressions

Hello, I would like your help with the following problem, which I have in this code. function verificarParametro($loopurl,$urlHost) { if (preg_match("/(\W|^){$urlHost}(\W|$)/i", $loopurl)) return true; else return false; It...
asked by 07.06.2018 / 20:29
1
answer

Run php within a javascript condition

Is it possible to run php within a javascript condition? Example: <script> if(variaveljs==2){ <?php $variavelphp=20; ?> } </script>     
asked by 08.06.2018 / 11:53
1
answer

Redirect to new page when error 404 occurs using Laravel 5.6

What is the correct way for Laravel 5.6 to redirect another route if it is 404 error? I created the resources / views / errors / folder and the 404.blade.php and it worked fine, but I do not want to display the error, I want it to be redi...
asked by 10.05.2018 / 19:38
1
answer

How to do insert 1 to 1, with four tables in laravel

I'm working with a database already populated. It has four tables ( Aluno , clinico , Familia and TipoCompulsao ), where Aluno receives foreignkey from the three tables; Model student class Aluno extends...
asked by 06.11.2018 / 14:50
1
answer

How to fix "Fatal error: Uncaught Error: Class' User not found"

I created this class (starting now with OOP) in the file Funcionarios.php , there it works: class Funcionario{ public $departamento; public $salario; public $dataEntrada; public $cpf; public function recebeAumento(){...
asked by 06.11.2018 / 02:19
1
answer

Regex for repeated numbers in the CNPJ

I have the following regular expression: regex:/^\d{2}\.\d{3}\.\d{3}\/\d{4}\-\d{2}$/ I can validate for this, but not for repeated numbers. I want to apply within this regex, a form that does not accept repeated values, for example:...
asked by 01.11.2018 / 14:11
1
answer

Save input data without submitting

My problem is that I am doing a business registration, in this register I have the field Activity branch that has a combo with the branches of activities registered in the database, the problem is when we have to include a new branch of activiti...
asked by 14.11.2018 / 12:25