Posts by Guilherme Nascimento • 98,651 points
2,383 posts
-
1
votes1
answer470
viewsA: Why does PHP accept to instantiate a class through a value of a variable, but not of an array?
I’m not sure, but if this doesn’t work it’s probably to avoid complex variables, this can make the php interpreter difficult, so in php7 some things have become more limited, depending on the php7…
phpanswered Guilherme Nascimento 98,651 -
6
votes1
answer423
viewsQ: Can denying access to a mod_rewrite folder be unsafe?
I’m thinking of creating a very limited php microframework just for own use, however I came across a situation, most frameworks uses a folder called public and on the generally production servers we…
-
4
votes1
answer130
viewsA: Are additional measures to prevent SQL injection attacks really necessary?
I don’t quite understand the question, it seems to me that you say that $_GET['params'] is passed to mysql, it does not seem to avoid sqlinjection, I believe there may be two reasons: Friendly URL…
-
0
votes1
answer43
viewsA: Difficulty making Rewriteengine work
First check that it is not your fault in using . htaccess, for example, does your server use Apache itself or use another as Ngnix. Also check that it is in the correct folder or if there is no…
htaccessanswered Guilherme Nascimento 98,651 -
2
votes1
answer1859
viewsA: Intent to call FACEBOOK
Facebook is a website and not a native google app, so you have three options: Call a webView (you don’t need a webView Intent necessarily) or using native browser Calling the facebook app will…
-
0
votes3
answers7687
viewsA: Delete duplicate record from table in Postgresql
According to this reply on Soen you can create a temporary table and use DISTINCT: CREATE TABLE tmp ... INSERT INTO tmp SELECT DISTINCT * FROM t; DROP TABLE t; ALTER TABLE tmp RENAME TO t; I…
-
1
votes1
answer336
viewsA: Device incompatible with Play Store app
You used: <uses-sdk android:minSdkVersion="14" android:targetSdkVersion="19" /> The android:minSdkVersion=14 makes require Android 4.0, if the smartphone or tablet does not use a lower android…
-
1
votes1
answer425
viewsA: PHP Crawlers for external websites API Phpcrawl
But this is basically what Crawler should do, it will be up to you to use a database with the list of sites you want to scan and a cron to schedule the scans, each one cron preferably to schedule…
-
1
votes3
answers105
viewsA: Usercontrol to control Logon Schedules
If I understand your problem, you are having difficulty generating html, css, js and not necessarily a problem with UserControl. I don’t have much knowledge of microsoft tools, but since the problem…
-
7
votes1
answer76
viewsA: Sitemap - What to list?
Yes you will have to list all, but usually the xml Sitemaps are just to facilitate the search engine, so you would not need to list all necessarily, could list the main articles or main pages (which…
seoanswered Guilherme Nascimento 98,651 -
6
votes2
answers3718
viewsA: How do I create my own package/project for "Composer" on github?
This error occurs due to 3 possible factors: Typo The package is not available You’re trying to use a package dev The first error is easy to understand, the problem is the second, it is not very…
-
10
votes2
answers934
viewsA: Detect or block redirect with ajax?
I can’t provide a detailed answer right now, but I can say that is impossible detect in Ajax or normal requests the redirect, the only one who knows that there has been redirection is the interface…
-
6
votes2
answers433
viewsA: How to make a form submission without form?
Being only the need to submit the form, you could use ajax, but it does not seem to me the case, yet there is a new Html5 attribute that can help you, is the form="..." and create a hidden form (so…
-
3
votes2
answers484
viewsA: How to show custom page for inaccessible folders in Windows?
This is a complementary answer, just to understand why the ErrorDocument not function as expected. After a long analysis on the old directories, I realized that inside the folder denyfolderwindows…
-
1
votes2
answers788
viewsA: Google Speech API compatibility
I won’t answer exactly what you asked, but I will try to give an answer to make it clear what really is Browser, Engine and Html5. What is HTML5 HTML5 is not a specific technology, it is a set of…
-
4
votes2
answers784
viewsA: Phpexcel generates broken spreadsheet
After testing the updated code you posted, I noticed that the problem occurred on Office2007 also, so I noticed this excerpt: $linha = 2; foreach ( $rows as $item => $contato) {…
-
3
votes2
answers3176
viewsA: base64_encode in javascript
Base64 and javascript The equivalent functions in javascript sane: window.btoa to encode window.atob to decode Source: https://developer.mozilla.org/en-US/docs/Web/API/WindowBase64 var data =…
-
2
votes1
answer15542
viewsA: Error "Warning: mysqli_query() expects Parameter 1 to be mysqli, null Given"
Your code contains several errors, which using mysqli or would not occur, understand this as a constructive criticism: First you can call the bank next to the mysqli_connect: function connect() {…
-
5
votes2
answers331
viewsA: Is there any way to change a file from a tag?
I agree with what the answer @Gypsy and to complement, any problem that exists even in the repository and that is corrected later should be released in a new update so that the flow of a software…
-
11
votes2
answers484
viewsQ: How to show custom page for inaccessible folders in Windows?
I used ErrorDocument to configure custom error pages, but when trying to access a folder that is only accessible with high privileges, instead of showing the custom page is displaying the default…
-
1
votes2
answers1665
viewsA: edit docx file and save to PDF in php
On the response of @henriquedpereira, Phpdocx has two versions a with LGPL license and Pro, the first is free (attention LGPL license) and the last yes is paid. Phpdocx free allows you to…
-
1
votes2
answers725
viewsA: Working with directories to make a require in PHP
An alternative way to another answer would be simply in each file you set the relative path. Assuming the folder structure is: +-- ./ +-- conexao +-- conexao.php +-- pasta1 +-- exemplo1.php +--…
-
5
votes1
answer356
viewsA: How to release frozen/locked thread?
There’s no such thing as unlock, your script is an infinite loop case and can not stop without finishing the whole process, because javascript runs in a single event and what probably froze was the…
-
9
votes2
answers3718
viewsQ: How do I create my own package/project for "Composer" on github?
I never distribute a library using a repository with commiserate, I have no experience with this, what I tried to do was to create a folder structure like this: ./ |-- composer.json |-- src/ |--…
-
2
votes1
answer2127
viewsA: How to create image thumbnails of an existing image within the folder?
First keep in mind that image manipulation using PHP (or any other platform/language) usually consumes a lot of memory depending on the image, and may even cause an error similar to this: Fatal…
-
1
votes1
answer230
viewsA: Loop overload with use of foreach
Is missing the fetch_assoc in your code, you are trying to loop a "Resource" of the executed query: $newsSQL = $MYSQLI->query(...); foreach($newsSQL as $news) This would be right: $newsSQL =…
-
9
votes2
answers2271
viewsA: Is working with Session safe?
Talking about the native PHP API, session data is in a server-side file, which usually sits in a folder outside, public_html or www, and this makes access for the end user impossible. However,…
-
2
votes1
answer673
viewsA: How to create Android app that uses native mobile phone software such as camera, gallery, etc
What you want is solved using the Intent One Intent is an abstract description of an operation to be executed. It can be used with startActivity to launch a Activity, the broadcastIntent to send to…
-
10
votes7
answers811
viewsA: How to write variables in PHP?
In spite of several good answers already existing here, I will put two reasons here that may be very strong for the use of this. But first I must tell you that this is not an index but associative,…
-
0
votes2
answers244
viewsA: Clone repository failed, error: Repository test has failed
According to this response from Soen you must have to point out the executable of git, Download and install git: http://git-scm.com/downloads Point the git.exe at Androidstudio: Settings >…
-
1
votes1
answer81
viewsA: I can’t convert Rails app from sqlite to postgres (to deploy Heroku)
As stated in Soen you must add the username for your database.yml, could very well use your application name (or some variant of the name) as the username, I will use app_name as a reserved space:…
-
2
votes2
answers1089
viewsA: how to leave rectangular image?
I believe there are many ways to do this for example the background-size with background-position, as already quoted. However background-size is not supported for some older browsers (if there is…
-
6
votes2
answers191
viewsA: Does the List<T> Method. Foreach exist?
I don’t know if this is your case, but according to this answer from Soen According to the MS forum: en: List.Foreach has been Removed in Metro style apps. While the method seems simple it has a…
-
3
votes1
answer236
viewsA: Uncaught Syntaxerror Error: Unexpected token <=
Your code is causing Uncaught Syntaxerror: Unexpected token <= It has several lines like this && <=, see that after the && is missing a variable, I believe the correct would…
javascriptanswered Guilherme Nascimento 98,651 -
1
votes1
answer499
viewsA: Pass value to variable in fopen PHP
This phrase of yours seems confusing, because you need something seemingly simple, but you want to do it the "hard way". I will need this for automatic simple page generation, the complete layout is…
phpanswered Guilherme Nascimento 98,651 -
6
votes5
answers3375
viewsA: Console Application without showing console window
According to the answers I found in Soen you can try: Freeconsole: [DllImport("kernel32.dll")] public static extern bool FreeConsole(); Use ProcessStartUpInfo.CreateNoWindow = true; public static…
-
2
votes2
answers1792
viewsA: Json output with json_encode()
As an alternative you can use SET names mysql: $dbh = new PDO(...); $dbh->exec('SET names utf8'); Being Firebird (I couldn’t test): $str_conn =…
-
0
votes2
answers4056
viewsA: File exists but does not include (require_once)
I know you already solved the problem, but just wanted to point out the possible problem, here you use: $path = cleanPath($lib, $class.$ext, DIRECTORY_SEPARATOR); To catch the $path, already here…
-
1
votes1
answer112
viewsA: PHP-CPP Include file inside extension
The Php::include is only used to include real files and probably does not support the protocol data: which is usually (if not only) used for html applications. Note that in the github include method…
-
2
votes3
answers2091
viewsA: Place an image in the center of another image in PHP
You can use imagecopymerge for this, as described in the documentation: bool imagecopymerge ( resource $dst_im , resource $src_im , int $dst_x , int $dst_y , int $src_x , int $src_y , int $src_w ,…
-
3
votes1
answer435
viewsA: How to get all image properties uploaded?
If you do so: print_r($_FILES['arquivo']); He’ll give you all the properties: Array ( [name] => arquivo.png [type] => image/png [tmp_name] => /tmp/php5Wx0aJ [error] => 0 [size] =>…
-
3
votes1
answer1420
viewsA: Is it possible to synchronize a mysql server with a local Firebird database?
First I want you to understand that Firebird and Mysql does not have a "so good" compatibility and would probably not be able to import the data from one another, each database and table that a…
-
0
votes2
answers317
viewsA: Send text with Client Socket from a form that is displayed above another Form that is always at the top
If I understand correctly: StrCommand := Socket.ReceiveText; Receives a text sent by: Form1.CS1.Socket.SendText('<|Hello_To_Server|>' + Edit1.Text + '<<|); Then note that you wrote…
-
2
votes2
answers120
viewsA: spinner change image cause error: Out of Memory on a byte allocation
I’m not sure if this is the problem, but according to this answer from Soen: This mistake Out of memory on a 9288016-byte allocation that there was a memory leak. You’re trying to allocate ~8MB of…
-
1
votes2
answers78
viewsA: Someone can help with that code
You did it: private $loadedFromPath = 'C:\Ot\'; But when did you use \ you escaped the ', the correct would be: private $loadedFromPath = 'C:\Ot\\'; Read more about the "Parse" error in: Script…
phpanswered Guilherme Nascimento 98,651 -
3
votes4
answers257
viewsA: Use of setters in the builder
Thereby: this.nota = n1; this.nota2 = n2; You are accessing the variables directly. Already these two are methods that can do anything: this.setNota1(n1); this.setNota2(n2); In case setNota1 be it…
-
1
votes1
answer27
viewsA: Doubt with column Bank
This data format is generated by serialize php, it is used to convert php variables and a format that can be stored, mainly arrays. When you do this: <?php $data = array( 'nome' => 'Thalles',…
mysqlanswered Guilherme Nascimento 98,651 -
1
votes1
answer553
viewsA: .HTACCESS doubts(special mod_expires)
the Expiresdefault part sets the default expiration of all items(gif, png, css, js..) ? Not only of gif, jpeg, png, but of any page accessed, even the dynamics. However you can use…
htaccessanswered Guilherme Nascimento 98,651 -
5
votes2
answers5074
viewsA: What is the use of 'SELECT 1'?
I believe it’s for "nay" bring the results pro "return", as in the case is a sub-query then you wouldn’t need to set any column, but still you need to write something. We usually do this when we…
-
1
votes1
answer839
viewsA: How to set a time to automatically shut down your computer with a Batch file
Missed a line break @ECHO OFF shutdown -s -t 1800 Note that everything that comes after a specific command (the ECHO for example) is not executed is considered its parameter, so the line break is…