Questions tagged as 'php'

1
answer

Print a DIV keeping the CSS

I try to print a "div" in which there is a "proof of an order, I can not keep the CSS styles when I open the print window. This is my function: function printDiv(divVer) { var printContents = document.getElementById(divVer).innerHTM...
asked by 30.08.2018 / 08:32
2
answers

Send data of a query by email with html format

Someone could help me put my query data in a table, the email is sent to me but it does not show me the stored data. <?php $conect = new mysqli("localhost", "onethost_horacio", "MPADT-2018", "onethost_MPA"); /*$v3=$_POST['codigo'];...
asked by 03.09.2018 / 02:18
2
answers

How to create several buttons in the same HTML / PHP form?

I am starting the learning of forms in HTML and PHP, and I managed to create a button that sends the entered data to a MySQL database entered by the user. My question is, how can I put more buttons in the same form and that each one perform a...
asked by 20.09.2018 / 14:21
1
answer

compare two dates in php

I have a date: ($data->fch_fin_prevista) with this format: 2017-11-29T00:00:00.000Z and I transform it in this way to the format I want: $data->fch_fin_prevista=date('d/m/Y',strtotime($data->fch_fin_prevista)); To st...
asked by 28.09.2018 / 10:01
2
answers

Queries prepared with PDO

I would like to make a simple request to my local database using PDO. I really do not understand when I try my code, the following error message appears: (!)    Parse error: syntax error, unexpected '$ registration' ( T_VARIABLE ), expecti...
asked by 04.08.2018 / 20:30
2
answers

Bring SQL statement and move to PHP variable

I have this SQL / PHP statement echo '¡Hola ' . htmlspecialchars($_POST["div"]) . '!'; $sql = "SELECT id_div FROM divisiones WHERE division_name = '$_POST[div]'"; $res = mysqli_query($conexion, $sql); And what I want is to pass the id_d...
asked by 20.09.2018 / 14:37
2
answers

Add the value of several select in a table with php

I have the following table: With the following code: <table> <thead> <tr> <th> Lunes </th> <th> Martes </th> <th> Miercoles </th>...
asked by 15.08.2018 / 22:40
2
answers

Apply background-color to Input with hexadecimal number stored in database

I comment, in my DB I have a table Categorias which contains, CategoriaID , CategoriaDescription and CategoriaColor , my question is, when displaying the different categories in example inputs <input type="button"...
asked by 07.08.2018 / 17:28
3
answers

Enable an input with a checkbox

please help me with this problem I want that when I select checkbox the input is activated, I want to do it with readonly because with disabled it does not save me in BD , with disabled if it works but wi...
asked by 17.08.2018 / 15:15
2
answers

How can I avoid Duplicate Registration in MySQL?

I'm trying to make a validation to avoid that the user or users avoid double posts, that is to say that the mail data in the user table within MYSQL PHPMYADMIN does not repeat, my code is as follows <?php require_once "Conexion....
asked by 12.08.2018 / 20:41