Posts by Guilherme Nascimento • 98,651 points
2,383 posts
-
7
votes2
answers1637
viewsA: Force text to be downloaded in a format accepted by Msword with PHP?
Your problem is not with the file extension or with the header past, the problem is that you are trying to force software like Microsoft Word to read a simple ASCII text file as if it were a .doc.…
-
1
votes2
answers238
viewsA: php regex to get 2 groups of href link
Instead of regex you can use Domdocument, a PHP API that works with XML and HTML, an example would look like this: $conteudoDoHtml = '<a href="/page/page/categoria/page?page=2&publica=1"…
-
1
votes2
answers294
viewsA: Xamarin android player error while starting "virtualbox kernel driver not running"
As posted on Xamarin forum and can be resolved as mentioned by mridoni: I used this link (I made a Couple of Attempts to "rewrite" it by hand, Starting from the link for 0.4.4):…
xamarinanswered Guilherme Nascimento 98,651 -
2
votes2
answers87
viewsA: Cross origin not working with angulasJS and PHP
You used localhost:8080 sure would be http://localhost:8080, the way Voce did, omitting http ajax this thinks localhost and the protocol and the 8080 and the host. And another detail, it seems…
-
16
votes3
answers3377
viewsQ: How does the MVC framework for Desktop applications work?
I have seen many web projects like php frameworks, Asp.net, however I read in some places that MVC came before the web, it was aimed at developing desktop applications, however I did not find…
-
4
votes1
answer7802
viewsA: Voice recognition in Pt-BR
To change the language in the method SpeechRecognizer Theoretically I would have to use it this way: private void Form1_Load(object sender, EventArgs e) { SpeechRecognizer sr = new…
-
1
votes3
answers314
viewsA: How to destroy a jQuery.fn whenever called?
The function of jQuery.fn not and assign anything, it just pass the selected nodes to your custom method. Who defines whether will add repeatedly and Voce. In case Voce can use the attr() to detect…
jqueryanswered Guilherme Nascimento 98,651 -
3
votes2
answers1185
viewsA: How to call a native app?
In this post http://www.intertech.com/Blog/android-intents-for-app-integration-call-a-calculator-play-video-open-an-editor/ found the following code: You have to use Intent, add these variables to…
androidanswered Guilherme Nascimento 98,651 -
1
votes1
answer955
viewsA: HTML5 form validation does not work on iPhone
As per this link: http://caniuse.com/#feat=form-validation In Safari and Chrome for iOS in versions 5.1, 6.1, 7.1, 8, 8.4 and 9 Form validation has partial support, refers to the lack of warning…
-
3
votes1
answer8438
viewsA: How to customize google-Translate on my website?
When Voce executes the code on the page it generates an HTML in this approximate format: <div id="google_translate_element"> <div class="skiptranslate goog-te-gadget" dir="ltr"> <div…
-
4
votes2
answers3057
viewsA: How to change the Jumbotron tag in the bootstrap in the google Chrome browser?
I believe that the problem here is part of what I mentioned in this question: Fonts are not displayed when used with JSF You cannot load bootstrap.js and bootstrap.min.js together bootstrap.js is…
-
2
votes2
answers569
viewsA: Fonts are not displayed when used with JSF
There are some questions You cannot load bootstrap.js and bootstrap.min.js together bootstrap.js is for development bootstrap.min.js is for production Here: <h:outputScript library="js"…
-
3
votes1
answer4057
viewsA: How to fix footer on the print page?
Note: The examples here have been tested in Chrome40+, Opera31, Internetexplorer9 and Firefox40.0.2. A printing page A simple example is to use position: fixed: Note: Stacksnippet does not work.…
-
1
votes1
answer1133
viewsA: Retrieve database data with Codeigniter
I’m not sure what the format of your bank and what version of Laravel you use (it looks like it’s about Codeigniter as quoted by @gmsantos). Being Codeigniter I believe the solution is something…
-
1
votes1
answer532
viewsA: How to send select element by email?
Your selector input#sel1 asks for a <input> instead of a <select>, just you change it: var name = $("input#name").val(); var phone = $("input#phone").val(); var email =…
-
4
votes3
answers3581
viewsA: What is the equivalent of mysql_result in mysqli?
The documentation link itself can help you http://php.net/manual/en/ (recommend in English, because sometimes the Portuguese version contains errors :/ ) Will have to use:…
-
1
votes2
answers225
viewsA: CSS does not work on pages generated with Errordocument
Add the following html code to your erro404.html page: If css, js and images folders are at the root: <base href="/"> Or you could try this: <base href="http://www.examplo.com/"> This…
-
2
votes2
answers5810
viewsA: How to run Vimeo video automatically (with autoplay)
Note: At the moment (08/19/205) the player is generating a script error when you select the trailer videos (in the other videos is normal), the error is as follows: Uncaught Referenceerror:…
-
0
votes2
answers1010
viewsA: Questions about Notice Undefined variable
The error occurs because you are probably sending a form without method="POST" or the attribute name="" in the input is wrong. To run the <form> must be something like: <form method="POST"…
phpanswered Guilherme Nascimento 98,651 -
1
votes1
answer114
viewsA: Ajax query does not work
Here you forgot the elseif, see: } else(responseText == 0){ The correct is: } else if(responseText == 0){ I recommend doing a good code indentation too, should look something like:…
-
6
votes2
answers1206
viewsA: What does the "?:" operator mean in PHP?
This is the operator reduced ternary, as stated in these replies: Use of ? and : in php Reduced ternary in PHP - Error or misinterpreted? If the condition passes: $variavel = 10; $variavel ?: 5;…
-
3
votes4
answers179
viewsA: How to display files without underline?
The problem is not with PHP is with HTML, missed you add img/ and use quotation marks on the attribute. I recommend you use ' (apostrophos) in PHP and quotation marks in html, should look something…
phpanswered Guilherme Nascimento 98,651 -
4
votes1
answer2862
viewsA: Jquery beforeunload is called when I click on link
beforeunload is not used to detect when tabs close or windows close is used to detect the "download" of the page, ie this event is also triggered when you click on a link that goes to another page,…
-
1
votes1
answer76
viewsA: Pretend the device doesn’t have GPS
I believe that by the debugger there is no pre-defined function for such a thing, but you can create a if and force her to be false, for example your code should be something like: if…
-
5
votes1
answer2578
viewsA: Renaming a file while downloading
Using the download attribute="" You can use the download attribute in html on a link, for example <a download="media4.mp4" href="http://meusite.com.br/file/374749482.mp4">Download</a> If…
phpanswered Guilherme Nascimento 98,651 -
7
votes3
answers3409
viewsA: How to receive a POST without the <form> tags in PHP?
Html5 You can use the attribute form="" of Html5 (it is necessary for the browser to support this, I believe all modern browsers support): <form id="form_pagamento" method="post"…
-
5
votes2
answers7297
viewsA: How to duplicate a MYSQL database?
It is possible (and easier) using mysqldump per command line: mysqldump -h [servidor] -u root -e "create database banco_novo" mysqldump -h [servidor] -u root banco_antigo|mysql -h [servidor] -u root…
-
0
votes1
answer244
viewsA: Is it possible to make a Class accessible in all namespaces?
There is nothing standard to do this but use use or \, however we can "cheat" php using eval within the spl_autoload_register to extend the class within the namespace. <?php class Utils { public…
-
8
votes1
answer823
viewsQ: PSR-4 on an MVC project or not?
I have two codes, the first one uses spl_autoload_register and the other does not, however the second loads "automatically the class" also. With spl_autoload_register Uses namespaces to split MVC…
-
15
votes3
answers3527
viewsA: How to find the Javascript version (via code)?
Not there is a reliable way to discover the Javascript version. The use of <script language="Javascript1.*"> has not precision, an example of problem is that in some browsers you can use an…
javascriptanswered Guilherme Nascimento 98,651 -
3
votes1
answer83
viewsQ: usleep is not working on Windows
I’m using usleep to simulate slower internet in my projects, so as to have a better perception of the screens when there are loads for ajax requests for example. Using a linux environment seems to…
phpasked Guilherme Nascimento 98,651 -
3
votes1
answer1018
viewsA: Error "Access-Control-Allow-Origin header is present on the requested Resource"
The mistake: No 'Access-Control-Allow-Origin' header is present on the requested Resource It means the header is missing Access-Control-Allow-Origin which allows a different domain (or port) site to…
-
1
votes2
answers497
viewsA: How to manipulate Event Listeners order of a DOM element
There is no way to manipulate the order as far as I know, what you can do is create an array with all functions, it would look something like: var funcoes = [ function() { console.log("foo"); },…
-
2
votes1
answer3318
viewsA: How to improve the quality of the saved image?
There may be two more known problems (I believe there is another problem with similar sources, but it does not seem to be the case): Problem with retinal screen Retinal screen or Retinal screen…
-
6
votes1
answer317
viewsA: How to make Regex to a "serial" number format?
I believe it’s something like: \d+\.\d+\.\d+\.\d+ or else: \d{4}\.\d{1}\.\d{3}\.\d{4} The \d represents any numerical value of 0-9 The {...} represents the number of characters represented by what…
-
6
votes1
answer2336
viewsA: How to redirect via . htaccess?
You must use the flag [R=301] or [R=302] only to indicate the type of direction. In the case if 301 is a permanent redirect, if 302 then is temporary redirect. On the website meusite.com.br you must…
htaccessanswered Guilherme Nascimento 98,651 -
17
votes6
answers4502
viewsA: How to use two CSS attributes at the same time?
You can use ; and font-family, as already mentioned by other users, an example: <h1 style="color:#CC0099; font-family: Verdana">Um dia eu aprendo</h1> <p style="color:red">This is…
-
9
votes2
answers470
viewsA: Is it necessary to bar " " at the beginning of native functions when using namespace?
The other answer and comment helped me understand the problem: Maybe there is a str_replace() in that namespace, which is not native to the language, and is therefore specified to make the correct…
-
2
votes1
answer244
viewsQ: Is it possible to make a Class accessible in all namespaces?
The question is similar to this Instantiate class outside namespace and has a good answer /a/68198/3635 However I would like to do this automatically. For example: It is possible to make a Class be…
-
3
votes1
answer586
viewsA: How do I find out which file includes the other in PHP?
Use debug_backtrace() or debug_print_backtrace, it can detect both include, require, include_once, require_once, how much scope of functions and classes. Using debug_backtrace(): Filing cabinet…
-
3
votes2
answers157
viewsA: Why copy the prototype method instead of using directly?
I’m not sure, but I can assume it’s to "type less" and facilitate the compression of code, similar to this situation: What is the advantage of using Function(window, Document, Undefined) Remembering…
-
10
votes2
answers470
viewsQ: Is it necessary to bar " " at the beginning of native functions when using namespace?
I noticed that some libraries use in functions native of PHP the \, for example: echo \str_replace('foo', 'test', $string); I’ve been testing within a class just with namespace this: public function…
-
4
votes2
answers902
viewsA: Loop foreach error: syntax error, Unexpected 'foreach' (T_FOREACH), expecting ')
You can’t put foreach, for, while inside an array directly, as far as I know, I’ve never seen a programming language that allows/supports such a thing. In php you should use this: $data = array('a',…
phpanswered Guilherme Nascimento 98,651 -
2
votes1
answer886
viewsA: Additional GET parameters does not work with htaccess
This is why the flag is missing QSA You must do so: RewriteEngine On RewriteCond %{REQUEST_FILENAME} !-f RewriteCond %{REQUEST_FILENAME} !-d RewriteRule ^(.*)$ index.php?pagina=$1 [QSA] If you don’t…
-
28
votes4
answers8564
viewsA: What good is a gists on the github?
With gists you can share unique files or part of code and even entire applications, it is similar to Pastebin, yet each Gist accepts multiple files. Gists are Gits repositories, so you can see all…
githubanswered Guilherme Nascimento 98,651 -
8
votes3
answers20971
viewsA: How can I open a modal window with window.open()?
Not window.open cannot work similar to modal windows, if what you mean with modal is the new window lock the window that called this modal or hide the address bar. There used to be a function…
-
1
votes1
answer76
viewsA: Document.querySelect in body
Trouble with the hyphens This is wrong: document.querySelector('body').style.background-image=image; Note that the error Uncaught Referenceerror: Invalid left-hand side in assignment It is caused by…
-
1
votes2
answers625
viewsA: Read an XML in another domain
If the server http://mfmradio.fr using apache and xml for static, you can use . htaccess with mod_headers, for example: Header add Access-Control-Allow-Origin "*" This will allow any external domain…
-
6
votes1
answer1662
viewsA: Error sending Upload with Ajax
It always falls into the first exception because it is not a problem with the database but with the try/catch. Solving the problem at the front-end try { var json = $.parseJSON(jqXHR.responseText);…
-
1
votes4
answers115
viewsA: How do I not allow "<" and ">" in my Insert
Instead of avoiding the < and > you could convert them at the time of reading (remember in INSERT it is better to keep the original as it was written), then at the time you use SELECT the <…