Posts by sNniffer • 1,009 points
131 posts
-
1
votes1
answer23
viewsA: Capture PHP Image Compression Quality Level
Solved $img = new Imagick(); $img->readImage( $local_da_imagem ); echo $img->getImageCompressionQuality() ; Thus the level of image quality is returned, going from 0 to 100, the higher, the…
-
0
votes1
answer23
viewsQ: Capture PHP Image Compression Quality Level
I need to capture the quality level of an image, I found something relative in [Imagick][1] Attempted use: $img = new Imagick(); $img->readImage( $local_da_imagem ); print_r(…
-
0
votes3
answers400
viewsA: Block sequences of input numbers
Solulção: $('#texto').keyup(function(){ var reg = /((?:[1-9]\s*){7})/g; var texto = $(this).val(); var result = texto.replace(reg,"********") ; $("#texto").val( result ); }); <script…
-
1
votes3
answers400
viewsQ: Block sequences of input numbers
Do not allow the filling of numbers in sequence with spaces or without spaces, to avoid adding phone numbers. Avoid sequences such as: 99999999999 99 9 9999 9999 and any other number having more…
-
1
votes1
answer57
viewsQ: Grab image data-src open in lightGallery
I need to get the data-src of the gallery’s open item, as the user advances the photos in the gallery, an input should be updated. <div class="item " data-src="assets/img/tour/-11521134609.jpg"…
-
1
votes4
answers307
viewsQ: Div hover change color in other elements
Something that seems simple, I need to change the color of the text of an H2 and a div, in the Hover of another div. https://codepen.io/sNniffer/pen/jXdbeE .icone_verde { background:green;…
-
0
votes0
answers157
viewsQ: Xmlhttprequest access blocked by CORS policy
I’m doing a post this way; $.post("_checa.php", { inst: 'val' }, function(data) { console.log(data); }); It is working normal if use on http, but when switching to https, I have the return: Access…
-
3
votes1
answer646
viewsQ: Div with Onclick but not in its jquery elements
I have a div and in it some elemtos, this div needs to be clickable and that your click will do an action, but, its elements that some are Buttons also have own actions,what happens is that when I…
javascriptasked sNniffer 1,009 -
1
votes2
answers79
viewsA: Identify days of the month from PHP week number
Sum 7 days to current date: date('d/m/Y', strtotime('+7 days')); And add 7 days to each generated date: echo date('d/m/Y', strtotime('+7 days', strtotime('18-10-2018')));…
-
0
votes3
answers84
viewsA: scrollTop in Fullscrenn jQuery
Solved, Simply by using: $('html,body').animate({scrollTop:$('.backTop').offset().top}, 150); was assigning to the body scroll, but should be assigning to the div scroll that is in fullscreen,…
-
0
votes3
answers84
viewsQ: scrollTop in Fullscrenn jQuery
On the screen in normal mode use at the click of a button directing the screen to a div at the top: $('html,body').animate({scrollTop:$('.backTop').offset().top}, 150); But, taking the screen on…
-
1
votes2
answers229
viewsQ: Read XML with equal PHP nodes
I have the xml example: <Listings> <Listing> <Title>Nome</Title> <Details> <Description> dados </Description> </Details> <Media> <Item…
-
0
votes1
answer37
viewsA: Print Json PHP Variable
Solved echo '<pre>'.print_r(json_decode($data), true).'</pre>';
-
-2
votes1
answer37
viewsQ: Print Json PHP Variable
I have a json $data= '[ { "opa": "maam", "clik": "7026981995", "pt": 123, "aaab": [{ "ttt": "1.22", "tt": [{ "aaa2": 1.2277, "aaa122": 19811225 }] }] }, { "opaa": "maam1", "clik1": "7026981995",…
-
1
votes0
answers37
viewsQ: Counter Visits Anti Bot Sharing Facebook
I created a counter of visits, but, we need that there is no count through the visits for reading the bots, mainly of facebook. This code is called via Ajax, after the user is on the page by 5…
-
0
votes1
answer503
viewsQ: Read exact csv php columns
I’m reading csv this way: $handle = fopen($file, "r"); while ($data = fgetcsv($handle, 1000, ",")) { if($row !== 0) { $dados = explode(";", $data[0]); $VALOR_1 = utf8_encode($dados[1]); $VALOR_2 =…
-
0
votes1
answer2683
viewsQ: Date Shorter and Longer than X days Mysql
I have a field on the table called registro_data_instalacao of the kind date, I need to display the logs with the registro_data_instalacao where the date is greater than 3 days and less than 30…
-
1
votes0
answers13
viewsQ: Return Stats Post Facebook Page
Using the v2.9 api. include('controller/facebook/init.php'); try { // Returns a `Facebook\FacebookResponse` object $response = $fb->get( '/POST_ID/likes', 'ACCESS_TOKEN', 'summary=total_count' );…
-
0
votes1
answer61
viewsA: Multiple Gallery with Lightgallery
I solved <img src="assets/images/lisboa/1.jpg" class="galeria galeria_bt" galeria_id="galeria_1"> <div id="galeria_1" class="galeria" style="display:none"> <div class="item1"…
javascriptanswered sNniffer 1,009 -
0
votes1
answer61
viewsQ: Multiple Gallery with Lightgallery
I’m using the plugin Lightgallery, on the page I have several galleries, I am displaying only one image of each gallery, so that when there is the click on this image it opens its respective…
javascriptasked sNniffer 1,009 -
0
votes0
answers59
viewsQ: Picking Text from External Site URL
I need to get the text between the tags of a website: <a href="">Este Texo</a> I’m getting a hold of your href with this code: $dadosSite = file_get_contents($utl); $dom = new…
-
0
votes1
answer83
viewsQ: Change input number and sum form field values
I have a form with several inputs number, each input has an attribute called product_val that contain a value. I need that when changing the content of an input (change), a given function captures…
-
0
votes2
answers147
viewsA: Recover dynamic input file via php
Solved for($i = 0; $i < $total; $i++) { printf("Título : %s <br />", $input_titulo[$i]); printf("Descrição : %s <br />", $input_descricao[$i]); printf("Imagem : %s <br />",…
-
0
votes1
answer162
viewsQ: Mysql lost connection in While PHP
I make a consultation via ajax, but, your return is being: mysqli_query(): MySQL server has gone away in mysqli_query(): Error reading result set's header in mysqli_fetch_array() expects parameter 1…
-
0
votes2
answers147
viewsQ: Recover dynamic input file via php
I create dynamic field blocks, with two inputs and a file, in this way: $('#input_nova').click(function() { var total_item = $(".input_item").length ; $('#input_container').append( '<div…
-
0
votes1
answer25
viewsQ: Validation in_array with Ç
I have an array: $enderecos = array( 'Endereço', 'Endereco', 'Endereço ' ); Use the function fgetcsv to read my CSV, I check the csv header by comparing whether the header is included in the array.…
-
0
votes1
answer243
viewsQ: Allowed memory size in Phpexcel
I need to upload xls and its reading for insertion in db, if a file reaches the megabytes is always returned to me the message: Fatal error: Allowed memory size of 268435456 bytes exhausted (tried…
-
3
votes3
answers7570
viewsQ: Read PHP Multidimensional Array
I need to read an array and get the name of your column and its value. Array: Array ( [0] => Array ( [Conta] => FRANCIELE OLIVEIRA [CPF] => '' [Telefone Res.] => (00) 0000-0000 ) [1]…
-
1
votes2
answers502
viewsQ: Configure Onesignal PHP API URL
I’m deploying onesignal in my php system, following the Documentation My code is: function sendMessage(){ $content = array( "pt" => $conteudo ); $title = array( "en" => $titulo ); $fields =…
-
0
votes2
answers794
viewsQ: Treat JSON by Javascript
After ajax, my php return is: [{"1":"4"},{"2":"3"},{"3":"7"}] Data is variable in quantity and content. I need to treat it by javascript and convert it into an array, in this format: var retorno = […
javascriptasked sNniffer 1,009 -
0
votes2
answers580
viewsA: jQuery/AJAX: a single form that can be submitted to different urls (POST or PUT)
If the ajax is inside the click of .btn-info why is Submit inside it? It has already removed Sumit from inside the click? $('.btn-info').click(function(){ alert('PUT'); event.preventDefault(); var…
-
3
votes2
answers545
viewsQ: Check string is contained in PHP Array
I have a function in Curl, its return is an indefinite amount of data, but, its format is standard. Return: array(86) { [0]=> array(2) { ["value"]=> int(1) ["data"]=> string(27) "retorno 1"…
-
2
votes2
answers857
viewsQ: Incorrect Background Image on Iphone
I’m using: <section class="parallax calltoaction section_padding_100" style=" background-image: url('images/models_cover/landscapes.jpg'); background-size:100% 100%; background-repeat: no-repeat;…
-
2
votes1
answer388
viewsA: Watermark with Wideimage With png
Solved, I applied direct transparency to the image, increasing opacity. I modified in the mergethe amount of transparency from 60 to 100 $img = $img->merge($watermark, 'right-20','bottom-20',…
-
4
votes1
answer388
viewsQ: Watermark with Wideimage With png
I’m trying to add a watermark via php with the library Wideimage. include 'WideImage/WideImage.php'; $img = WideImage::load($targetFile); $watermark = WideImage::load('../images/logowater.png');…
-
0
votes1
answer292
viewsQ: Load Window Form inside VB.net Container
Opa I have a function for opening photons inside a general container. Function carrega_form(ByRef ctl As Control, ByRef frm As Form) If ctl IsNot Nothing AndAlso frm IsNot Nothing Then frm.TopLevel…
-
0
votes2
answers68
viewsA: Stylized Radio Input Does Not Pass Post
The exact solution I found, I verified that the use of visibility: hidden; does not display the radio, but, its space remains hidden, not being ideal in relation to layout. Using: .radio-cores…
-
1
votes2
answers68
viewsQ: Stylized Radio Input Does Not Pass Post
Opa, I have some radio buttos via css are exchanged for colors. <div class="radio-cores"> <input type="radio" name="cor" value="1" /> <label…
-
2
votes1
answer509
viewsQ: Run function when closing javascript tab
Opa, I need to execute an ajax when closing the tab, is that possible? I tried to: window.onbeforeunload = ConfirmExit; function ConfirmExit() { $.ajax({ url:'salvar.php', data:{usuario:1,…
-
0
votes1
answer163
viewsQ: Fixed Scroll in DIV Jquery footer
Opa, I have a web chat application, it does checks every x seconds of new messages, need that at the end of these checks, which is via ajax, the scrool of Div #result automatically descend, I tried…
-
1
votes1
answer1182
viewsQ: Chartjs with PHP
Oops, I’m using the Chartjs for graphic generation, I am integrating with PHP to send json to the chart php $arrLabels = array("January","February","March"); $arrDatasets = array('label' => "My…
-
2
votes1
answer638
viewsA: Read JSON return from PHP Curl
Adding the json_decode($var, true) for return as an array. Taking the values: echo $arrData["_links"]['payBoleto']['redirectHref'];
-
1
votes1
answer638
viewsQ: Read JSON return from PHP Curl
Just read a certain Curl return value. By giving the $arrData =json_decode($var); where $var is the return of curl_exec Obtenho: stdClass Object ( [id] => PAY-A8XUTU4VSTE6 [status] => WAITING…
-
0
votes1
answer69
viewsQ: Capture Top of clicked object and apply on another Vb.net
Opa, I am creating a simple function and in it I need to identify the name of the clicked object, and from there collect your top. Private Sub sidebar_bt_all_MouseHover(sender As Object, e As…
-
0
votes2
answers36
viewsA: Problems performing database search (Filtering)
You can separate each item and add the sql in a variable, so it will be easier to get the return of sql, thus making it easier to locate the error: $sql_produto = ''; $sql_cidade = ''; $sql_bairro =…
-
2
votes2
answers17712
viewsA: Inputmask() function for Cpf and cnpj
Well, you don’t need a plugin for that: function mascaraMutuario(o,f){ v_obj=o v_fun=f setTimeout('execmascara()',1) } function execmascara(){ v_obj.value=v_fun(v_obj.value) } function cpfCnpj(v){…
-
0
votes2
answers1131
viewsA: Close modal when updating page after insert
Well, more practical solution, test there, I did it quickly without testing. Basically, in the post if the Insert occurs or the error, there will be the Location with get upload, if the page loads…
-
0
votes3
answers1157
viewsA: Check whether the date range between two input’s is less than a month and apply a condition
Buddy, quick script, I think it fits your needs: https://jsfiddle.net/sNniffer/7z0dfqj1/
-
2
votes1
answer1550
viewsA: CSS not being loaded in Php code
.vertical-menu { **<espaço com caracteres invisiveis>** width: 200px; # muda para: width: 200px; } The problem was a space inside css that was being interpreted as another character and…
-
0
votes1
answer1600
viewsQ: Hide or Obfuscate Iframe SRC
Opa, I need to hide the src code of the html iframe, I tried as follows change $('#iframe').attr('src', 'http://www.site.com/'); Unsuccessfully, how can I hide or obfuscate the iframe src? Vlw…