Questions tagged as 'php'

1
answer

If fclose closes a file, how do you close an open file with the SplFileObject object?

When we open a file with fopen , we use the function fclose to close the handle of that file. $handle = fopen('file.txt', 'r'); fclose($handle); But my curiosity is: And when we use the object SplFileObject ? It does n...
asked by 26.04.2016 / 21:42
2
answers

Final value of the array?

This my life: $valor = $cliente->cobrancas[1]->valor; echo '<pre>'; print_r($cliente); echo '<pre>'; Print the values below: stdClass Object ( [id] => 24151 [nome] => PAULO ANDRE ROCHA MOTTA [endereco] =>...
asked by 16.05.2016 / 15:58
3
answers

wp_enqueue_script does not work

I'm creating a WordPress theme, but wp_enqueue_scripts does not work. The code that is in functions.php is: <?php function scripts_and_styles() { if ( ! is_admin() ) { wp_enqueue_script( 'jquery' ); wp_register_...
asked by 12.09.2016 / 14:23
1
answer

Page in wordpress is being redirected to the "official wordpress site"

I've backed up a site in wordpress to run locally and run some tests, but every time I click on visitar o site on the top menu I'm redirected to the live site. I have already updated the option_value column in the wp_options...
asked by 06.09.2016 / 20:41
1
answer

select on elements that are not in array [duplicate]

I have an array in PHP with IDs: $idNaoEnvia['1', '3', '6'] And a table named account in MYSQL: ID | NOME 1 | caio 2 | antonio 3 | cleber 4 | marcos 5 | leonardo 6 | andre I wanted to use PDO to give a select in the a...
asked by 23.08.2016 / 00:08
2
answers

How to compress the output of an HTML in Laravel?

I answered this question here once about the subject: Store PHP script output in HTML "compacted" . But now I would like to know how I can do this in Laravel. When it comes to an HTML response, how could I capture all the rendering of...
asked by 14.09.2016 / 19:08
2
answers

UPDATE giving error but updates database

IamcreatingaloginpagewhereIneedtowritetotheMySQLdatabasethedateandtimetheuserwasloggedin.InthedatabaseIhaveatablesomethinglikethis:____________________________________________________|nome|login|senha|login_on|----------------------------------...
asked by 22.07.2016 / 21:42
1
answer

PHP - pushing array into another array

I'm trying to make a array inside another and include more data in array inside, how do I do that? Follow the code of the attempt, it is to generate a json : $data = array( "login1" => "login1", "login2" =>...
asked by 21.07.2016 / 18:24
2
answers

Doubt with connection to php database with mysql

I am learning about php and mysql, I see several tutorials on the internet and a doubt that I came up with is, I see that if you create several variables and then you put these variables in the command, $servidor = "localhost"; $usuario = "root...
asked by 10.07.2016 / 19:34
1
answer

Login page redirect does not match

I'm having a hard time redirecting the user after logging in. I need some help, to find the solution. valida_user_login.php <?php $servidor = 'localhost'; $usuario = 'root'; $senha = ''; $banco = 'bd_'; // Conecta-se ao ban...
asked by 14.06.2016 / 21:41