Questions tagged as 'php'

2
answers

Set css with php according to browser

Earlier today I did this question. What I need to know is how I can do something like this: Check whether the browser is Safari or not. If it is, section#internal.services aside ul li a should receive this css: CSS...
asked by 17.07.2015 / 20:50
2
answers

How to avoid multiple inserts in the database

Hello, I would like to know how I can use php to avoid adding the same item to a database on a save page that adds the names of subcategories if I update the browser. Since I can not use the Unique in the subcategory table in the name field,...
asked by 21.07.2015 / 13:54
1
answer

Now () MySQL does not display the correct time

I need some way to insert the EXATA time from the server who sends a message to the database. I'musingtheNOW()functiontoregisterthemoment:"INSERT INTO 'chat' (id_de, id_para, data, mensagem, hora) VALUES('$id_de','$id_para',NOW(),'$mensagem...
asked by 14.07.2015 / 13:51
1
answer

How to ignore an exception in php? [closed]

I am consuming a method of a legacy system that generates scanning of some FTP directories and searching for files. However, if it accesses a directory that does not have files, it throws an exception. Is there any way I can use this method, but...
asked by 16.09.2015 / 17:28
1
answer

I can not search the words in brackets in php

I've created a function to check if some words exist in an array. I want to do the word search inside brackets "[]". Example: [as], [dar], [amar] ... For this, I'm using the preg_match () function to check if any of the words in the array exi...
asked by 28.08.2015 / 00:31
1
answer

JavaScript with ajax, function return. Because it does not work?

I made a JavaScript code to enable some buttons and inputs in a FORM, according to the user's permission, stored in a SESSION. It had done so: function showEditButtons() { if ( verUserPermissions(8) === true ) { btnConfirma.styl...
asked by 31.08.2015 / 17:07
3
answers

Split array and sort

I have an array as follows: 'Ato001_1981', 'Ato002_1980', 'Ato003_1982', 'Ato003_1983', 'Ato004_1982', 'Ato013_1981', 'Ato013_1982', 'Ato013_1988', 'Ato031_1982', 'Ato032_1979', 'Ato039_1988', 'Ato060_1987', 'Ato065_1988', 'Ato066_1988', 'Ato0...
asked by 18.09.2015 / 15:02
1
answer

Should I avoid injecting "%" into a query where I use "LIKE"?

I have a page where I consult the user through the name. The query aims to use LIKE to capture the user name from the first letter onwards. So I do the query this way SELECT * FROM usuarios WHERE nome LIKE 'Gu%' I'm using Larav...
asked by 17.09.2015 / 17:07
2
answers

Retrieve information combobox PHP

I want to insert the contents of the combobox into the database via POST, but I can not. Here is the snippet of the combobox, which pulls the data from a table <select name="cmbtimes"> <?php //pegando os dados while($dados = my...
asked by 08.09.2015 / 20:42
2
answers

Why does the function return an unexpected value?

Why is this function returning me "disapproved"? $nFis = 90 function resFis(){ if($nFis >= 60){ return "aprovado"; } else{ return "reprovado"; } }     
asked by 02.10.2015 / 20:49