Posts by Wendler • 508 points
60 posts
-
0
votes1
answer264
viewsQ: Run PHP function after reCAPTCHA validation
I am working on a script that queries an external API that returns the data in json, I am making the consultation using ajax, but I’m facing some security issues. The query works perfectly, I just…
-
0
votes1
answer629
viewsQ: Limit JSON requests made in an API
I am creating a mini API to make queries on json using ajax, and I’m facing some security issues. The API is already ready and is returning the data correctly. The problem is in the file that makes…
-
-1
votes1
answer61
views -
0
votes1
answer87
viewsQ: Simplify and unify functions into one
How can I simplify and leave everything in a single function the script below? var plano_0 = new XMLHttpRequest(); plano_0.open('GET', 'buscar_valor.php?id=10', false); plano_0.send(null);…
-
0
votes1
answer39
viewsQ: Function to get text value from a accessed URL
I tried to create a small function: $(document).ready(function(){ var value0; $.get( "file.php?id=1", function(data){ value0 = data; }); arrayAmount[0]=value0; var value1; $.get( "file.php?id=2",…
-
0
votes1
answer120
viewsQ: Get JSON return from a URL within the function
I have the following function: $(document).ready(function(){ arrayAmount[0]='29.90'; } I need, instead of specifying the value directly there (29.90), it gets the value of a URL. Ex:…
-
1
votes1
answer153
viewsQ: Typeerror: $.event.props is Undefined
I have a slider like this for example: http://themes.audemedia.com/html/servereast/vps-slider-6-plans.html In my case it is presenting the following error in the console when I click on the…
-
0
votes1
answer82
viewsQ: Open link in new tab directly in the Ink array
How can I apply the attribute target=_blank directly in the array below? arrayLink[1]="https://url/cart.php?a=add&pid=00"; I can’t apply to HTML. Follow function executed via onclick: function…
-
0
votes1
answer52
viewsQ: Run function for multiple items in JS
I have a function that is responsible for updating the values in some <div>, follows script: file js. window.onload = function makeRequest() { var xmlHttp = new XMLHttpRequest();…
-
0
votes1
answer92
viewsQ: Get value returned in a JS URL
I need to create a very simple script that makes a small calculation. I have a URL that returns a value in the following format: 10.00, something like this: https://domain/api/products.php?…
-
0
votes2
answers36
viewsQ: Problem with running CSS animation
I made an animation in CSS, but it stopped working. Where is the error? HTML/CSS #loading { background-color: #0e5077; height: 100%; width: 100%; position: fixed; z-index: 99; margin-top: 0px; top:…
-
1
votes0
answers65
viewsQ: Convert currency to 1,000.00 format
I am using a custom script that prints the value of the coin with comma, but this inserting point in the case of thousands. Currently he prints like this: 1000.00 I need him to print that way:…
-
0
votes2
answers188
viewsQ: Create multiple PHP variables in the same function
I need a very simple function, but I couldn’t find anything related in my research. I need a function where I can insert items, and then print these items on another page. Ex: function funcaoExibe()…
-
1
votes1
answer348
views -
2
votes1
answer348
views -
1
votes2
answers74
viewsQ: Update object values via GET without repetition
To working on a plane table, which has a script with multiple objects, thus: var plano_basicoUS = { 1: null, // mensal 2: null, // trimestral 3: null, // semestral 4: null, // anual }; var…
-
0
votes1
answer375
viewsQ: Convert PHP functions to Javascript
I need to convert some functions in PHP to JS, because I will need to put all these functions inside a file . js. I currently have the following in PHP: $basicoUS_mensal=processaValor("url_aqui");…
-
1
votes1
answer257
viewsQ: Change values according to selected option
I have a table of plans here, and in it I had 5 columns, for 5 planes obviously. In each column there is a select to choose the periodicity of each plan. According to the option selected in this…
-
0
votes2
answers74
viewsQ: Motrar value of file_get_contents but only what is in quotes
Follows code: <? $url="url_aqui"; $result = file_get_contents($url); ?> The variable $result returns the value exactly this way: document.write('11,90'); I need to take only the value that is…
-
2
votes1
answer169
viewsQ: Questions with anchor link
I created a script as follows: <script> $(function() { $('#mostrar_planos').bind('click',function(event){ var $anchor = $(this); $('html, body').stop().animate({scrollTop:…
-
0
votes1
answer2571
viewsQ: Reset AUTO INCREMENT and organize item ID
What command can I use to rearrange the ID of all items in a table? The table name is produtos and the column is id. Currently they are this way: id: 1 - 3 - 7 - 8 - 9 - 11... That is, they are not…
-
-1
votes1
answer346
viewsQ: Delete records with multiple conditions
I need to delete duplicate entries in the column bidding_price with the following conditions: Table: bid_account Columns to be checked: id = PRIMARY KEY auction_id = ID of each product bidding_price…
-
-1
votes3
answers705
viewsQ: Avoid duplicate records in a particular Mysql column
I have an auction system where several users can bid, but I have a problem when bids occur at the same time, as they are entered in the database with the same value in the column bidding_price, ex:…
-
0
votes2
answers92
viewsA: Delete duplicate records in MYSQL
I was able to solve it this way: DELETE ba FROM bid_account ba JOIN (SELECT ba2.auction_id, ba2.bidding_price, MAX(ba2.id) as max_id FROM bid_account ba2 WHERE ba2.auction_id = ? GROUP BY…
-
0
votes1
answer68
viewsQ: PHP function in file_get_contents URL
I have the following code: $ws1 = file_get_contents('http://10.0.0.0:1111/bids/all/'.$obj->auction_id); How do I include one more bar (/) after $obj->id and put one more PHP code like this:…
-
0
votes2
answers92
viewsQ: Delete duplicate records in MYSQL
I am using a command that runs every second in Node.js. It has the function of deleting any record in duplicity for a particular item, which is specified as in the example by AND t1.auction_id =…
-
5
votes4
answers13421
viewsQ: Query INSERT with WHERE condition
How can I make an Insert with a Where condition? I have the following query: INSERT INTO `registro`(`id`, `username`) values ('','USER_1'), ('','USER_2'), ('','USER_3') It will add a new user to the…
-
1
votes2
answers545
viewsQ: Query DELETE taking too long to load
I’m having a problem with a query, it has the function of deleting some existing duplicate records in a table. Follows: DELETE t1 FROM bid_account t1 INNER JOIN bid_account t2 WHERE t1.id > t2.id…
-
1
votes2
answers1212
viewsQ: Only catch the year of a column in Mysql
I have a query that has a condition, which checks whether the record is greater than or equal to today’s date. He is like that: WHERE t1.bidpack_buy_date => NOW() Well, then he’ll check if the…
-
0
votes2
answers60
viewsQ: Trigger with column check
I need to make a Rigger in mysql, but I need it to be executed only when there is an update in the auctions, which change the status to 3 or 4. The way I did below is correct? It is of the type…
-
0
votes1
answer1443
viewsQ: Delete record by comparing values between two tables
I have two tables: produtos - id_produto valores - id_produto id_produto would be a column, equal for the two tables. I need to delete the records from the table values, but only those that are NOT…
-
0
votes1
answer45
viewsQ: Run Trigger according to the value of a column
I need this Rigger to run when there is an update in the table auction, but only when the column value auc_status is equal to 3. That is, so the value of auc_status is changed to 3, he must run the…
-
0
votes1
answer64
views -
0
votes2
answers1109
views -
1
votes3
answers1812
viewsQ: Pick up part of a URL with PHP Explode
How do I take only what is after ? and before &? $url = "https://www.dominio.com/login?erro=1&data=2018-03-06"; $url_cod = explode('?', $url); There he is returning everything that comes…
-
0
votes2
answers765
viewsQ: Update PHP function every second
I am using a function to get the server load: function get_server_cpu_usage(){ $load = sys_getloadavg(); return $load[1]; } I call her with: <div id="load"><?= get_server_cpu_usage();…
-
0
votes1
answer141
viewsQ: Perform three functions in the same setInterval
How can I perform three functions within the same setInterval, and for one the time to update should be different. I tried the following: function sleep(ms) { return new Promise(resolve =>…
javascriptasked Wendler 508 -
0
votes1
answer57
viewsQ: Rule to validate PHP value record
I have the following code: $newprice = $ob->pennyauction == 1 ? $oldprice + 0.01 : $oldprice + $plusprice; I need it to perform the following check, before displaying the value of $newprice. The…
-
1
votes1
answer51
viewsQ: Uncaught Typeerror: JS function
Can help me understand where the mistake is? function atualizaLista(id_leilao) { if (id_leilao) { $.ajax({ url: 'get.php', dataType: 'json', type: 'POST', data: 'id_leilao=' + id_leilao, global:…
javascriptasked Wendler 508 -
0
votes2
answers41
viewsQ: Update feathers function once when loading
I have the following script: function sleep(ms) { return new Promise(resolve => setTimeout(resolve, ms)); } async function update() { for($i=0;$i<300;$i++){ // a cada 300x (5min) faz um…
javascriptasked Wendler 508 -
0
votes0
answers177
viewsQ: Generate random number with repeat rule
I need an SQL command that generates a random number between 1 and 11, and that for number 1 is generated more often than others. Currently I use the following command: FLOOR(1 + (RAND() * 11)) It…
-
1
votes1
answer63
viewsQ: Problem with RAND in SQL
I am using Mysql "5.6.38-log - Mysql Community Server (GPL)" I have a trial that runs every second, and in it has a validation with a RAND: WHERE t.auc_due_time < GREATEST(LEAST(TRUNCATE(12 *…
-
0
votes1
answer57
viewsQ: Add values from a table
I have the following query: $qrysel = "select * from won_auctions w left join registration r on w.userid=r.id where payment_date!='0000-00-00 00:00:00'"; This query will show a list of users of the…
-
0
votes2
answers62
viewsQ: WHERE SQL functions
I have the following query: $qrysel = "select * from won_auctions w left join registration r on w.userid=r.id where xxx; This query will show a list of users of the table won_auctions and take the…
-
1
votes1
answer40
viewsQ: Return "Alert" if an IF is not executed
How can I check whether an if was executed or not, and whether it was not it to display an Alert? Take the example: if ($newtime!=0) { $qryupd = "update registration set dados=" . $dadosnew . "…
-
0
votes1
answer50
viewsQ: Problem with SQL (duplicate addition)
I have a bidding system that works with a robot giving automatic bids, and also with a button where the customer can bid. When the client clicks on the button, it calls a function that executes the…
-
2
votes1
answer91
viewsQ: Procedure SQL (run every second)
Can anyone explain me how this mysql command will work? SELECT @row := @row + 1 AS n_linha , m.* FROM (SELECT b.user_id as prox_user_id, t.auctionID, t.productID, t.auc_due_price+t.auc_plus_price AS…
-
0
votes2
answers1231
viewsQ: CSS3 Transform Skew (one corner)
It is possible to customize to leave as this image? https://s3.envato.com/files/127249204/screenshots/screenshot%20(114). png I found a solution, but it is not useful for me, because it was not the…
-
2
votes1
answer30
viewsQ: Doubt with SQL/PHP
I have the following query: $qrysel = "select * from pack"; $ressel = mysqli_query($db, $qrysel); $obj = mysqli_fetch_object($ressel); In html I have this: <?= $obj['pack_name']; ?> How could…
-
1
votes2
answers787
viewsQ: Reset option select
JS: function alterarStatusFunction(val){ if(val =="aprovado"){ if (confirm('Tem certeza que deseja alterar o status dessa transação para APROVADO?')) { document.formtransacoes.submit(); } else {…