Posts by Kenny Rafael • 6,698 points
139 posts
-
2
votes3
answers13134
viewsA: How to make a dowload inline file available in html?
Just do this: <img alt="Embedded Image" download="Embedded Image" src="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAADIA..." />…
htmlanswered Kenny Rafael 6,698 -
4
votes3
answers3146
viewsQ: Error when performing a database query
I’m using Zend and have the following function: public function getChamado($id) { try { $cols = array( 'id', 'titulo', 'descricao', 'fk_status', 'fk_local', 'fk_tipo', 'created', 'modified',…
-
59
votes5
answers6588
viewsA: Should error messages apologize?
Good humor is a trend that is gaining strength in these cases, mainly on the web. E-commerce stores, for example, use messages like: Oops! By the way our promotions have been successful, we are…
-
2
votes1
answer322
viewsA: Problem creating "Zend_session"
I resolved it as follows, in Bootstrap.php I did all the configuration, first I check if there is the login, check the data in the database, save the values to access the specific user’s database…
-
6
votes1
answer322
viewsQ: Problem creating "Zend_session"
I’m trying to create a session on Zend as follows: if (isset($_POST['login'])) { Zend_Session::start(); $session = new Zend_Session_Namespace(); $login = explode('-', $_POST['login']); $codigo =…
-
3
votes3
answers1058
viewsA: Createelement() method in PHP
Exists in PHP a domdocument class, which makes it possible to achieve the desired. Example making use of the method createelement: <?php $domDocumento = new DOMDocument('1.0', "UTF-8");…
-
4
votes2
answers1232
viewsQ: Differences when instantiating a class
Using the PHP when instantiating an object I do it as follows: $obj = NEW my_class_exemplo; but always the netbeans auto complete gives me the option to put parentheses like this: $obj = NEW…
-
13
votes5
answers704
viewsQ: Event is not tied to the element
I have an event at jQuery (version 1.5) as follows:: $('#refresh_abertos').click(function(){ // aqui o código irrelevante nesta pergunta }); Turns out my element #refresh_abertos is only loaded…
-
4
votes2
answers4325
viewsA: Permission denied when moving file with move_upload_file on Linux server
I went to check the directory and saw that it was with permission 775, I switched to 777 and while trying to save the file again occurred all ok.
-
11
votes2
answers4325
viewsQ: Permission denied when moving file with move_upload_file on Linux server
I’m trying to use the move_upload_file to move a file sent by the user to its final destination: $pasta = '../../public_html/admin/helpdesk/ticket/uploads/'; if (!empty($_FILES['img']['name'])) {…
-
3
votes1
answer135
viewsA: How to insert style into a Zend_form_element_select element?
You can use the setAttrib to enter your attribute and value: foreach ($this->getElements() as $element) { $element->setAttrib('class', $minhaClasse); } More about, here.…
-
6
votes2
answers3444
viewsA: How to count the amount of occurrence of a substring within a string?
Use this: import org.apache.commons.lang.StringUtils; public int calcCaracter(String MinhaString, String Char){ int qtd = StringUtils.countMatches(MinhaString, Char); return qtd; }…
-
7
votes4
answers4319
viewsA: String concatenation in SQL
Try this: SELECT sv_users.userID as `usuarioId`, sv_users.userNome as `nome`, sv_users.userSobrenome as `sobrenome`, CONCAT_WS(` `, `nome`, `sobrenome`) as nome_completo, sv_users.userDataNascimento…
-
18
votes4
answers15751
viewsA: How to check if an image exists in a remote URL?
For this you use the file_exists, apart from remote URL it works with absolute or relative paths of the server itself, in this way:…
-
12
votes2
answers2445
viewsQ: What is the syntax for searching with array as parameter in Mysql?
What is the correct syntax, if possible, to pass an array as parameter, using the FIND_IN_SET more or less in this idea: SELECT c.cpf FROM tbl_cliente as c WHERE FIND_IN_SET(array, c.cpf);…
-
2
votes3
answers490
viewsA: Scroll bar not hidden in Internet Explorer
When I had this problem in IE I did it this way: .divOverflowHidden{ display: inline-block; position: relative; } .divFilhos { position: absolute; } worked for me, I no longer have this link more…
-
14
votes6
answers10949
viewsA: How to measure code performance in PHP?
The function microtime in my opinion is yes the most appropriate, but you can use it in a slightly more refined way: $inicio1 = microtime(true); //Seu primeiro script $total1 = microtime(true) -…
-
15
votes4
answers13879
viewsA: How to detect if an HTML element is empty?
Try this: if ($('#element').is(':empty')){ //seu codigo }
-
6
votes7
answers7922
viewsA: Convert an array of floats to integer
Try this: a = array( [1.1, 2.2, 3.3] ) b = array(a, 'int') File "<stdin>", line 1, in ? TypeError: Array can not be safely cast to required type b = a.astype(Int)…
-
0
votes4
answers1135
viewsA: Javascript error in Wordpress admin after upgrade to version 3.8
Try to download the original JQUERY, at least version 1.6.1, copy the content and replace the file wp-includes/js/jquery/jquery.js.
-
4
votes1
answer430
viewsA: How to determine the final distance of an element from the footer?
You can do it: $(function(){ $(window).scroll(function(){ var div = $('#div'); var space = $(document).height() - (div.offset().top + div.height()); if(space <= 'quantidade que você quer'){…
-
6
votes2
answers1129
viewsQ: How to check for errors in an XML
I’m using the function simplexml_load_string to load a dynamic XML, but if there are formatting errors in this XML it only returns me false and I don’t know where the bug is, is it possible for me…
-
12
votes2
answers396
viewsQ: Is there a function to display the defined variables?
There is a way to give a "var_dump" in all instantiated variables in that context, without having to put each one inside the var_dump()?
-
9
votes4
answers48488
viewsA: Where should I put a Javascript code in an HTML document?
Javascript is run by the browser as soon as the page is loaded, so it’s a good idea to put the scripts (which can be multiple, there is no script limit per page) in a suitable location (yes, there…
-
2
votes4
answers1488
viewsA: How to close a dropdown if the user clicks another page location?
Since your Drop-down will close if the user clicks anywhere on the page, you can use a generic selector to close it, just by adding this code: $('*').click(function(e){ e.stopPropagation();…
-
1
votes6
answers5183
viewsA: How to reverse the position of a div(and its content and attributes) with another div?
Try this: function alterPosition(idElement1, idElement2){ var div = $(idElement1).clone(); $(idElement1).remove(); $(idElement2).before(div); }…
-
9
votes4
answers13910
viewsA: What is the best way to represent an Address?
Working on a gigantic project, I realized that it is not possible to escape much this way of treating this paradigm, leaving each table separated by street, neighborhood, city...etc. Something…
-
2
votes4
answers8320
viewsA: What is the difference between client-side and server-side code in web development?
Client-side is the one that runs on the client side (e.g. Javascript), i.e., in the user’s browser, Server-side runs on the server (e.g. PHP, JAVA, . NET...)
-
10
votes1
answer215
viewsA: I can’t hide an element with css by taking the data-column attribute
You have to put the value of the attribute in quotes, like this: <style> input[data-column="1"] { display: none } </style> However this type of selector does not work in IE8, you can do…
-
21
votes2
answers15006
viewsQ: How to prevent content selection with CSS?
How to prevent text/content selection from my CSS web page? This would be extremely useful for buttons, anchors, tags and other elements that could be selected without user interest...
cssasked Kenny Rafael 6,698 -
29
votes2
answers15006
viewsA: How to prevent content selection with CSS?
Using the following CSS rules for elements that cannot be selected: #seletor { -webkit-touch-callout: none; -webkit-user-select: none; -khtml-user-select: none; -moz-user-select: none;…
cssanswered Kenny Rafael 6,698 -
5
votes2
answers256
viewsQ: Problems with Zend layout
I have a view that is formed by a layout different from the pattern in my project, Seto it this way: public function init() { //Colocando o layout default…
-
2
votes3
answers20561
viewsA: How to create functions in jQuery?
The syntax for creating a function is: function nomeDaFuncao(){ //conteúdo... } after that you can call her in several ways...…
-
2
votes2
answers750
viewsA: Stretched image in Internet Explorer
The most suitable in these cases is to use something more professional, if it is not an image of background of div, use this plugin for responsive images, it is called adaptive images…
-
6
votes7
answers4242
viewsA: How to reset CSS formatting?
You can use the Generic selector and reset everything as you see fit... *{ margin: 0; padding: 0; ... }
cssanswered Kenny Rafael 6,698 -
10
votes4
answers5177
viewsA: How to handle vectors in a Mysql database?
You have to create an associative table, is the most correct way to do, example: tbl_venda_assoc_product fk_venda fk_produto quantidade 1 1 5 1 2 1 and in your sales table you keep the code, seller…
-
11
votes6
answers2089
viewsA: How to change the bottom lines of a table alternately? With support for older browsers
Put a ternary "if" in the code to know if your $i counter is odd, or even, depending on what it is it prints a css class that you determine will have a different background: echo $i % 2 === 0 ?…
-
7
votes4
answers15388
viewsA: How to make a table responsive using (Twitter) Bootstrap?
With Twitter Bootstrap everything gets easier, you just need to create the right HTML and include the right classes in your tags, since it already has all the CSS created for you to use responsive…
-
26
votes8
answers49747
viewsA: How do I remove accents in a string?
public static string RemoverAcentos(this string texto) { if (string.IsNullOrEmpty(texto)) return String.Empty; byte[] bytes =…