Posts by João Victor • 787 points
65 posts
-
-1
votes2
answers126
viewsQ: PHP Exec Returning unknown characters when executing commands
I am running functions in Windows CMD through PHP in Exec function, but some returned values come as unknown character, mainly in accents, how to proceed to fix? Commando: exec('dir "C:\Users" /b',…
-
0
votes1
answer28
viewsQ: locate index where a value is within the limit of two values of the array
var current = 241; var array = [ { start: 236.6, end: 239.42000000000002, value: 'hello word' }, { start: 239.42000000000002, end: 243.58, value: 'bar' }, { start: 243.58, end: 246.12, value: 'X' }…
-
-1
votes2
answers184
viewsQ: Discover time interval
I’m trying to figure out the time interval between two strings with the strtotime. One has the complete temple and the other varies from minutes to hours, the problem is that when there are minutes,…
-
0
votes3
answers322
viewsA: how to take the value of the option that was chosen?
An idea would be to use onchange to set the variable as soon as the user moves the select var select = document.getElementById("cmbTempo"); var variavel = ''; select.onchange = function(){ variavel…
-
0
votes2
answers37
viewsQ: Use Regexiterator in directories to find folder or file
I’m not very good with regex and need a help to do a sort of search between files from part of the folder or file name that is at the end $find = 'oo'; $directory = 'd:\\test'; $search = new…
phpasked João Victor 787 -
1
votes2
answers213
viewsQ: Find letters in the middle of the preg_grep array
I’m really bad at doing this kind of research and I don’t have much idea how to do it, the way I did I can only locate the word if written in full if it’s in sequence (from start to finish). How can…
-
1
votes2
answers31
viewsQ: index() only for elements with a specific class
How can I use the index() just to know the location of the element between elements that share the same specific class? For example, I want index() to ignore all other classes except the class x:…
-
0
votes0
answers43
viewsQ: Is it possible to delete a user who is logged in?
Assuming the user is logged in through $_SESSION in the PHP and I want to delete your profile (through an administrative account) from the database, then it should lose its session in the next…
phpasked João Victor 787 -
1
votes3
answers178
viewsA: While php creating div
You don’t have to do the echo separating the elements thus, for example echo '<div>' . '</div>'; could just be echo '<div></div>'; that would serve in the same way and would…
-
1
votes1
answer41
viewsQ: Hide entire first elements until you don’t leave the div
I’m having a problem with css, I don’t know how to hide the first element (since it’s on float: rigth, it is the other way around) in full until they fit in the div leaving out. :root { --tema:…
-
0
votes1
answer356
viewsA: To update the output value in real time
Try to use the oninput directly in this way function: window.onload = function() { var inputTamanho = document.querySelector('[name=tamanho]'); var outputTamanho =…
-
0
votes1
answer59
viewsQ: Create address bar from a string
How can I make javascript to create an html address bar from a string? example: string: "D://Media/Musicas/" how I want it to stay <div class="address_bar"> <label> <button…
-
0
votes2
answers217
viewsA: List Folders and delete files within them at once
Try this: <?php function excluir($dir){ if(is_file($dir)){ return unlink($dir); }elseif(is_dir($dir)){ $files = array_diff(scandir($dir), array('.','..')); foreach ($files as $file){…
phpanswered João Victor 787 -
0
votes2
answers67
viewsA: How to overwrite an image using text that is not clickable?
Try using this on css tag that has text: -webkit-user-select: none; -moz-user-select: none; -ms-user-select: none; user-select: none; p { -webkit-user-select: none; -moz-user-select: none;…
-
0
votes1
answer51
viewsQ: Add "loading" animation to the canvas element while generating the image
How can I add a simple (any) "loading" animation to the center of the canvas tag that is created while generating the image? (Obs: canvas size may change) ; Below in the script it is generating…
-
1
votes1
answer122
viewsA: I need to save the value of a form after refresh
You can use $_SESSION from PHP, it would look something like this: <?php //na pagina onde é enviado os valores //Ativa as sessões. isso requer em todas que voce queira mostrar esses valores.…
phpanswered João Victor 787 -
2
votes1
answer52
viewsQ: How to detect access denied with PHP on Windows?
I’m listing Windows directories with scandir() of PHP and some directories like "System Volume Information", "Documents and Settings" among others have access denied to listing when trying to open,…
-
3
votes0
answers80
viewsQ: Detect if the folder or file is hidden or not in Windows with PHP
I’m listing Windows directories with scandir() of PHP, this way shows all items of the location, and would like to know if it is possible to check whether the folder or file displayed by PHP is…
-
1
votes1
answer1930
viewsA: Extract Direct Blogger URL (Token URL)
The url https://www.blogger.com/video-play.mp4?contentId=3506042769269f95 was a Google redirector that unfortunately no longer exists, the new links are coming in the model…
-
1
votes1
answer40
viewsQ: Set the margin side with jQuery
How can I get jQuery to define the side of margin to avoid the problem in the image? $('.case .show-opt').on('click', function(){…
-
3
votes1
answer196
viewsQ: preg_match_all to find text between strings
I’d like to pick up the text between "play_url":" and "," using PHP’s preg_match_all, only that these quotes are complicating me and I don’t even know what direction would be for the tracking code,…
phpasked João Victor 787 -
0
votes0
answers48
viewsQ: How to get a javascript variable from another page?
For example, on a page you have a script tag like this: <script>var X = "variável que quero pegar";</script> How could I get this variable "X" on another page just with the url of it and…
-
0
votes1
answer56
viewsQ: Pagination - icon of selected page always in the middle or visible
In my structure, I want to be responsive the selected page always be visible, if possible in the middle of her class and "active", and the other options are hidden, and may appear if the page width…
-
1
votes0
answers38
viewsQ: Query call in php hangs other queries
Because when doing a first query to a call and then trying to do another php hangs? For example, run this stored simple file in php DELIMITER $$ CREATE DEFINER=`root`@`localhost` PROCEDURE…
-
3
votes1
answer82
viewsQ: Is it possible to place an HMTL file within the data set?
It is possible to save an HTML file in a column BLOB inside the database and then display as part of the page in PHP? Why do this: it’s more of a learning experiment to compare whether it looks…
-
0
votes1
answer29
viewsQ: Tanning system with Stored Procedure
I’m trying to make a stored Precedent for a simple likes system, my table is organized like this: Likes id INT(11) - Auto Increment post INT(11) - foreign key (id - post) user INT(11) - foreign key…
-
0
votes1
answer108
viewsQ: Double INSERT no stored
Currently what I have is basically this: CREATE PROCEDURE `Teste`( IN `@valorX` INT, IN `@valorY` INT ) NOT DETERMINISTIC CONTAINS SQL SQL SECURITY DEFINER INSERT INTO tabelaX(colunaX) VALUES…
-
2
votes2
answers224
viewsQ: Condition for INSERT INTO
I need SQL to check that in the '@variable' sent there is a value equal to 1, 2 or 3; If true enter the value 1, otherwise enter the value 0. Note: the table and column can be given as examples as…
-
1
votes2
answers171
viewsA: Error #1064 in CREATE PROCEDURE - Phpmyadmin SQL
After I hit my head with it I realized I missed putting the IN CREATE PROCEDURE `SpRegistraMsgPosicionamento`( IN `@NumeroSerie` INT, IN `@Velocidade` TINYINT, IN `@Direcao` SMALLINT, IN `@Latitude`…
-
1
votes2
answers171
viewsQ: Error #1064 in CREATE PROCEDURE - Phpmyadmin SQL
Message from Phpmyadmin: Mensagens do MySQL : Documentação 1064 - Você tem um erro de sintaxe no seu SQL próximo a '@NumeroSerie INT(11), @Velocidade TINYINT(4), @Direcao SMALLINT(6), @Latit' na…
-
1
votes1
answer101
viewsA: COUNT with conditions and selection without WHERE at the end
SELECT COUNT(IF(tipo = 1, 1, NULL)) AS X, COUNT(IF(tipo = 2, 1, NULL)) AS W, SUM(CASE WHEN id_user = '$id_user' AND tipo = '1' THEN 1 WHEN id_user = '$id_user' AND tipo = '2' THEN 2 ELSE 0 END) AS…
-
1
votes1
answer101
viewsQ: COUNT with conditions and selection without WHERE at the end
In my table I have 3 columns: id(INT) auto increment tipo(INT): the values are 1 or 2 id_usuario(INT) I need a means without the WHERE at the end to know if there is a user-specific data, and if…
-
-1
votes1
answer44
viewsQ: Pick variables from the first 10 pages in descending order
We assume that in a folder there are 11 renamed files with numbers (1.php, 2.php... 11.php) and they all have variables with equal names but different values (1.php: var = "texto1"... 2.php: var =…
phpasked João Victor 787 -
0
votes2
answers325
viewsA: Picking up content within a tag
my solution: function run(link) { video.src = link.attr("href"); par = link.parent(); par.addClass("active").siblings().removeClass("active"); title = $("#playlist .active").text();…
javascriptanswered João Victor 787 -
-2
votes2
answers325
viewsQ: Picking up content within a tag
I have this playlist script, in it I wanted the name of the video selected in the playlist turns to P tag $(document).ready(function() { video = $("#video"); nome = $("#nome"); init(); function…
javascriptasked João Victor 787 -
0
votes1
answer125
viewsQ: Return a Javascript variable and the contents of PHP - AJAX
I want a script on ajax that on the page return me the content to write in a div and a variable to use in the link tag "A". <a href=" escrever a variável aqui Y ">volta</a> <br>…
-
0
votes1
answer31
viewsQ: Compares selected input file size with PHP disk_free_space
I need a javascript script to compare the selected file sizes on input with the disk_free_space (in my case disk_free_space('D:')") of PHP, but it has to be before sending to the page that uploads,…
-
2
votes1
answer374
viewsQ: Rename all files from the directory where you have "u0026" to "and"
I have more than two thousand files with "u0026" in the middle of the names (in this case it would be &) and I need a script that can without php or batch to rename all keeping the original name…
-
0
votes0
answers65
viewsQ: Error creating thumbnails in a list
You are pointing error in generateThumbnail and appendchild, I am trying to create thumbnails of each video, and their links are in the href of the tag a, I want you to create the canvas inside the…
javascriptasked João Victor 787 -
0
votes1
answer311
viewsQ: Creating thumbnails only with the video link
Is it possible to create a thumbnails just by using the javascript video link? Without having to use php, or other tools when I want to use it in Blogger, it’s a bit limited to this side. Link…
-
2
votes1
answer81
viewsQ: Problem when trying to download large files
I am using this code to download with php, small files works, now big as 1Gb end up getting corrupted. $arquivo = $_GET['nome']; //nome do Arquivo $local = $_GET['dir']; //pasta onde está o arquivo…
-
1
votes2
answers42
viewsQ: Block button if input’s of different names selected
I need help to make a small script that blocks the button, if you have input's with the nomes different selected, and allowing if they are equal, both cases with the same class, and also showing the…
javascriptasked João Victor 787 -
0
votes0
answers50
viewsQ: Get "waves" from the sound frequency or music in Streaming
I was looking at this other post (Link below at the end) in the community and it caught my attention, I tried to use for Streaming but simply not even the audio wanted to play, and I remember that…
-
1
votes2
answers145
viewsQ: Create array with AJAX and send to another PHP page
Is there any method of creating an array with AJAX to send the value of the selected input to another page where PHP will receive? there may be several input’s depending on the page, but page that…
-
0
votes1
answer145
viewsA: Specific hover for touch
My solution was this: window.onload = function(e){ x = document.getElementById('x'); x.addEventListener("touchstart", touch); x.addEventListener("touchend", touch); x.addEventListener("mousemove",…
-
0
votes1
answer145
viewsQ: Specific hover for touch
Is there a CSS hover for touch? Or emulate one with javascript that only turns on if it’s touch?
-
0
votes2
answers67
viewsQ: Check how many dates are equal
I need a help to know how many equal dates for PHP to present me with a number count, for example, "3 dates are equal", what I have of code so far is this: $hoje = '2018-07-02'; $datafinal =…
phpasked João Victor 787 -
1
votes1
answer29
viewsQ: Sum of two tables and display of results
I’m having problems with this section and I can’t solve " mysqli_fetch_array() expects Parameter 1 to be mysqli_result", $Valor = mysqli_query($conexao,"SELECT SUM(Y) AS TotalY AND SUM(X) AS TotalX…
-
1
votes2
answers958
viewsA: Websocket on localhost does not establish connection
The server has to stay on a port other than apache, by default it comes on 80, if your apache is on 80, change the server port to another, 8080 for example so there is no conflict, I think this…
-
2
votes1
answer46
viewsA: Websocket giving error in creation
It’s embarrassing, but I forgot to enable in PHP.ini the "Extension=sockets", after I took the point and comma and restarted the apache server, worked normally.