Posts by Romeu Gomes - Brasap • 119 points
34 posts
-
-1
votes1
answer51
viewsA: Average
, ('OPR'/3 RESULT) THE MEDIAOPR Just add, the average calculation is total/factors if the average is always of the 3 factors, it is only divided by 3
-
-2
votes1
answer111
viewsA: Change volume of a WAV file to C
Actually the problem is not in C but in the concept of audio, when you change the amplitude, either through coding or through a sound table, you change the dynamics of the audio. When you amplified…
-
-4
votes1
answer486
viewsA: I am trying to create a function q generates 10000 random words with 3 to 5 characters, but only this passing a word
for (var j = 0; j < 10000 ; i++) { console.log(textoAleatorio()); } It lacked a looping like this, to call this function 10000 times, more still would be to greatly improve the dynamics, and…
javascriptanswered Romeu Gomes - Brasap 119 -
-3
votes1
answer350
viewsA: How to consume a Soap (do cadsus) api via javascript(Browser)?
By the error message shown, a header is missing, Access-Control-Allow-Origin adds: xmlhttp.setRequestHeader('Accept', '*/*'); xmlhttp.setRequestHeader('Access-Control-Allow-Origin', '*');…
-
0
votes1
answer58
viewsA: DE_PARA SQL | Change table values based on information from another table
UPDATE Table 1 as t1, Table 2 as t2 SET t1.centrodecost = t2.newcentrodecost, WHERE t1.centrodecost = t2.centrodecost this would be the idea only fits there the correct names, because not all…
-
0
votes2
answers334
viewsA: Import excel spreadsheet with many records with php
If the problem is the runtime, and this is a single operation, that is, once imported it will not be necessary to re-do this import, you can simply increase the max_execution_time…
-
0
votes1
answer543
viewsA: Shortcut to create structure for a React component in Vscode
Vscode allows you to create your own shortcuts (scripts) and this structure described fits yes in a snippet that even contain variables (such as the name of smokes function, or the Imports, anyway,…
reactanswered Romeu Gomes - Brasap 119 -
0
votes1
answer67
viewsA: How to create encrypted requirements in the production environment?
I don’t understand, where the encryption is, from the images, you made a request to http://xxx.xxx.xxx.xxx:8000/Orders/create/modules/2 and this URL has been converted to…
-
0
votes1
answer38
viewsA: Improper return to login page during system session stay
the session_start() necessarily has to be defined before, of the code, this if placed: // Se não existir o id da sessão ou se a sessão não estiver aberta if (!session_id() || !isset($_SESSION)) {…
phpanswered Romeu Gomes - Brasap 119 -
-2
votes2
answers57
viewsA: Error when registering product
$result_usuario = "SELECT * FROM produ_usu WHERE id = '$id'"; replaced by $result_usuario = "SELECT * FROM produ_usu";
phpanswered Romeu Gomes - Brasap 119 -
-1
votes1
answer58
viewsA: Upload file (image), with PHP to send to AWS S3
$amazonS3 = new AmazonAwsS3; $directory = '/path/to/my/directory'; $scanned_directory = array_diff(scandir($directory), array('..', '.')); foreach($scanned_directory as $f){…
-
-1
votes2
answers43
viewsA: Possibility to search in one or more columns of the same SQL table
simple, before checking when you set the WHERE, put WHERE 1=1 ai ALL variables you use the AND, i.e., if any value does not exist, it will use WHERE 1=1 (always true and runs SQL), if any condition…
-
1
votes3
answers401
viewsA: Check CPF and Email fields before sending to the database (PHP)
Hi, so that there is never a REPEATED CPF, you should leave in the BD the column as UNIQUE KEY (UNIQUE KEY) in this way, you would not need to test in the bank with this select, the BD itself would…
-
0
votes3
answers71
viewsA: How to work with files and database in a way that is possible to consist
The ideal is for you to generate in the system a UID (unique id) and save this image in the directory with this UID, to avoid that pages saved in cache do not update the image when in fact the image…
-
0
votes2
answers28
viewsA: Text Exchange Read More for a Static Image - Wordpress
return '<a class="more-link" href="' . get_permalink() . '">Your Read More Link Text</a>' replaces that line with: return '<a class="more-link" href="' . get_permalink() .…
-
-5
votes2
answers154
viewsA: Is it possible to condition an operator += in a ternary?
In fact, just put the obj["op1"] += valor; if it does not exist, it has no value and will assume the value only of the variable.
-
0
votes1
answer664
viewsA: Redirect with . htaccess, from www folder to public project folder
In your example, Rewriterule is correct, if it does not find the file in the current directory, it will direct to index.php and the url will receive all the content of the original request. HOWEVER,…
-
-7
votes4
answers2034
viewsA: Does React affect SEO?
The basic thing about HTTP is that it’s a protocol for text exchange, and links like nodes(nodes). HTTP works as a request-response protocol in the client-server computational model, based on this…
-
0
votes1
answer252
viewsA: List data files using PHP-mysql
Using filesystem DATA, that is the date the server created the file in this method is not possible since the dir() function returns only the filenames. You’d have to do: echo "<td>"; echo date…
-
0
votes2
answers824
viewsA: PDO - Problem with Fetchall
gives a print of phpinfo() at the part where is the PDO and pdo_mysqlnd or any other that you are using to "connect" the Pdo to mysql; if you are sure that it is multiquery, add the line:…
-
-2
votes2
answers215
viewsA: Error in php if, login authentication system
I believe that the code is more for didactic purposes, if as the colleague above said, he is facing attacks not only of SQL Injection. But for comparison, use the SQL search already returning only…
-
-1
votes2
answers108
viewsA: Account with received data and mysql data
For this situation to work, replace this line: mysqli_fetch_array($result); for mysqli_fetch_assoc($result); This way the array key will be returned by the value of the field name (price) as it came…
-
0
votes1
answer692
viewsA: How to display saved images in the bank?
echo '<img src="'.$row['nome_imagem'].'">'; or if you need to set the full path of the image echo '<img src="./path/'.$row['nome_imagem'].'">'; or even the absolute way echo '<img…
-
1
votes1
answer33
viewsA: How to send the respective messages to emails coming from the php database?
Hello, actually you’re not giving the echo out of the loop, but sending only the last loop code. The code of $mail->Send() and its respective IF must be inside the while loop. In reality it is…
-
1
votes1
answer71
viewsA: IMAP does not show sender email
Hello, subistitui this code: echo 'De: '. $de =$overview[0]->from; echo '<br>'; by this code: echo 'De: '. $de =$overview[0]->from; $e=$header->from[0]; echo…
-
0
votes1
answer47
viewsA: Select in php recognizes only one variable
$query = "SELECT * FROM expedientes_diferenciados"; if ($result = $conexao->query($query)) { /* fetch object array */ $k=0; while ($obj = $result->fetch_object() and $k<2) {…
-
-1
votes3
answers98
viewsA: Create combinations with a specific quantity in a given set of numbers
$qtd = 5; $input = array(1,2,3,4,5,6,7,8,9,10,11,12); for($x=0;$x<$qtd;$x++){ $r = randon(0,count($input)); $rand[] = input[$r]; } asort($rand); foreach( $rand as…
-
1
votes1
answer39
viewsA: I cannot write to the PHP database
$fone = $POST['fone']; on this line, replaced by $fone = $_POST['fone']; Missing SUPERGLOBAL UNDERLINE $_POST[]
-
0
votes2
answers53
viewsA: Wrong Return Javascript and PHP
/** Marcas**/ $.getJSON(urlBase, function(data) { var items = ["<option value=\"\">ESCOLHA UMA MARCA</option>"]; $.each(data, function(key, val) { items += ("<option value='" +…
-
0
votes1
answer121
viewsA: How to Remove an image that is highlighted within the post
You will have to edit the THEME, or create a CHILD theme and edit the place onqe that, this positioning is set in the theme.
-
0
votes1
answer48
viewsA: Send html form with ajax to process form data with php and return to index.html
Do you need this PHP? As you can process this request directly through javascript, see this example code from VIACEP itself <html> <head> <title>ViaCEP Webservice</title>…
-
1
votes1
answer31
viewsA: Undefined index with PHP
field_quantity_table, there in HTML should be empty, because by error, the Dice is not available in the $_POST array; to debug, inserts print_r($_POST); before the include_once("connect.php"); in…
-
0
votes1
answer30
viewsA: Handle date format with PHP
In INPUT TYPE=DATE it is not possible, what you can do is use some datepicker in JQUERY or JS, in PHP it is possible when you receive the value, convert it with strtodate()
-
3
votes2
answers56
viewsA: How to decrease decimal numbers
var x = 9.656; x.toFixed(0); // returns 10 x.toFixed(2); // returns 9.66 x.toFixed(4); // returns 9.6560 x.toFixed(6); // returns 9.656000 If I understand correctly what you want to do is this no?…