Posts by chavesfop • 304 points
11 posts
-
0
votes1
answer199
viewsA: How to call a js file inside a php file
for me at the beginning jQuery for JS was very quiet, I suggest you take a look. https://jquery.com and https://jqueryui.com In your case I would do: a separate js file, which would be loaded at the…
-
0
votes1
answer140
viewsA: How to relate 2 json tables to php?
In this case, I suggest using json_decode and turn them into an array, then process these arrays to perform the 'relationship'. Ideally, the API would already be returning this related data within a…
-
0
votes2
answers124
viewsA: How to Calculate read values in an Array and store the calculation in a single PHP variable
I suggest changing the logic to simplify and perform the calculation in just one loop. To make loops in PHP you can use while, foreach, for... For example with a foreach. $total = 0; foreach ($array…
-
2
votes3
answers1183
viewsA: Ajax only returns if I put an "echo" instead of "Return" in php
According to http://php.net/manual/en/function.return.php the return is a PHP language control structure, so use it exclusively in PHP to return values or return to the next run point. The echo, in…
-
0
votes1
answer108
viewsA: Problems with permission
Hello, checking the error message we have: Message: fopen(): open_basedir Restriction in Effect. Searching on open_basedir, I came to this link:…
-
-1
votes3
answers3406
viewsA: Storing representative values of a user’s 'sex' in databases
In order to curiosity: In the case of weight of an object in "very light", "light", "medium", "heavy" and "very heavy". We can use some statistical methods to define a range. So if we have 50…
-
2
votes1
answer1197
viewsA: Is there any way to save the input value to a Session?
You will need to make a request via ajax for a PHP code, I believe the best solution is js as Diego commented, so via POST it will be possible to store something in the variable $_SESSION['value']…
-
3
votes1
answer920
viewsQ: How to improve the performance of this SQL query?
Hello, first I will pass some pertinent data to the query. Tabela Contrato (id, id_cliente, status [ativo/inativo]) Tabela Cliente (id, nome) Tabela Dependente (id, id_cliente, nome, status…
-
1
votes2
answers142
viewsA: Problems with Phpmailer and large emails
I was able to send the big messages using: http://swiftmailer.org/ I still haven’t thoroughly checked what happened, and what he sends to the server. So the solution to the problem was to change…
-
1
votes1
answer150
viewsA: Cakephp: Upload Error
Hello, I’m not a cakephp expert, but it could be a typo between: mimetype and mineType, where the correct would be: mimetype. Change your $validate array in Model Photo as follows public $validate =…
-
2
votes2
answers142
viewsQ: Problems with Phpmailer and large emails
I have a problem with sending emails from an application. I’ve already tried PEAR_Mail together with PEAR_Mail_Mime and now with PHPMailer (what I found most readable). What is going on? When I send…