Questions tagged as 'php'

4
answers

Multiple includes bad for performance?

If I use too many includes on my page will it slow down or something like that?     
asked by 07.05.2014 / 13:42
2
answers

What is a scalar variable?

I was reading the PHP documentation and a function is_scalar() - as said by the site itself - when it is used it will inform if a certain variable is scalar. However, I wanted to know more about these scalar variables: What is a sca...
asked by 18.08.2017 / 20:53
4
answers

Capture user-entered input with PHP Shell

How can I get you to retrieve input data. Example: > Qual seu nome? ...Usuário digita o seu nome... > Olá, $nome-digitado How can I do this via Shell Script in PHP .     
asked by 02.01.2017 / 02:12
2
answers

Permission denied when moving file with move_upload_file on Linux server

I'm trying to use move_upload_file to move a file uploaded by the user to their final destination: $pasta = '../../public_html/admin/helpdesk/ticket/uploads/'; if (!empty($_FILES['img']['name'])) { foreach ($_FILES["img"]["error"...
asked by 21.01.2014 / 12:53
3
answers

How to calculate the difference between the server time and the user's computer?

I need to adapt my code to calculate the difference between the time of the server where the site is hosted and the time of the user's computer to not overload my system. I am setting up a table where I will show the time of another server an...
asked by 09.11.2017 / 21:30
3
answers

Is it a bad practice to put numbers as id in HTML elements? If so, why?

I have a loop printing HTML elements, for example: for($i = 0; $i < 3; $i++){ echo "<div id='$i'>$i</div>"; } Is it a bad practice to put numbers as id in HTML elements? If so, why?     
asked by 08.11.2017 / 12:31
1
answer

Can you use two types of payment methods in a paid-for transaction?

For example, I want to sell a product that includes membership and monthly payment, R $ X, XX + R $ X, XX automatic debit. Example of automatic debit: $preapproval_data = array( "payer_email" => "[email protected]", "back...
asked by 29.09.2015 / 20:47
3
answers

include, require within functions functions

Use include (or # I noticed that most frameworks that work with MVC use require within a method, for example the CodeIgniter3 require file: public function model($model, $name = '', $db_conn = FALSE) { ... foreach...
asked by 27.04.2015 / 20:09
2
answers

Delete multiple rows dynamically with PDO?

Let's say I have a user table ( id | nome ) and that where they are listed (client-side ) I can select multiple of them and delete them at the same time. > How could I do this on a MySQL database using PDO? I know that MySQL allows th...
asked by 20.06.2015 / 22:43
2
answers

Why can not I declare an attribute as an object?

I have a class A and I'm creating a class B . I want one of the attributes of B to be an object of A . Why is the public $objeto = new A(); notation correct?     
asked by 11.07.2017 / 20:06