Posts by Guilherme Nascimento • 98,651 points
2,383 posts
-
1
votes1
answer943
viewsA: Error 400 Bad Request in Google Distance Calculation API
You have to encode the data passed to querystring, for this use urlencode or rawurlencode thus: foreach ($dados as $rua) { //Faz a requisicao do arquivo xml $rua = rawurlencode($rua); $url =…
-
4
votes1
answer866
viewsA: Error syntax error, Unexpected T_CONSTANT_ENCAPSED_STRING
The mistake is on this line: $items .= '<li><div class="sp-search"><div class="top-search"><?php echo do_shortcode('[yith_woocommerce_ajax_search]');…
-
1
votes2
answers974
viewsA: Convert XML to php
The problem is clearly in Webservice, outside that address /consulta if open directly emits a series of errors, which makes me think that this WS is with several flaws, however if it is not yours…
-
2
votes2
answers113
viewsA: Is it possible to access the same argument twice in sprintf?
The response of @Laerte is great and very correct, but I decided to leave two alternatives the answer just to make writing more practical tokens, resembling str.format python: Suggestions 1: I will…
-
2
votes2
answers3157
viewsA: No ECHO error? Unexpected 'echo' (T_ECHO)
ifs use () for condition and not for "statement": Wrong: if(CONDICAO) ( declaração ) Correct: if(CONDICAO) { declaração } I don’t really know where you are learning PHP (No offense), but I recommend…
phpanswered Guilherme Nascimento 98,651 -
0
votes1
answer61
viewsA: Slim Framework with Apache2.4
This is not a problem with Apache and even with Slim, missing headers, if you have access to the file http://meuservico.com.br/lib/api/api.php you edit it add the headers, by error message it…
-
5
votes1
answer5684
viewsA: Manipulating Base64 images with PHP
Have to use base64_decode, if you go from the bank take the variable and do this: $imageBin = base64_decode($row['imagem']); //Exemplo de variavel Here an example with file: <?php //Caminho da…
-
5
votes2
answers232
viewsA: What is the best way to create tables with users who may have multiple emails?
In my view the best way to "organize" is to use 1:m, something like: Sqls: CREATE TABLE IF NOT EXISTS `clientes` ( `idclientes` INT UNSIGNED NOT NULL AUTO_INCREMENT, `nome` VARCHAR(45) NULL, PRIMARY…
mysqlanswered Guilherme Nascimento 98,651 -
4
votes1
answer1174
viewsA: "Syntaxerror: invalid syntax" error
Missed the : in the while and in the if, do so: #encoding: utf-8 y = int(input("Ultimo número: ")) x=0 while x <= y: if x % 2 == 0: print (x) x=x+1 Follows doc:…
-
3
votes1
answer988
viewsA: Alternatives for not using Webview
crosswalk In accordance with this answer there is a project called crosswalk (requires Android 4.0+) To install: https://crosswalk-project.org/documentation/android.html Support: Webrtc, Webgl,…
-
1
votes1
answer1395
viewsA: Use PHP Websocket Ratchet online
Change: use Ratchet\http\HttpServer; For: use Ratchet\Http\HttpServer; Because this occurs: In Windows the files are case-insentive, when you run: use Ratchet\http\HttpServer; It usually finds this…
-
0
votes1
answer52
viewsA: Apertium-Caffeine
The apertium-caffeine.jar is not a library it seems, but an application, to use it do this in the terminal or CMD: java -jar apertium-caffeine.jar Download and wiki:…
-
6
votes3
answers5760
viewsA: Is there any equivalent of "$(Document). ready()" with pure Javascript?
To look similar to jQuery’s operation we have to add an extra random check. Note that interactive does not work well in IE so I used doScroll Note that document.readyState not supported by some…
javascriptanswered Guilherme Nascimento 98,651 -
5
votes4
answers1965
viewsA: How can I detect the visibility of an element (without jQuery)?
I disagree with the other answer, style.display is only for inline properties, for this you will have to use getComputedStyle, currentStyle, the attribute type="hidden" in the element <input>.…
javascriptanswered Guilherme Nascimento 98,651 -
7
votes2
answers8005
viewsA: What is the difference between the logical operators NOT, AND and OR?
Wikipedia: Logical operators AND, NAND, OR, XOR and NOT are the main logical operators, basis for the construction of digital systems and propositional logic, and also widely used in programming…
-
3
votes3
answers333
viewsA: Problem saving accent with Entity Framework and Postgresql
It is likely that your environment (IIS) is in UTF8 and you are trying to use latin1 (which is compatible only with windows-1252 and iso-8859-1). In case if you are going to use Latin1 you can…
-
3
votes3
answers1530
viewsA: Send file and text via jquery Asp.net mvc
According to the documentation of https://blueimp.github.io/jQuery-File-Upload/ the basic use is this: Html: <form id="fileupload" action="exemplo" method="POST" enctype="multipart/form-data">…
-
1
votes2
answers120
viewsA: Get the latest IDS
Being an XML you can use DOMDocument $url = 'http://hebbohotel.com.br/swf/gordon/RELEASE-HEBBO/effectmap.xml'; $xml = file_get_contents($url); $dom = new DOMDocument; $dom->loadXML($xml);…
phpanswered Guilherme Nascimento 98,651 -
2
votes2
answers4348
viewsA: SSL error with file_get_contents
I may be wrong, but according to the answers here https://stackoverflow.com/a/26151993/1518921 you must download the http://curl.haxx.se/ca/cacert.pem (although I’m sure that if you install SSL on…
-
2
votes3
answers4693
viewsA: Make Div appear 4 seconds after site loaded
If you want to display an existing div that is hidden you will have to use setTimeout and document.getElementById or document.getElementsByClassName or document.querySelector, for example: Note that…
-
4
votes1
answer127
viewsA: Qvideowidget displays nothing
I tested his example and he really doesn’t even try to run the file, when looking at the example he sent from the site it shows like this: playlist = new QMediaPlaylist(player); It seems to me that…
-
1
votes1
answer567
viewsA: Composer with XDEBUG - PHP
Xdebug is not installed (enabled) in Composer but in PHP, there are two basic layers of php usage, the web (which can use several types of modules) and CLI (command line), in case Xdebug will only…
-
3
votes2
answers156
viewsA: java.lang.nullException error
As was resolved in the comments then I am turning in response, the String can receive null, and at the time it sends to File the problem occurred, so just add a check, so for example: minhaString !=…
-
4
votes2
answers709
viewsA: register domain by the site
It is possible to consult using WHOIS and register/control using EPP. I even added an answer that I did of how to consult: How to check if a website is registered? In fact, when you register with.br…
phpanswered Guilherme Nascimento 98,651 -
2
votes2
answers1077
viewsA: How to calculate Video Time by getTime()
The Object tag is for working with plugins, probably each plugin uses a different method, the question I will mention is, instead of <embed> use the tag <video> which is more correct for…
-
2
votes1
answer4866
viewsA: I cannot access my project in Laravel 5 using Xampp
Xampp does not use 8000 port by default, the port in xampp (apache) default is port 80, ie just access http://localhost will already work (because port 80 may be omitted from the URL). Note that to…
-
4
votes1
answer398
viewsA: mysqli_query returns false to select done with REGEXP
First, every time you use the mysqli_fetch_assoc it will return the next result, ie at the moment it does this: while(mysqli_fetch_assoc($busca) != false){…
-
5
votes2
answers564
viewsA: Is there a difference in using constants or variables in Classes?
Yes, there are differences. Constants cannot be changed, regardless of whether they are in classes or not, it is as if they are readonly (read-only), in addition they are always static, i.e., the…
-
3
votes1
answer2077
viewsA: How to open . html files in my application?
It will depend a lot on where the file is, being a specific location, first add a webView to your app, in case here the name webView1, if you use another ID for your webView you should change in the…
-
3
votes1
answer145
viewsA: Error picking JSON from text - JQUERY
Look if you have access to this domain. js should be generated by some data source, recommend changing the strategy, however you can do so (if js are in the same domain as the page): $.ajax({ url:…
-
1
votes3
answers109
viewsA: How to display the excerpt from the script where the exception was released in PHP
Also I always had this need, especially if I need to work with more people and the files have constant changes, sometimes we lose some problem, or even we have to keep locating a file and locating…
-
3
votes1
answer181
viewsA: Is "new Domparser" safer than "Document.createelement"?
Attributes of events such as onerror, onload and other things are executed even if the DOM element is not added to the page body, an example test: function createDOM(str) {…
-
2
votes1
answer206
viewsA: Load applet through javascript
Unable to force startup, please pay attention to what I will say, the browser is divided and layers, basically it has the following structures: Rendering engine (DOM and CSS) Javascript engine…
-
4
votes3
answers90
viewsA: strpos() is closing while true
Must be a Exception and the errors are off so you didn’t notice, turn on the PHP errors, when in development, in production use ini_set('display_errors', '0');, is probably some mistake in using…
phpanswered Guilherme Nascimento 98,651 -
6
votes1
answer181
viewsQ: Is "new Domparser" safer than "Document.createelement"?
I created a script to try to remove unsafe content when injecting DOM (I’m using it in extensions/Addons for browsers): var str = "<strong>Hello</strong> mundo <script…
-
0
votes3
answers487
viewsA: How to update PHP Timezone with javascript using the Date.getTimezoneOffset function?
If I understand well want to update the server time (by Timezone), if you are in Brazil and the server is American (US) want the scripts run with the Brazilian time. There are two paths to take, the…
-
8
votes2
answers847
viewsA: Send notification response by php
The problem is that you don’t understand the difference between JSON and HTML or TEXT, this is the least you have to study before trying to use these formats. That echo "SUCCESS"; prints this in the…
-
7
votes2
answers221
viewsQ: Merge project when using the "Composer create-project" command
I have a project (a blog) based on Laravel/Laravel (note that this is the application and not the framework only), but I wish to send to my repository only the contents of the folders app/ and…
-
5
votes2
answers140
viewsA: Does anyone know of a function that considers special characters like "://" in php without being strpos()?
The strpos and stripos consider rather "special characters", the problem is that : Here strpos($param, "http"); you just checked the http and in string…
phpanswered Guilherme Nascimento 98,651 -
2
votes1
answer2494
viewsA: How to install dependencies from Composer, but ignoring require-dev?
According to the documentation https://getcomposer.org/doc/03-cli.md the parameter must be used --no-dev, example of commands: If the Composer is global: composer install --no-dev composer update…
commiserateanswered Guilherme Nascimento 98,651 -
7
votes1
answer918
viewsA: By clicking anywhere on the page open a new page with a time limit?
In short it would be this: <script> (function () { var isOpened = false; //Troque aqui pelo site desejado var siteUrl = "http://www.google.com"; document.addEventListener("click", function(){…
javascriptanswered Guilherme Nascimento 98,651 -
9
votes1
answer3436
viewsA: Send a message to Whatsapp via system
A Whatsapp does not allow such a thing as is written in https://www.whatsapp.com/legal/ if you have a supposed API to use it is not official and so Whatsapp will seek to block all kind of this type…
-
5
votes2
answers6419
viewsA: Run PHP script in Windows task scheduler
The problem is yes, is that in apache your configuration must be one way and the moment it runs directly C:\wamp\bin\php\php5.5.12>php it must be using another configuration of the php.ini, in…
-
6
votes2
answers1080
viewsA: Doubts in the web service
Yes the Webservice is totally the part of the APP, summarizing the webservice is a "site" that is used only for data transmission via HTTP in a structured way, for example Json or XML instead of…
-
4
votes1
answer328
viewsA: form_validation Codeigniter using GET
According to the documentation of codeigniter3 you can validate other arrays outside the $_POST Before executing any set_rule you must use the $this->form_validation->set_data adding the…
-
1
votes1
answer3690
viewsA: Prevent line breaking (encavalating) in col-Md bootstrap
Your grid count is wrong, even if you use the .row, the .col-*-4 should have only 3 Divs in one .row To know if the quantity always disappears .cols the total MUST always be 12, ie: If you’re just…
-
2
votes3
answers522
viewsA: How to put variables in datetime (PHP)
The sign ' known as single quotes or apostrophe does not accept variables, as this in your example: new Datetime('$ano-$mes-$dia'); Only "normal quotes" accept, so you can do so: new…
-
1
votes2
answers406
viewsA: Error php, Call to Undefined Function http_get()
According to this response from Soen and the link you have to include in the correct order, this is the order: extension=/usr/lib/php5/20121212/raphf.so extension=/usr/lib/php5/20121212/propro.so…
-
3
votes1
answer4837
viewsA: Zoom Effect on DIV
I didn’t notice any zoom, just the "raised" which is actually the box-shadow that causes this impression, are needed some things: box-shadow to cause the effect of highlighting the page or…
-
4
votes1
answer1202
viewsQ: How to ignore elements escaped in a rule in regular expression?
I’m wanting to do with regex (regular expression), for example (if it’s javascript): var str = '[abc\[0123\]] [efg\[987\]h] [olá \[mundo\]!] [foo [baz]]'; str.match(/\[(.*?)\]/g); Exit:…