Questions tagged as 'if'

1
answer

Counters not being incremented in code

I'm having some difficulties with the code snippet below: The call to this function is: cache = OperaCache(true , endereco, op, cache, descricao, read_hits, read_misses, write_hits, write_misses); VETOR_CACHE OperaCache(bool conta...
asked by 23.11.2016 / 13:50
2
answers

How to make the site execute a code sequence with a certain user?

Good morning, I have an administrative access page for the ADMs of my site but have a part of the code in one of the pages, to create and modify users and passwords, which I would like to appear only when the user "TESTES" is connected on the pa...
asked by 15.10.2016 / 17:06
7
answers

How does this if / else work with "?" and ":"?

I am studying JavaScript and I have doubts about the different ways of doing if / else . For example, this: foo ? foo : foo How exactly does it work?     
asked by 08.02.2014 / 18:15
2
answers

What's the difference between Switch, Case and If, Else?

I would like to know the difference between switch .. case and if .. else . What offers better "performance"?     
asked by 13.04.2015 / 20:33
1
answer

Insert an "IF" with "DO" to validate _POST field

Gentlemen, can anyone help me with the code below? I need to put an IF before DO. I need to validate a _POST [so_server] variable. If it is Linux after the DO would put a form structure, ELSE put another form structure. Can you help? <?p...
asked by 24.02.2016 / 18:10
5
answers

Store IF result in a variable for later use

This code is in error when I call the variable $os : $os = (if($status_os_cliente == "A"){ echo "SIM"; } else{ echo "NÃO"; });     
asked by 13.11.2017 / 14:06
2
answers

Is it possible to have a ternary without the else block?

Is there a possibility to create a simpler if ternary, say without the else block code? how would it look? Type: if($total < 10){ $total_gerente = 10; } For what I know the ternary has IF and ELSE. Is it possible to only have the if...
asked by 11.07.2016 / 15:06
2
answers

Doubt with select in if

Good afternoon I was trying to adapt a code I already had here to be able to by a watermark on a photo. But there's plenty of time I do not deal with html or php. So could you guys give me this help to fix the problem of selecting the correct...
asked by 03.11.2016 / 19:02
1
answer

Null input via keyboard in a variable receipt via JavaScript

Good Night! In my practical experiences in JavaScript, I tried to create a condition to alert the user to a variable that he left unnoticed by pressing the enter key twice. However, trying to solve this problem, I made two attempts: /*Te...
asked by 11.12.2018 / 02:12
2
answers

How to create multiple variables of the same type without repeating conditions?

import java.util.ArrayList; import java.util.Scanner; class Main { public static void main(String[] args) { Categoria c1 = new Categoria(); c1.categoria = "-Reprodução"; c1.nome = "Ahmed Shafik"; c1.ano = "2016"; c1.justific...
asked by 12.09.2017 / 00:25