Posts by Rodrigo Jarouche • 756 points
26 posts
-
0
votes3
answers2214
viewsA: Crontab Linux run PHP Script at a frequency of less than 1 minute
First thing is that crontab executes the minimum period of 1 in 1 minute.So I’ll explain to you how you do in this period crontab does not run under the user name. It is not recommended to use root…
-
3
votes3
answers829
viewsA: How can I check if a variable is in date format?
With a regular expression like this(function link preg_match): $string = "07-12-30"; // para anos com 4 digitos preg_match('/^[0-9]{4}[-][0-9]{1,2}[-][0-9]{1,2}$/', $string) if…
phpanswered Rodrigo Jarouche 756 -
0
votes2
answers529
viewsA: Text returning with "?" instead of quotation marks and hyphens
I faked your mistake here. What is probably happening is that even though your site is running in ISO, file_get_contents is already getting the UTF-8 encoding. The three alternatives to tidy up:…
-
0
votes1
answer108
viewsA: PHP - error handling
You can pick it up by content lenght: <?php if ( $_SERVER['REQUEST_METHOD'] == 'POST' && empty($_POST) && empty($_FILES) && $_SERVER['CONTENT_LENGTH'] > 0 ) {…
phpanswered Rodrigo Jarouche 756 -
3
votes1
answer400
viewsA: E-mail Phpmailer to Hotmail
The door used by Hotmail is door 587, so: $mail->Port = 587; What can be tried besides changing the port, is to change the Smtpsecure , since the Hotmail uses Starttls, then: $mail->SMTPSecure…
-
4
votes1
answer112
viewsA: Print in php custom paper
A tip, whenever I faced the problem I used some library to generate PDF files, FPDF is old but solves these problems. It will generate the PDF of the paper size you need. A minimum example <?php…
phpanswered Rodrigo Jarouche 756 -
4
votes2
answers1804
viewsA: Php connected with SQL Server
You have two options to try: $pdo = new PDO ("mssql:host=$hostname;dbname=$dbname","$username","$pw"); or $pdo = new PDO( "sqlsrv:server=$serverName ; Database=$dbname", "$username", "$pw"); It…
-
1
votes1
answer225
viewsA: How to perform with parser authentication on a site that needs to login and parse its HTML content?
If there is no no kind of security against that(the site may simply require you to type in) you can use the URL call with the following format: https://user:[email protected]/ There is a debate…
-
1
votes1
answer55
viewsA: Associate images to category
First thing gives an order by in your query: select * from TB_CATEGORIA inner join TB_GALERIA on TB_CATEGORIA.PK_CATEGORIA = TB_GALERIA.CATEGORIA where (TB_CATEGORIA.DELETED IS NULL OR…
-
1
votes1
answer73
viewsA: Relationships between PHP Models
What I would do if I were you would be the following: class Produto { protected $objCategoria; //faça get's end seter's protected $idCategoria; //faça get's end seter's ... protected function…
-
0
votes1
answer86
viewsA: Extract data from HTTP Auth with PHP
Yes there is the possibility, just use the variables to http authentication, follows a basic example, only for understanding the functioning $valid_passwords = array("user" => "pass");…
-
1
votes1
answer437
viewsA: Confirmation of sharing facebook with web API
I found a solution, but it’s not using the share button, but rather the api, the only triggered Response when the user actually shares it <div class="page-header"> <h1>Share…
-
1
votes1
answer679
viewsA: PHP PDO Microsoft SQL SERVER
Quick fix, exchange these lines with Sql Server data: private static $dbtype = "sqlsrv"; //aquivo troca para sqlsrv private static $host = "ip"; private static $port = "3306"; private static $user =…
-
7
votes4
answers1951
viewsA: Upload with Ajax and formData does not send data
The line $TipoDoc = $_POST['TipoDoc']; It is printing the notice that is in your print, and with that is There is a problem in your return since it screws the data type of 'Json'. It will throw the…
-
1
votes1
answer60
viewsA: PHP - SQL Query
If code has a variable scope problem, $idThis is not a global variable, so the function does not "see" that variable. About scope of functions take a look here To solve the problem, or you declare…
-
0
votes1
answer188
viewsA: Check and Insert Data in a Table
Your connection is outside the scope of the function. That’s why the first Notice. Notice: Undefined variable: con in /home/profissa/public_html/test/functions.php on line 8 Place the line below…
-
1
votes1
answer2202
viewsA: Share facebook button with dynamic link
Try this <?php $linkFace = "http://www.modalle.com.br/blog.php?artigo=".$_GET['artigo'];?> ?> <a href="http://facebook.com/sharer.php?u=<?php echo urlencode($linkFace)?>"…
-
4
votes1
answer220
viewsA: error in sending data via ajax
Your code has some problems: You’re using the "Submit" event on the wrong component. Change this line <form method="post" action="relatorio.php"> For this <form method="post"…
-
1
votes1
answer80
viewsA: How to change table records in the Database after 30 days?
Like the colleague @Diego commented you will need to create a task in windows or crontab of Linux, remembering that this should be done on the server. Further you will run the sql below using your…
-
0
votes3
answers107
viewsA: Wrong encoding in Mysql when I enter via AJAX
You could use utf8_encode in the data you need for characters in the post variable assignment. http://php.net/manual/en/function.utf8-encode.php. You can also try to modify the charset in your html…
-
0
votes1
answer19
viewsA: Return of values from a column of table X that has 1 code in common
If I understand correctly, the bank records are more or less like this: cod_questao cod_reply 1 200 1 300 2 100 2 200 Then you will have to do the foreach by controlling the line break, more or less…
-
1
votes1
answer151
viewsA: Sending php/jquery data to mysql
Since you are already using jQuery, use its Ajax function (http://api.jquery.com/jquery.ajax/). You call the PHP file that you will insert into Mysql, return the javascript and do the other…
-
1
votes1
answer70
viewsA: How to return values from different columns without repeating?
A way to solve only in query: SELECT CATEGORIA1 AS CATEGORIA FROM NOME_DA_TABLE UNION SELECT CATEGORIA2 AS CATEGORIA FROM NOME_DA_TABLE UNION SELECT CATEGORIA3 AS CATEGORIA FROM NOME_DA_TABLE UNION…
-
1
votes1
answer603
viewsA: Catch a PHP JSON Via Jquery
You said it has three pages: 1-Index 2-dados_game.php 3-game.php There are three codes: 1- Index 2 - Config.PHP 3 - Jquery/Ajax This makes it difficult to understand your problem. But come on.…
-
6
votes4
answers11586
viewsA: Text that you type little by little?
Alternative to the colleague’s code [Sergio], so only to put everything in a function, without having global variables (which will hardly be used by other functions) function…
-
2
votes2
answers183
viewsA: LIKE does not work together with BETWEEN
There is a structural problem in your query. When the value of any "like" comes empty it brings all the options, no matter if AND or OR.Because this will result in a LIKE '%' that literally brings…