Posts by Guilherme Nascimento • 98,651 points
2,383 posts
-
2
votes1
answer50
viewsA: Variable method name
I believe this is not possible and even if it was I think it would not be a very cool practice. If I understand the your comment, I recommend you maybe create a array associative, I will try to…
phpanswered Guilherme Nascimento 98,651 -
2
votes1
answer2389
viewsA: View PDF on android
Just a tip on Java and android, there is no way to put applications inside ./assets and runs them, what you do is use a Intent to access another application installed on Android or else you put a…
-
2
votes2
answers3379
viewsA: Mysqli INSERT INTO Does not work
When you’re in development use it like this: <?php error_reporting(E_ALL|E_STRICT); //Irá mostrar qualquer erro $hostname = "localhost"; $username = "root"; $password = ""; $dbdatabase =…
-
0
votes1
answer1027
viewsA: How to get a certain php variable inside the view in the controller
[Edited] Note that your html uses name=inicial: <input type="hidden" name="inicial" value="<?php echo $letra;?>" /> But the $_POST['alfabeto'] use the key alfabeto, when the correct…
codeigniteranswered Guilherme Nascimento 98,651 -
2
votes3
answers1909
viewsA: Capture Input ID
You can use Ajax with jQuery: var field = $("input[name=adicional]");//Pega o seu campo $.ajax("pagina.php", { "type": "POST", "data": { "id": field.attr("id"), //Envia o id "adicional": field.val()…
-
3
votes2
answers52
viewsA: How to use "position:absoluted" correctly?
A detail, the correct is position:absolute and not position:absoluted. You put z-index: -1;, This is negative, so it’s going down a layer of level. Use the z-index: 1; or greater: #map_canvas {…
-
2
votes1
answer289
viewsA: Merge 2 mod_rewrite conditions into . htaccess
I believe so, just use one RewriteCond before his RewriteRule and it may also be necessary to use the flag [L]: RewriteEngine On RewriteCond %{HTTPS} off RewriteRule (.*)…
-
30
votes3
answers14943
viewsA: A Base64 image loads faster than a url?
First I want you to think that everything is RELATIVE and only experiences of each situation can determine CASE BY CASE which will perform better on your project and server. There are two…
-
20
votes3
answers3474
viewsA: Why is it sometimes necessary to setTimeout with a value of 0 (zero)?
This is usually used for mistakes or long loops within the callback do not affect what comes after the setTimeout, is an attempt to "simulate" the Multiple threads (multithreaded), is not a thread…
-
3
votes2
answers293
viewsA: Does Zend Framework work with Nginx (without apache)?
I believe that the only dependencies of Zf2 are in relation to PHP and mod_rewrite (if you’re going to use friendly urls) as quoted in own manual of the Zf!. If you’re gonna use the friendly urls…
-
1
votes1
answer130
viewsA: Launch an error with trigger_error or Exception in a different scope
I found a great example in Soen which allows to somehow use inform what scope the custom method was called. It will be necessary to use the $trace = debug_backtrace(FALSE); that lets you know where…
-
2
votes1
answer130
viewsQ: Launch an error with trigger_error or Exception in a different scope
Suppose I have a function in a file called foo.php: <?php function foo() { trigger_error('Olá mundo!', E_USER_ERROR); } And in the index.php file I would use it like this: <?php require…
-
4
votes1
answer30656
viewsA: Internal Error Server UID of script is smaller than min_uid
As stated in Soen This looks like a problem with the suPHP. Change the user and group of your script to the user running your webserver process. So if you’re running an Apache with user www-data for…
phpanswered Guilherme Nascimento 98,651 -
6
votes1
answer336
viewsA: How to work layouts and javascript in php frameworks
What is a framework Not every framework is used for software architectures like MVC, so the term framework will not always refer to MVC/HMVC/MVCP, etc. The term framework is used to refer to…
-
1
votes2
answers437
viewsA: Question how to submit a JSF form using <p:confirmDialog>
According to the documentation http://www.primefaces.org/showcase/ui/overlay/confirmDialog.xhtml the use would be something like: Xhtml would look like this: <h:form> <p:growl id="message"…
-
3
votes1
answer1252
viewsA: Open Folder to select File
According to these two answers found in Soen: https://stackoverflow.com/a/24202891/1518921 https://stackoverflow.com/a/31874587/1518921 Adding the JFileChooser Apparently JFileChooser not this gift…
javaanswered Guilherme Nascimento 98,651 -
3
votes1
answer109
viewsA: Error Generating PDF with Phpmailer
Some things to understand: Phpmailer does not generate Pdfs, it just sends emails file_get_contents takes the contents of the files and not the response to the execution of a file, so if php test.…
-
6
votes1
answer1853
viewsA: Ignore all files except one specific in GIT
I didn’t understand the /assets at the end of: !assets/script/xmutarn.js /assets The exclamation sign means "denial" ! ie the file on the line will not be ignored. I believe that to ignore the…
-
0
votes1
answer2656
viewsA: Add more than one image in PDF using mpdf
It seems to me that your problem is nowhere near: however it is possible to send only one image, and I wanted to send more than one image The way you did the upload is what allows you to send only…
-
4
votes1
answer739
viewsA: How to connect JDBC (H2 Database) in PHP?
According to the link http://www.h2database.com/html/roadmap.html: PHP support: H2 should support PDO, or test with Postgresql PDO. PHP support: H2 should support PDO or test with Postgresql PDO I…
-
2
votes1
answer181
viewsA: Unlink is not working within loop
I noticed something very important, your file /home/storage/1/05/41/lcjprojetos/public_html/admin/excluirprojeto.php this inside the folder admin, when you perform…
-
11
votes4
answers29938
viewsA: Regular expression to accept only numbers and a ","
First, /\D/g does not take numbers he is the denial of \d that should be the right one to use. To write more than one condition within a regex you must use |, would look something like: /\d|,/g…
javascriptanswered Guilherme Nascimento 98,651 -
2
votes1
answer55
viewsQ: class_exists is running spl_autoloader_register
I created a simple script to automatically load classes using spl_autoload_register, but I noticed a strange behavior when I use class_exists the spl_autoload_register is executed, example: <?php…
-
4
votes2
answers411
viewsA: What are the differences between find() and eq() selectors?
In a short answer, there are many ways to do the same task, basically the difference is that: eq() uses the index number of the selection vector. filter() filter the selection items find() uses a…
-
2
votes1
answer170
viewsA: Force to allow email in the facebook api
I don’t know how you’re using and which version, but the logic doesn’t change much if you did something like: $fb = new Facebook\Facebook(array( 'app_id' => '{app-id}', 'app_secret' =>…
-
10
votes3
answers6934
viewsA: Symbol "->" in php
The symbol is used to call a method or variable from a class. First of all you need to understand what a class is, if you’ve heard of OOP or of Object-oriented then you will understand the use of…
phpanswered Guilherme Nascimento 98,651 -
10
votes1
answer5068
viewsA: Project directory list in Laravel is displayed instead of running the application
Note that the instructions given here are made on the basis of Laravel 5.1, may or may not work in Laravel 4.2 The folder you have to access is the public (I also got confused the first time I used…
-
13
votes2
answers315
viewsQ: filesize for files larger than 2GB on x86 platforms
I was reading the PHP documentation and I noticed this information: Note: Because PHP’s integer type is Signed and Many Platforms use 32bit integers, some filesystem functions may Return Unexpected…
-
4
votes1
answer930
viewsA: Autoload PSR4 class
Following the structure you used, simply create an event in a . php file that will be included within the index.php (which should go inside of public_html), note that the public_html will be your…
-
3
votes2
answers1264
viewsA: Send message to browser
If you are creating a basic page or are studying the principle would be to create a link to trigger the event (not necessarily needing ASP.NET) in html: <a href="javascript:void(0);"…
-
4
votes4
answers989
viewsA: Read input value type file doubt
Basically the same answer from Wallace, though I’ll explain it another way. The .files is a native property of the Javascript DOM API, so it will only be accessible on when you use…
-
1
votes1
answer388
viewsA: Error synchronizing: Could not reserve enough space for 1048576KB Object heap
By error message it seems to me that the reserved space has been exceeded and the following message: Java Hotspot(TM) Client VM Warning: ignoring option Maxpermsize=256m; support was Removed in 8.0…
-
0
votes1
answer147
viewsA: jQuery AJAX transforming into link
The issue is not the result of the bank is how you want this link and where it should point, let’s assume that you want to use the idroteiro_aula to generate the link, so since you are using .html…
-
1
votes1
answer310
viewsA: How to get thumbnail Wordpress with pure PHP?
This metavalue seems to be a variable "serialized" with http://php.net/manual/en/function.serialize.php Then just use the unserialize It would look something like: while ( $linha = $stmt->fetch (…
-
2
votes2
answers1135
viewsA: Check if pattern is followed, JSON and PHP
If with parameters, you mean "keys" then you can do using array_keys that will take the key name, code, etc from the variable $parametrosdBase and use the array_key_exists to check if the key exists…
-
4
votes1
answer339
viewsA: When using each data type of mysqli_stmt_bind_param
As told by @rray b is used for binary data, for example photos, zipped files, etc. The guys VARCHAR and TEXT are fields that use string that is accept from A to Z from 0 to 9, so the use should be…
-
3
votes2
answers2315
viewsA: Export table to file using PHP
Save bank via terminal If you just want to take a backup, then maybe you don’t need PHP to use SSH and download it to the folder and then use FTP to download it, the command to back up is this (as…
-
0
votes3
answers93
viewsA: Error "Class Swift_keycache_simplekeycacheinputstream does not exist"
You probably forgot some addiction, I don’t know for sure. If there is no Composer.lock file, then Composer will read your dependencies and versions that are in Composer.json and will create the…
laravelanswered Guilherme Nascimento 98,651 -
3
votes1
answer439
viewsA: How to use Prepared statements with external variables in Mysqli
First, I recommend using object-oriented so use all mysqli events like Oop and one more detail it looks like you forgot the mysqli_stmt_prepare, do so: <?php include "../conex.php"; // Transforma…
-
2
votes2
answers1618
viewsA: Passing parameter using the " String[] args" declared in main
A detail, String[] is not String, this symbol [] means that this is an "array" of the string type. That is, it carries one or strings. For example this code: public class Exemplo { public static…
-
2
votes1
answer2332
viewsQ: How to break strings on more than one line without concatenating?
Whenever you need to write something very soon in a string in Javascript I need to concatenate, something like: var str = 'foo bar foo bar foo bar foo bar foo bar foo bar' + 'foo bar foo bar foo bar…
-
4
votes1
answer2332
viewsA: How to break strings on more than one line without concatenating?
As this response from Soen is possible using the backslash This: var str = "foo bar foo bar foo bar foo bar foo bar foo bar \ foo bar foo bar foo bar foo bar foo bar foo bar"; Will result in: foo…
-
12
votes1
answer2472
viewsA: What is spl_autoloader_register in PHP?
The spl_autoloader_register is a function that is part of the SPL which means Standard PHP Library, which in English would be something like Standard PHP library Maybe a better adapted translation…
-
2
votes2
answers108
viewsA: Script to open index.html from multiple folders
A simple example of loop with bash would be like this: #!/bin/bash COUNTER=12690 while [ $COUNTER -lt 12695 ]; do firefox -new-tab "http://www.exemple.com/1/43530/${COUNTER}/index.html" let…
-
22
votes1
answer3143
viewsA: Detect Adblock and display a message
There is a plugin for this called Blockadblock (or Fuckadblock), it is supported by the following browsers: Google Chrome Mozilla Firefox Internet Explorer (8+) Safari Opera Installation You can…
javascriptanswered Guilherme Nascimento 98,651 -
5
votes2
answers2377
viewsA: Write image with php
Friend a very important detail that needs to be highlighted, you used the source path with http: $font_path = 'http://meu-site.com/custom/TravelingTypewriter.ttf'; imagettftext($img, 50, 0, 10, 20,…
-
1
votes1
answer752
viewsA: Error loading mcrypt extension: Extension "mcrypt" must be Loaded
As stated in the Soen on Ubuntu when we use sudo apt-get install php5-mcrypt it does not install the extension in the folder mods-available, to solve this it will be necessary to create a symlink,…
-
2
votes2
answers271
viewsA: Image appears "broken" after you changed the PHP version
There are three possible problems that may have caused the failure: You used <? instead of <?php, recommend that you always use <?php. You used $num instead of $_GET['num'] To solve this…
-
5
votes1
answer1068
viewsA: Delete image from BD and server destination folder simultaneously
There are a lot of problems in your script: You should take into consideration is the use of relative paths, if the folder ./upload/ is not in the same directory as the folder in your script, so it…
-
1
votes1
answer279
viewsA: How do you create a javascript function to filter audio rss(podcast) for a project?
The domain of .globo.com supports Cross-Origin, according to the header’s response when accessing the address http://imagens.globoradio.globo.com/cbn/podcast/cardapios/tecnologia.xml:…