Posts by Rapha Leão • 134 points
8 posts
-
1
votes1
answer2879
viewsA: Read txt file and save to PHP array
So, a short explanation of each line so that you can situate yourself in the code itself: <?php // Aqui você abre e lê o arquivo $arquivo = fopen ('arq.txt', 'r'); // Aqui você está definindo que…
-
0
votes1
answer143
viewsA: Listing in indication system
'Cause then, in your case, I think it would be good for you to wear a INNER JOIN, in case there is a positive result in your query... Which would be in the case so: SELECT * FROM clientes t1 INNER…
phpanswered Rapha Leão 134 -
1
votes1
answer88
viewsA: Update filter of a table based on information from another table
You could just be doing a LEFT JOIN and checking if he is NULL in the end... It would be something +/- that way: UPDATE reservas t1 LEFT JOIN administracao t2 ON t2.cod = t1.cod1 SET…
-
3
votes2
answers199
viewsA: Put only 1x popup every 24h per user
It’s not entirely wrong your way of handling, but you’d better do it in a simpler way like this: if (document.cookie.indexOf("popupShown=true") == -1) { document.cookie = "popupShown=true;…
javascriptanswered Rapha Leão 134 -
0
votes1
answer241
viewsA: Calculate percentage in real time
So in order to do this, you would have to rely on Javascript as well, because HTML is just a markup language and you can’t/can’t make code let’s say, "logical" in your language. Seen this, basically…
javascriptanswered Rapha Leão 134 -
1
votes1
answer119
viewsA: Use filter_input with array_filter($_POST)
Okay, so let’s assume you’re using architecture MVC, let’s follow the precepts of it... Supposing the call of $_POST is in the Controller, basically we’ll just turn him into a array() and the rest…
phpanswered Rapha Leão 134 -
0
votes1
answer51
viewsA: separate array and query in bd
So there is a way to use by the query itself Mysqli, because you just query and list the table servicos to obtain the result nome. So we can simplify your code by transforming the query servicos in…
-
2
votes1
answer665
viewsA: When to use filter_input() PHP
So my dear, first good morning! As you have visited PHP documentation, I’m just going to take a quick brush stroke for each item you mentioned in the topic. 1.- The filter_input() we can say that it…
phpanswered Rapha Leão 134