Posts by Guilherme Nascimento • 98,651 points
2,383 posts
-
14
votes5
answers1163
viewsA: PHP only connects to Mysql?
Almost all banks use their own protocols that run "under the TCP" generally, even if PHP does not have a Native API for a specific type of bank it is possible to write something of its own, of…
-
3
votes2
answers365
viewsA: Losing cookie (created in javascript) when switching pages
Possible cause of the problem Localhost and Google Chrome / Safari You’re using a Safari or Chrome browser with the domain http://localhost, for some reason these browsers in the domain localhost do…
-
7
votes3
answers747
viewsA: How to test my site on a slow internet?
This is a complementary response, Firefox also has something similar to Chrome, first select the "responsive mode" in Developer Tools: And then open the second combobox and choose the desired…
-
2
votes3
answers122
viewsA: file_get_content in part specifies the content of the sitemap
Can use regex with preg_match_all in this way: <?php $dados = file_get_contents('https://www.site.com.br/sitemap.xml'); if (preg_match_all('#www\.site\.com\.br/numero/([^/]+)/#', $dados,…
phpanswered Guilherme Nascimento 98,651 -
4
votes1
answer219
viewsA: Replace space by comma and pipe interchangeably
You can try using preg_replace, something like (-[\d.]+)\s(-[\d.]+)(\s|$), outworking: <?php $x = '-23.5209 -46.46466 -23.52008 -46.465952 -23.519253 -46.467239 -23.518808 -46.466901 -23.518738…
phpanswered Guilherme Nascimento 98,651 -
1
votes3
answers2344
viewsA: List folder files with PHP
You can do the name check like this $arquivo === '.' || $arquivo === '..', if it’s any of these use the continue; to jump to the next file. That should do it: <?php $path = "./"; $diretorio =…
phpanswered Guilherme Nascimento 98,651 -
0
votes3
answers118
viewsA: CSS or JS selector
If this paragraph is unique I see no harm in simply using a class, after all it is Even though they exist, there is no reason to create a complex selector or use Javascript, just do something like:…
-
2
votes1
answer185
viewsA: How to unzip a GZIP standard compressed string in PHP?
If the field is base64Binary (probably a webservice, SOAP maybe) so have to use base64_decode and then gzdecode, something like: $string = base64_decode($string); $string = gzdecode($string);…
-
2
votes3
answers664
viewsA: How do I upload all the files in the directory except for a specific one?
Ignore changes/modifications in GIT If you want to ignore modifications to a specific "git server" file, what you can try is to force the assumption that there have been no changes (I think it is…
gitanswered Guilherme Nascimento 98,651 -
1
votes1
answer202
viewsA: How do HEADER track the height of the internal elements?
Is because of the float: left, then the element gets height:0 why the internal elements are with float. You have to add an element with clear: both after, can create a pseudo-element, thus:…
-
1
votes2
answers325
viewsA: Getsqlvaluestring / mysqli_real_escape_string / Notice: Undefined variable: mysqli
The problem is that the function GetSQLValueString is trying to access a variable that is outside of it, ie the variable is in a different scope, to adjust use the global thus: function…
-
6
votes3
answers937
viewsA: Does the attribute "async" serve to execute dynamically loaded scripts? (AJAX)
Not, the use of the attribute async in elements <script src="..."> is to avoid the render lock (blocking-render). About using Ajax I really do not think it is necessary so much work, can…
javascriptanswered Guilherme Nascimento 98,651 -
2
votes1
answer52
viewsA: Microsoft Azure - php
I’m not sure, but I believe it’s due to: return true; Within your Handler in the set_error_handler has the return true;, this makes instead of using the internal Handler it use only your "Handler",…
php wordpress windows-azure wordpress-plugin application-insightsanswered Guilherme Nascimento 98,651 -
8
votes3
answers910
viewsA: How to use $.on in pure Javascript: "$(...). on(event, selector, function)"?
An addendum to Sérgio’s response is the question of the prefixes, the Element.matches is not supported by some older browsers, or had a different name (such as matchesSelector). Navigators and…
-
5
votes1
answer163
viewsA: Fixed Scroll in DIV Jquery footer
Would going down be to roll to the end? If yes I believe you did wrong, the $('#result').offset().top takes the position of the "top", I believe that for your case you would have to use the height,…
-
2
votes4
answers1531
viewsA: Adding my files to Github
I find it excellent to learn the basic commands at least of GIT, After all, even anyone who uses a git client with a graphical interface will need some command at some point, but as an additional…
-
1
votes1
answer2482
viewsA: How to fix charset="UTF-8" in application nodejs within the socket.io
Your page must be using iso-8859-1/windows-1252 and the JSON response returns in utf-8, you can change the page (or add-on) to use the: <meta http-equiv="Content-Type" content="text/html;…
-
9
votes2
answers374
viewsA: What’s the difference between SSE and Ajax?
Ajax is a normal HTTP request, but runs on background, Ajax is to be more exact is a "way" to use the API XmlHttpRequest asynchronously, but anyway the request is a normal HTTP request, it once…
-
5
votes2
answers14723
viewsA: Set Iframe to 100% height
Though it’s already answered here Div with height 100%, I will try to clarify and explain the behavior, the DOCTYPE for HTML5 as well as for HTML4 with Strict works in the same way as in Quirks mode…
-
19
votes3
answers910
viewsQ: How to use $.on in pure Javascript: "$(...). on(event, selector, function)"?
It is as follows, in jQuery we have the on, any element <a> with class test and without the class foo will trigger the function when clicked, even if you create the element later the event is…
-
2
votes2
answers633
viewsA: Problem with routes in the Laravel
This must be returning null: $result_categorias = DB::table('colecoes')->where('activo', '=', '1')->where('slug', '=', $slug)->first(); Because you accessed the URL as www.exemplo.com/slug,…
-
0
votes3
answers64
viewsA: Grab piece of text in php
Can use preg_match so you can catch any error code, beyond the error 1062, an example assuming you are using mysqli: if (!...) { //if que falhou $error = $mysqli->error; $code = 0; if…
phpanswered Guilherme Nascimento 98,651 -
46
votes1
answer21527
viewsA: What is the function of the X-UA-Compatible meta tag within HTML
This goal is unique to Internet Explorer (entered in IE8), it can configure the page to be rendered as in another version of Internet Explorer. Note that if you are using IE9 or 10 for example with…
-
3
votes2
answers110
viewsA: Change file ( jpeg , gif or swf ) according to screen size?
You can use images like background in Divs and use media-query to adjust, an example if you have two images: <style> .banner-1 { background: url(images/normal/banner1.jpg); display:…
-
2
votes3
answers4863
viewsA: Install with PIP through the Resets.txt file inside Virtualenv?
In accordance with the documentation I believe it’s something like: pip install -r requirements.txt I just don’t understand VirtualEnv, so I cannot say whether something more is needed.…
-
4
votes1
answer440
viewsA: Search neighborhood from street
Here worked perfectly the way you did, I didn’t change any line the problem must be elsewhere, has no relation whether or not to $buscarcep->busca(...) The problem must be either in the data…
phpanswered Guilherme Nascimento 98,651 -
0
votes3
answers543
viewsA: json php error, but json is correct
The point is that jQuery specifically already does the "parse" for Json automatically as described in: https://api.jquery.com/jquery.post/#jQuery-post-url-data-Success-dataType The type of data…
-
2
votes3
answers181
viewsA: Enable contenteditable="false" tag for "true" with javascript
Just use document.querySelector (can exchange for ids instead of class too, but this is another story): var salvar = document.querySelector("#salvar-frase"); var editar =…
-
5
votes4
answers251
viewsA: substr only with string greater than 4 character
I noticed that everyone used -1, but this would make something like: ABCDEFGH will return H ABCDEFGHI will return HI I really wondered if you wanted to take the part from string coming afterward of…
phpanswered Guilherme Nascimento 98,651 -
4
votes2
answers871
viewsA: Button "hamburger" does not work
Have two problems, bootstrap order and jquery wrong: <link href="bootstrap/css/bootstrap.min.css" rel="stylesheet" type="text/css"> <script href="bootstrap/js/bootstrap.min.js"…
-
5
votes3
answers3321
viewsA: How to overwrite some bootstrap attributes?
Missing the "points" in: .navbar navbar-default navbar-fixed-top It should be like this: .navbar .navbar-default .navbar-fixed-top I’m not sure, but I seem to be missing one } also, should stay like…
cssanswered Guilherme Nascimento 98,651 -
1
votes2
answers1226
viewsA: Syntaxerror Error: Unexpected token < in Chrome
The problem is in Urls: http://player.loadplayer.net/assets/js/videojs/plugins/videojs-resolution-switcher.js http://player.loadplayer.net/assets/js/bootstrap/bootstrap.min.js…
javascriptanswered Guilherme Nascimento 98,651 -
3
votes1
answer876
viewsA: How to show "Save As" window at download time?
There’s no way, the dialog box Save as is a browser option of user choice, there is no way to force it to appear via scripts, nor scripts server-side and no scripts client-side (like Javascript).…
phpanswered Guilherme Nascimento 98,651 -
1
votes1
answer207
viewsA: Transform varchar to float
I don’t know how the API works MySQLdb, but I believe that the cast query should work, assuming Ping be the column that has the value of varchar that you quoted in numerical format: SELECT CAST(Ping…
-
2
votes2
answers404
viewsA: Problem in Insert shows no error
To display the error, if there is an error in the query you should use mysqli_error and not mysql_error, this this wrong: or die(mysql_error)); Aside from the mysqli_query has no parentheses at the…
-
8
votes3
answers2839
viewsA: What is the solution for asynchronous PHP processes?
One thing is a function run asynchronously, another thing is to make a call to something external without expecting a reply (or catch the answer later), I will not go into detail because to be…
-
9
votes1
answer18492
viewsA: Cannot read Property 'addeventlistener' of null
Probably in the script on your machine you didn’t use window.onload or DOMContentLoaded, jsfiddle works because the script runs after the DOM loads, see how it is in your jsfiddle: So to adjust can…
javascriptanswered Guilherme Nascimento 98,651 -
4
votes2
answers249
viewsA: What’s the difference between Http Requests and Request App
The use Request it won’t work in the Laravel, I think it would be something like: use App\Http\Requests as Request If the name is App\Http\Requests, if the name is App\Http\Request (without s) just…
-
7
votes3
answers2030
viewsA: How to create an empty object in PHP?
As Diego suggested it is possible to create an object using stdClass, would look something like: <?php $class = new stdClass; $class->key1->key2 = 1; var_dump($class); However I must warn…
-
8
votes2
answers440
viewsA: Object orientation is the part of c# used for games?
Ask yourself that question: What defines something like a game? Programming languages, being based on object orientation, procedures or other possible types do not define the quality needed to…
-
2
votes1
answer389
viewsA: Unsupported error operand types
To "debug" variables before the if do: var_dump($ordem, $preco); if ($tipo==Venda){ And then you’ll notice the problem, $ordem or $preco are not numbers, one of them must be a array or null and then…
phpanswered Guilherme Nascimento 98,651 -
2
votes1
answer498
viewsA: How to redirect only one directory to http instead of https?
Your . htaccess seems to be redirecting from http to http anyway, there must be infinite directions due to this RewriteCond %{HTTPS} off. I also believe that folder should be /folder/ when compared…
-
2
votes1
answer1145
viewsA: Fatal error: Call to a Member Function prepare() on a non-object
Using Try/catch inside the constructor no longer looks good and even more use return in it, this will not work, it is better to use the Try/catch outside the class, so at least it will have a…
-
1
votes1
answer514
viewsA: How to send email simultaneously with Windows
In the use you added $emails and not $email (without s): use($emails, $description, $subject) This should probably be it: function($message) use($email, $description, $subject) Thus: $send =…
-
1
votes1
answer161
viewsA: About the htaccess file
I did not understand the doubt well, but first correct the name for .htacess for .htaccess (two letters c and two letters s), should work. The .htaccess is not directly connected and is not…
-
6
votes2
answers169
viewsA: Undefined variable, even if defined
I believe the use of (login, password) => { makes behavior change instead of accessing this the this of the "object" the this is of the same value as global (Node.js) or window (if you are a…
-
2
votes1
answer253
viewsA: Does AJAX requests work on Webview?
The problem you must be having is with Cors, there is no way to disable security on webView to avoid these problems, if you have access to the API then you should add the header:…
-
1
votes1
answer488
viewsA: How to avoid this error message? "main.cpp:8:16: error: lvalue required as left operand of assignment"
The sign of equal = is used to set values in variables, when you do: (ano-10)/76=n-1; You try to set the value of n-1 for the value of (ano-10)/76, but this has no meaning and cause failure, the…
c++answered Guilherme Nascimento 98,651 -
2
votes1
answer134
viewsA: Session Error - Permission denied - sites at different ports
Probably using iis or php-built in server, probably the way you set up PHP the session should be trying to write in c:\windows\temp but IIS is not running with administrator privileges, to resolve…
-
4
votes2
answers6190
viewsA: Passing parameter via href php
There’s no way, but by making a beautiful which in my view is unnecessary, the use of querystrings (?....) is just this, carry variables via URL for links use (Urls), if you are looking to make the…