Posts by Vitor Leite • 141 points
25 posts
-
0
votes1
answer39
viewsQ: Autoplay in audio after consultation
I have a problem in my system. I happen to have a jQuery script that simply, after a database query, plays an audio in the browser. $('body').append('<embed src="audio/found.mp3" hidden="true"…
-
2
votes2
answers57
viewsQ: Manipulating data from Ajax
Whoa, guys. I have a page that receives JSON data from an Ajax request from so long, in this format: { "status":"success", "total":4, "0":{ "id_user":"11", "posicao":0, "nick":"Usuario",…
-
-2
votes1
answer145
viewsQ: Check if value is in a column
I need to check if a value is in a column in the comic book. My column is separated by commas, thus: 1,2,3,4,5. So I would like to know how to check if the value 2, for example, is in any row in the…
-
3
votes2
answers304
viewsQ: Sending data with ajax
I have a online chat that works with ajax and PHP. Yet, oddly enough, when I enter only one question (?) and sending the jQuery, returns an error in the console. The ajax gets into the error() and…
-
0
votes0
answers45
viewsQ: Open Graph and Meta tags
For some reason, the facebook Developer does not recognize the meta tags of my site, he even states, that there are metatags on <body> and I define them right after the <title> in the…
-
0
votes0
answers16
viewsQ: Manipulating dates with PHP
I need to subtract a date from another and show the result of this. However the result is sometimes not correct. For example: I subtract the date 2018-07-27 16:53 by 2018-07-27 16:51, the result…
phpasked Vitor Leite 141 -
0
votes0
answers33
viewsQ: Automate table fill
I have a table with the following structure: id - email - key_de_active I need to popular the key_de_active column with a random key (I already have the script to create this key), only it’s like,…
-
1
votes1
answer52
viewsQ: Help with logic in SELECT
I have a "matchmaking" script (like a game). He checks every 3 seconds a table, to see if there are 10 players who are not playing. Only that I also need to check if among these 10 players, one of…
-
-3
votes2
answers997
viewsQ: Upper and lower case in PHP
I’m having a somewhat unusual (or common I don’t know) problem. I have an e-mail registration field. The user adds an email, the system checks if the email already exists in the database, if not he…
phpasked Vitor Leite 141 -
0
votes3
answers64
viewsA: Difficulty when mounting SQL query
I used the Mysql FIND_IN_SET function Documentation for anyone who wants: https://www.w3schools.com/sql/func_mysql_find_in_set.asp…
-
0
votes3
answers64
viewsQ: Difficulty when mounting SQL query
Whoa, guys. I’m having difficulty to mount a query in Mysql. The thing is, I have a table with the following structure The time_orange and time_blue columns store system user ID’s. I need to search…
-
-1
votes2
answers390
viewsQ: Is that a bug in the PHP SWITCH?
I’m trying to make a switch in PHP, but it returns me some very strange values. For example, if the variable $xp is equal to 0, it returns to me that the level is 20. I don’t get it '-' switch($xp){…
-
0
votes0
answers23
viewsQ: JQUERY object with dynamic string
I have a for() that adds some elements in the div#chat_box according to the JSON returned in an AJAX. Only that I would like to see how many data-Identity elements equal to those returned in JSON…
-
0
votes0
answers30
viewsQ: JSON verification in JQUERY
I have an ajax chat on my website. However, sometimes messages are duplicated for reasons not relevant. Therefore, I would like to check if the messages I receive in JSON already exist in the chat,…
-
2
votes3
answers518
viewsQ: Remove JQUERY tags
I need to remove HTML tags from a variable, or else not interpret the HTML of that variable. The problem is that the variable has its value coming from an input, so: var msg = $('input').val();…
-
1
votes3
answers81
viewsA: HTML and AJAX problem
Analyzing the code I saw that I receive the Message in the MSG variable that has a filter_var(), this filter removes the html tags, etc. So, if I send an msg with only a "<", it removes this tag,…
-
1
votes3
answers81
viewsQ: HTML and AJAX problem
I have a chat that works with AJAX. However, depending on some characters that the user type, AJAX does not work, I do not know why, but it does not work. Therefore, I need to remove the HTML from…
-
0
votes1
answer24
viewsQ: JQUERY/JS code explanation
I needed to make an upload system, which when selecting the image, a preview would be shown in a box before it was sent. I saw a code here at Stackoverflow and I tried to adapt it. I would like to…
-
-1
votes1
answer489
viewsQ: Upload Ajax and PHP
I am trying to upload images via AJAX and PHP, but without success. Already reviewed, updated, anyway, the codes match all the other codes I researched, I really don’t understand. HTML: <form…
-
0
votes2
answers745
viewsQ: How to upload an image using ajax and PHP?
I’m trying to make a upload of images with AJAX and PHP, but I get no success and do not find the error. My code is: $('.arquivo').change(function() { var fileName = $(this)[0].files[0].name; var…
-
2
votes2
answers76
viewsQ: Handling of json in Jquery
I have the following one-page JSON return: { "0":{ "id_user":"10", "contente":"45454545454", "time":"azul", "nick":"ikeda." }, "1":{ "id_user":"10", "contente":"4", "time":"azul", "nick":"ikeda." },…
-
1
votes1
answer67
viewsQ: Setinterval and reset
I have a setInterval with an interval of 2 seconds. I need to stop this interval at a certain point and start it again with a new time. Scope I do an AJAX inside the setInterval. Just when the AJAX…
javascriptasked Vitor Leite 141 -
-2
votes1
answer59
viewsQ: Poll with PHP
10 users will answer a poll with 19 options equal to all, each answer is saved in the database in a table called 'votes' with the following structure: id: 1 - user_id: 1 - answer: {user response} I…
phpasked Vitor Leite 141 -
2
votes2
answers127
viewsQ: How to check if at least 1 checkbox has been selected?
$carrosbr = $_POST['carrosbr']; $carrosin = $_POST['carrosin']; $corp = $_POST['corp']; $houses = $_POST['houses']; $vip = $_POST['vip']; $skins = $_POST['skins']; $guns = $_POST['guns']; $bases =…
phpasked Vitor Leite 141 -
2
votes2
answers615
viewsQ: How to decode the following JSON? PHP
{ "data": { "app_id": "0000000", "scopes": [ "public_profile" ], "user_id": "00000000" } } I want to get the USER ID with json_decode. As caught?…