Questions tagged as 'php'

8
answers

Exporting an HTML / PHP page to PDF

How to export an HTML page to a PDF file? Having a default document where you can change variables within this template, then export that page to an A4 format PDF file, without spoiling the layout. Code sample: $conteudo_html = ' <...
asked by 20.12.2013 / 16:23
10
answers

How to create a site without reloading every click on a link?

I want to develop a site that runs around the same file, but I'm not sure how to look for study material for that. So: Normal site-> I'm on the Index.php page. When I click on the "Portfolio" menu, for example, it goes and loads the file P...
asked by 20.02.2014 / 05:48
5
answers

What is the advantage of using recursive functions?

Recently I discovered the famous (or not so famous) Recursive Functions and I found the concept very interesting. But during my reading I had some doubts about the use of such. 1st What is the advantage of using Recursive Function ? For I...
asked by 11.01.2016 / 04:10
2
answers

How to count the objects in the image with PHP?

The original photo of the beans is this: Decreasetheresolutionofthephoto,Ialreadyappliedafiltertobeingrayscaleandincreasedthecontrasttothemaximumtobecomeblackandwhite.ThenIexaminedthecolorofeachpixelandmountedanarrayarray.IfIloopoverthisarra...
asked by 11.02.2017 / 01:53
2
answers

What is PHP Injection? What's the difference between it and SQL Injection? And how to avoid it?

What is PHP Injection? What's the difference between it and SQL Injection? How to avoid PHP Injection in my application? What are the main forms of PHP Injection type attack? Update Note : Remembering that SQL injection is not th...
asked by 13.08.2015 / 23:00
1
answer

Is using PDO the safest way to connect to a DB with PHP?

I am a beginner in PHP and would like to know if PDO (PHP Data Objects) is the safest way to connect to a database? I also need an example of how to make this connection and insert / select data.     
asked by 09.06.2015 / 15:26
3
answers

I am suffering from SQL Injection attacks

Since I opened an online project I'm having problems with trespassing, where someone is doing direct inserts in the database. It was the one that gave me initiative to by in all the variables received through the method $_GET and $_POS...
asked by 12.12.2015 / 12:36
6
answers

How to measure code performance in PHP?

To measure performance and compare two codes in javascript , I do the following in the browser console: // Vamos testar o código 1 console.time('teste1'); for (var i = 0; i++ < 10000;) { $('#table tr').addClass('destaque'); } cons...
asked by 06.01.2014 / 22:08
4
answers

Why in PHP is the expression "2 + '6 apples'' equal to 8?

I found the example to be funny, but the question is valid in understanding why PHP behaves this way. When we make the sum shown below (an integer added to a string): $numero_macas = 2 + '6 maçãs'; The result is: 8 But in this case,...
asked by 14.08.2015 / 14:37
5
answers

How to check if an email really exists?

I made an email field for the user to register, and now I need a system that checks to see if this email exists. I need when the user enters their email a system to verify that it exists, if it even has that email. For example, the user types...
asked by 05.03.2014 / 01:05