Posts by Renato Tavares • 2,031 points
88 posts
-
1
votes1
answer248
viewsA: Sort While by insertion into MYSQL Database
Try something like that: <?php $servidor = 'localhost'; $banco = 'apixel_galeria'; $usuario = 'root'; $senha = ''; $link = @mysql_connect($servidor, $usuario, $senha); $db =…
-
1
votes1
answer62
viewsA: store SQL query in Session for further processing
In a succinct way, yes. It would make your application faster since it would not make queries in the database, but it is important to keep in mind the reliability of the data. You need to create…
-
2
votes2
answers107
viewsA: Problems when using Heredocs
Error of the heredocs, according to the official documentation, occurs when a there are characters in the same row of the closing identifier It is very important to verify that the line of the…
phpanswered Renato Tavares 2,031 -
1
votes1
answer114
viewsA: Why does gmail receive php email and outlook does not receive or send spam?
Try to use this version more complete and check if it resolves. Whenever I use the form I posted below, all servers receive quietly. <?php $subject = 'Assunto'; $from = '[email protected]'; $to =…
phpanswered Renato Tavares 2,031 -
0
votes2
answers302
viewsA: Codeigniter session expires quickly
Try setting the session to a very large number instead of using zero. Try: time()+(3600*24*365*5) or time()+157680000; This session should last about 5 years.…
-
2
votes2
answers562
viewsA: Change the color of a box in the horizontal menu
You did not set the box size of the li:Hover, when setting a size for it, the color will fill the whole space. So forehead: li:hover { margin: 10px; padding: 12px; background-color: red; }…
-
1
votes2
answers1933
viewsA: Authenticate by SMS
I created a software in python that communicates with 3G modems and send SMS. It was very quiet, I suffered a lot to find a good modem, but the software was easy. But paid companies have:…
-
0
votes2
answers74
viewsA: Ranking order of time
You just want to take the amount of seconds the guy spent and display it in a legible way, right? Like, if I spent 65 seconds solving, you want to show that I spent 00:01:05 correct? Ever thought…
-
1
votes1
answer538
viewsA: SQL query normalize accents, til
Try sending a query SET NAMES utf8; Personally I solved the same problem by adding after the mysql connection code : mysql_set_charset("utf8"); or: mysqli_set_charset("utf8"); or the equivalent in…
mysqlanswered Renato Tavares 2,031 -
1
votes1
answer714
viewsA: Mysql - Update to null Unique column
Yes, you can do that. see the Mysql documentation (version 5.5). The UNIQUE index creates a Constraint such that all values in the index must be distinct. An error occurs if you Try to add a new Row…
mysqlanswered Renato Tavares 2,031 -
1
votes2
answers75
viewsA: Take the form information and send it to e-mail
You really have to use a server language to send your email. PHP is very good at this, read here a very complete article on how to do this. There is also Phpmailer, here is another article…
-
1
votes1
answer367
viewsA: Codeigniter:function Anchor
Check the file autoload.php in the briefcase config or in his controller and place the following function: <?php function __construct(){ parent::__construct(); $this->load->helper('url'); }…
-
3
votes1
answer121
viewsA: Private functions via ajax - Code Igniter
You can use $this->input->is_ajax_request() class input: if (!$this->input->is_ajax_request()) { exit('No direct script access allowed'); }…
-
1
votes1
answer230
viewsA: How to view the SQL executed by php when using the functions "prepare()" and "execute()"?
Try to use the debugging(); it prints what you want and even more stuff. Helps when debugging SQL.
-
1
votes2
answers7557
viewsA: How to Save Read Chained List in File?
You can try using a function similar to the one shown below: /** * Insere um novo registro no arquivo especificado. A função SEMPRE * insere o novo registro no final do arquivo, assim os dados *…
-
2
votes2
answers2114
viewsA: How to perform an action when reaching a certain scroll height?
Have you tried using the .one() of agreement with the documentation it is executed only once. The example is the following: $( "#foo" ).one( "click", function() { alert( "This will be displayed only…
-
1
votes3
answers2044
viewsA: Problems with session_start()
Try to use the session_start(); only once in the login. 2nd place session_start(); at the beginning of the restricted page file. I think the second option is the one that will solve your problem,…
-
12
votes3
answers5509
viewsA: What’s the difference between using Inner Join or Where relationships
They are wrong. The notation inner join was introduced in the SQL92 version of the ANSI SQL standard. All major databases adopt the SQL92 join syntax. Since most servers were already on the market…
sqlanswered Renato Tavares 2,031 -
0
votes3
answers2156
viewsA: The 4th edition of the Javascript book: Is the Definitive Guide still a reliable source?
Yes, I have the book and it was exceptional for my Javascript learning. The book (as the author himself says in the first pages) is directed mainly to the public who never had any contact with the…
javascriptanswered Renato Tavares 2,031 -
2
votes1
answer110
viewsA: Is using functions like parameters for other functions slower?
No. In your example the time difference is insignificant, don’t worry about it. I believe a significant difference will only be noticed in recursive functions that abuse function calls. If you…
phpanswered Renato Tavares 2,031 -
3
votes2
answers1341
viewsA: How to make a menu that has a geometric figure in the center and is responsive?
You can create a trapeze as follows #trapezoid { border-bottom: 100px solid red; border-left: 50px solid transparent; border-right: 50px solid transparent; height: 0; width: 100px; } In this link…
-
4
votes2
answers1029
viewsA: Schedule page loading through CRON
Better run crontab directly on the server. crontab has the following format: [minutos] [horas] [dias do mês] [mês] [dias da semana] [usuário] [comando] The completion of each field is done as…
-
1
votes2
answers778
viewsA: Node.js, Ror or PHP?
I would choose PHP for the amount of documentation available on the internet, examples and tools to work with. Node.js is also very good, but as it is relatively new, the information is still few…
-
0
votes2
answers3899
viewsA: Lock Printscreen function
Would something like this not work? $(document).keyup(function(e){ if(e.keyCode == 44) return false; });
-
2
votes1
answer67
viewsA: Is there some kind of dissemination of min and max ZIP of a specific region?
In this format you want there is nothing (yet), I usually use some API like this one: http://apps.widenet.com.br/busca-cep/api-de-consulta to discover the city the person is and so perform actions…
post-officeanswered Renato Tavares 2,031 -
4
votes4
answers3475
viewsA: How to return 2 variables of a function
In Java, when you want a function to return multiple values, you must: add these values to an object and then return them or change an object that is passed to the function In your case, you need to…
-
0
votes2
answers268
viewsA: Large images corrupted or truncated when pulling from SQL server with PHP
As it works for small images, it may be memory problem, try to increase the memory available for PHP and your database. Increase memory php.ini memory_limit = 64M .htaccess php_value_memory_limit…
-
1
votes3
answers220
viewsA: Select "Cancel" in Alert by default
You cannot do this. The focus of the default option is even OK. Instead of confirm you can use the library below. http://tristanedwards.me/sweetalert In addition to solving your problem, it improves…
javascriptanswered Renato Tavares 2,031 -
1
votes3
answers384
viewsA: Multilojas Different Checkouts
Possible it is yes. The problem is that whenever I tried this, I ran into problems related to payment gateways, most of them do not accept a multiple checkout. Imagine that the transaction response…
magentoanswered Renato Tavares 2,031 -
0
votes2
answers84
viewsA: Doubt Web Layout
I have already made a similar batsante application here at the company, I did not use any tool to speed up development, even because I did not find any. I used CSS3, HTML5, LESS and Javascript for…
-
2
votes1
answer1533
viewsA: 403 Forbidden You don’t have permission to access / on this server
The right thing would be: <VirtualHost *:8080> DocumentRoot "C:\wamp\www\application\public" ServerName application.com.br ErrorLog "logs/application.log" CustomLog "logs/application.log"…
-
0
votes2
answers271
viewsA: Using data in the database
Although the question is not clear, already tried to check your SQL is correct? select *from quiz where id = ? I think the right thing would be: select * from quiz where id = ?…
-
5
votes1
answer74
viewsA: Create an array with dynamic variables
I think that would be a solution. for($i=1;$i<=40;$i++){ $myArray[${"horario" . $i}] = get_custom_field('horario'.$i); } In this case the $myArray variable would have the list of all variables…
-
2
votes2
answers364
viewsA: Problem to handle XML
This is a common mistake when you have comments or whitespace right at the beginning of your XML. Check if there is something like this in your document. There are these two links that point out…
-
12
votes4
answers6198
viewsA: Javac does not compile. java
After installing the JDK (Java Development Kit), open the properties of your computer, ( + Pause Break or Initiate → Control Panel → System) and click on Advanced System Settings. Click on…
javaanswered Renato Tavares 2,031 -
2
votes3
answers1863
viewsA: Return of content by Curl
Be careful with the CURLOPT_SSL_VERIFYPEER it be set to true to check the secure connection (already suffered a lot with this). curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, true); Second, to display…
-
0
votes2
answers537
viewsA: Automatic e-mail picking up data from Oracle database
You will need several things separately, first of them and a crontab running every day at 10:00AM, second and a correctly configured SMTP server, only after that should you create a bank access…
java-eeanswered Renato Tavares 2,031 -
0
votes2
answers687
viewsA: $_Session variable does not write to database
Try using serialize if you really need to save it the same way you get it http://php.net/manual/en/function.serialize.php I prefer to save this in separate value and recover later.…