Posts by Guilherme Nascimento • 98,651 points
2,383 posts
-
5
votes3
answers1974
viewsA: How to add more products?
There are several redundancies in your code, you use array adding session values without need, but let’s get to the point, has how to simplify. session item can receive arrays normally, working with…
phpanswered Guilherme Nascimento 98,651 -
1
votes2
answers11060
viewsA: How to center an iframe?
The element <iframe> is natively inline-block, at least in modern browsers, in the older ones (old ones like IE6, etc.) should probably be inline, however inline-block or inline both are…
-
1
votes1
answer332
viewsA: Doubt how to take a JSON, turn it into an object
I believe that as README is like this https://github.com/nlohmann/json#json-as-first-class-data-type, would look something like this: json newitem = { "area": "SI", "codigo_curso": "02", "cpf":…
-
1
votes1
answer470
viewsA: How to keep input values when user goes to another page
Change window.history() for window.history.back() (equivalent to clicking the Back button of the browser), when you use the back button of the browser or even the function back browser itself…
-
3
votes2
answers1750
viewsA: Force download with php file comes corrupted
The whole problem is that you are downloading along with the contents of index.php: <?php require 'config/Config.php'; require 'config/tratarUrl.php'; ?> <html lang="pt-br"> <link…
-
2
votes1
answer159
viewsA: Is it mandatory to use the pyqtSlot decorator?
As stated in Soen, this link explains about the decorated (translated): Although Pyqt4 allows anything that can be called in Python (as methods) to be used as a slot when connecting signals, it is…
-
4
votes2
answers584
viewsA: Center text vertically
Just put vertical-align: middle; on the tag img, then the texts inline that are next to the image will accompany its "base", with this it is also possible to adjust the base below the texts or…
cssanswered Guilherme Nascimento 98,651 -
11
votes2
answers1038
viewsA: How to remove tags in Python text?
An example with regex would be so: import re text = 'meu nome é <strong>Wallace</strong>' text = re.sub('<[^>]+?>', '', text) print(text) The function re.sub() takes as first…
-
2
votes1
answer11482
viewsA: SQLSTATE[42000]: Syntax error or access Violation: 1064
I believe there is a gap between LIMIT and query: $query2=$query."limit $starting_position,$record_per_page"; It should be like this: $query2=$query." limit $starting_position,$record_per_page";…
-
2
votes1
answer256
viewsA: Jquery attr function does not work
The element does not yet exist in the order you called, to check if the page has already been completely rendered use $.ready(function() {...}) or simply $(function() {...}) (is a shortcut to…
jqueryanswered Guilherme Nascimento 98,651 -
1
votes1
answer50
viewsA: Check Interval between time on a given day of the week
Using one’s own date: $diadasemana = date('w'); if ($diadasemana != 0 AND $diadasemana != 6) { $hora = date('H'); if ($hora >= 08 AND $hora < 12) { echo "OK"; } else { echo "Não ok.."; } } If…
phpanswered Guilherme Nascimento 98,651 -
6
votes5
answers8944
viewsA: What is an SDK?
I believe that all answers are almost entirely correct, this because SDK from the point of view can be almost anything, not that it is enough you say "this is an SDK" for it to become something like…
-
2
votes1
answer146
viewsA: How to read and block this TXT with PHP?
If it is only two people who will edit the DOC has nothing better than to use a more "exact" format like JSON or XML, instead of inventing its own format, anyway a +or- simple way is with regular…
-
1
votes1
answer95
viewsA: problems after compiling C++ with the G++ compiler
Yes, this is the expected same, after all has no loop holding or "pause" to avoid, the program runs what has to run and delivers the main() then the process ends and the window closes, that is the…
-
5
votes1
answer73
viewsA: Why do selectors with prefixes in the same rule not work?
These are 3 selectors a, b, c {}, a group of selectors is called a "rule" (Rule), when one of the selectors within a rule is invalid then the entire "rule" is discarded. This is reported in…
-
3
votes1
answer73
viewsQ: Why do selectors with prefixes in the same rule not work?
For example if I do this to let the element that is in fullscreen with height and width equal 100% it does not work: :fullscreen, :full-screen, :-webkit-full-screen, :-moz-full-screen,…
-
2
votes1
answer113
viewsA: Understanding a javascript code snippet
Properties with and without prefixes The document.fullscreenElement, requestFullscreen and document.exitFullscreen are native, but only newer browsers support it The document.mozFullScreenElement,…
javascriptanswered Guilherme Nascimento 98,651 -
0
votes2
answers57
viewsA: Restrict . htacess rules to a single folder
If I didn’t have administrative permission to the server, which happens a lot on servers Shared just play the .htaccess in the desired folder: public_html ├───index.php ├───.htaccess ├───images |…
-
2
votes2
answers373
viewsA: What is the purpose of the Model folder of the Inphinit framework?
jHertel has already given a brief introduction to what MVC is, some questions that may help you with this specifically: Where the MVC standard business rule should be? (perhaps the most important to…
-
26
votes3
answers1249
viewsA: Why can I create two functions with the same Javascript signature?
I believe you have technically already answered "it overwrites", but another is also necessary to understand a feature of function ... (), then I’ll explain a behavior for two ways to declare a…
javascriptanswered Guilherme Nascimento 98,651 -
12
votes3
answers179
viewsA: Why does CSS work with "fake" HTML elements?
I believe it is all due to how the evolution of HTML, XHTML and CSS occurred. CSS can customize any type of element that is valid within HTML and even some XML elements. Note that in the remote past…
-
7
votes2
answers1302
viewsA: call php function in c#
If it is a "php page" then I suppose you are talking about a web page yourself, then in practice you should call the function on your web page, for example teste.php: <?php function retornar() {…
-
2
votes3
answers521
viewsA: Margen-top of DIV daughter drives her away and DIV father together
I believe it’s because of the box-model: "margin-top" and "margin-bottom" overlapping, why? In case just add a pixel in the #second which should solve, also recommend not adding margin: 0 auto on…
-
2
votes1
answer73
viewsA: What is the purpose of the INPHINIT_START, INPHINIT_ROOT, INPHINIT_PATH and INPHINIT_COMPOSER constants?
Basically they are used as pre-configurations of the whole framework, with the exception of INPHINIT_START which has another purpose (this I will quote last). Constants for configuration…
-
4
votes1
answer842
viewsA: Fatal Error: Uncaught Error: Call to Undefined Function getList()
The error has nothing to do with PDO or mysql, the problem was how you called your method getList Fatal error: Uncaught Error: Call to Undefined Function getList() For methods (functions) of classes…
-
8
votes2
answers14161
viewsA: Video run in a div as background
Both other responses used fixed and z-index negative with exaggerated values, may even work, but it is very likely that will cause you a lot of headaches to apply in a ready layout, the ideal is to…
-
2
votes2
answers82
viewsA: XHR in javascript for Python displays three times the return
Maybe the problem is your if it’s wrong: if (this.readyState = 4 When the right thing should be: if (this.readyState == 4 Thus: sendRequest = function() { var http = new XMLHttpRequest();…
-
3
votes1
answer2229
viewsA: how to start youtube video automatically in iframe without autoplay?
If the intention is to monetize Even if it is possible to force play by simulating that it was a human who clicked on play in order to monetize Youtube will know the difference, Google is the…
-
3
votes3
answers368
viewsA: How do I switch to switch to css?
I believe this is because href is converted to the absolute address, so you can make the selector so href$="theme_4_0.css", outside that I believe that you have reversed the selectors, I believe…
-
2
votes1
answer106
viewsA: How to redirect all HTTP requests to HTTPS in Silex?
As stated in SOEN I guess that’s how it is: $app = new Silex\Application(); $app['controllers']->requireHttps(); $app->get('/', function () use ($app) { return 'Olá mundo!'; });…
-
3
votes2
answers676
viewsA: Inc and MVC extension in PHP
Not inc is not mandatory and is not a de facto standard, in fact there are better standards like the http://www.php-fig.org/psr/psr-4/, basically who uses Composer uses PSR-0 and PSR-4. Another…
-
3
votes1
answer3372
viewsA: Error Call to a Member Function prepare
Missing one return inside Conecta, do so: public function Conecta(){ try { return new PDO($this->sql,$this->user,$this->pass); }catch(Exception $e) { var_dump($e); } } If the return is not…
-
4
votes3
answers715
viewsA: Calculation of incorrect multiplication
The response of Anderson explains why, just like these questions: What 1e+24 Chrome console means? Inaccurate result in broken numbers calculation What is the maximum decimal places allowed in the…
phpanswered Guilherme Nascimento 98,651 -
4
votes1
answer720
viewsA: how to echo the array using foreach
The -> is used by stdClass and normal class, not arrays, in array we use array[chave], should look like this: <tr> <td><?= $c['id'] ?></td> <td><?= $c['nome']…
phpanswered Guilherme Nascimento 98,651 -
4
votes1
answer1374
viewsA: How to sort an array with php
To order you can use uasort in order to be able to navigate through the contents of each array with a callback, the first parameter will be the current item and the second will be the next one, then…
phpanswered Guilherme Nascimento 98,651 -
0
votes1
answer182
viewsA: How to enable option to paste image into Chrome?
I believe the plugin http://ckeditor.com/addon/imagepaste should resolve, however it is well outdated, since 2013 no updates To install extract the contents and put in the plugins folder to stay…
ckeditoranswered Guilherme Nascimento 98,651 -
16
votes1
answer368
viewsA: Why do they say $_GET in PHP is insecure against sql Injection?
Is not the $_GET which is unsafe, the problem is how it uses it. The data may come by $_GET, $_POST, $_COOKIE or even a string previously saved to a file and later added to a query execution. The…
-
6
votes3
answers134
viewsA: Why do libraries use "! function_exists('function')" always when there is a statement of a function?
A common example of this is Laravel, specifically the reason is that the functions have names well simpleton and easy conflict with other scripts, as it may be that other scripts have already used…
-
6
votes1
answer732
viewsA: How does the web page rendering process work by the browser?
There is no specific thing, it does not occur in the front end in fact, or it is dependent on javascript or something like that, the issue is that internally a browser has a "engine" (more than one)…
-
1
votes1
answer1224
viewsA: Leave Iframe Responsive, without involving it in any element
Technically responsive is controlled by media-queries, with variations depending on the situation, but in your case a width: 100%; must solve: .content iframe { width: 100%; border: none; } <div…
-
6
votes2
answers124
viewsA: Know if user has Waze installed
According to this reply (I don’t know if anything has changed in the new Apis, as needed I will adjust the code), you can do this: private boolean isPackageInstalled(String packagename,…
-
1
votes1
answer75
viewsA: Error in site map xml
XML has four extra lines: Remove them and the problem is solved, the <?xml ... must be the first thing, there can be no kind of space before it.…
-
3
votes3
answers2181
viewsA: Error "class Domdocument not found" when trying to run Phpunit
To install in Ubuntu I think this is the command, if it is php5.6: sudo apt-get install php5.6-xml Other linux based on Debian or older versions of Ubuntu I think works like this: sudo apt-get…
-
8
votes3
answers302
viewsA: What is a module in PHP?
I may be mistaken, but choosing the term module is to refer to two situations where the return can be used, for example I believe that the majority will assume that the return is used in functions,…
-
0
votes1
answer46
viewsA: Scrolling is not working
You probably changed the oveflow:; of body, html or added a new overflow to an element within the body, see that your code works well here: $(document).ready(function () {…
-
0
votes1
answer123
viewsA: How to popular an Sqlite database through a . sql file?
I don’t understand of Typescript, but I believe it is a language that is converted to Javascript later (correct me if I’m wrong), so you can use native Apis like FileReader or XMLHttpRequest, if you…
-
3
votes1
answer1677
viewsA: move_uploaded_file(): Unable to move
You are wrong @mkdir(DIR_ARQUIVOS.$chave, 777, true), mkdir should use octal, exchange 777 for 0777 @mkdir(DIR_ARQUIVOS.$chave, 0777, true) Read more details on:…
-
1
votes1
answer143
viewsA: Access denied for printing iframe in Firefox
You cannot run some scripts in an iframe directly, you can try using contentWindow: var cw = frame.contentWindow; cw.focus(); cw.print(); If it’s in different domains or different protocols maybe…
-
4
votes1
answer3076
viewsA: How to get the local IP address using PHP?
It is not possible any external server access the "local IP" (IP of an internal network), I got to comment something about this here: Mac Address validation algorithm The most that an external…
-
5
votes3
answers5128
viewsA: How to allow only numbers and dashes with preg_replace?
preg_replace is not to check but to remove, if you want to remove everything but numbers and hyphens do so: $ola = preg_replace('/[^\d\-]/', '',$_POST['ola']); ^ is denial \d is any number \- is…