Questions tagged as 'php'

1
answer

Display an alert () after submitting a form

I have a page that we will call pagina.php with a form. When doing submit I send the form with <form method="post" action="validar_datos.php"> . Then validar_datos.php checks that the data entered in the form is...
asked by 16.06.2017 / 14:38
3
answers

PHP Counter Hour, minute and seconds

I have the following code for a PHP counter:    date_default_timezone_set ('America / Mexico_City'); function evento() { time(); $today = strtotime('today 12:00'); $tomorrow = strtotime('tomorrow 12:00'); $time_now = time()...
asked by 14.07.2017 / 19:01
2
answers

Create .htaccess and .htpasswd

I have a folder on a server where I have to add a password. I have researched and I have seen that there is a file .htpasswd . The problem is that it does not work for me. .htaccess AuthName "Directorio privado" AuthType Basic AuthU...
asked by 19.06.2017 / 12:51
2
answers

Days elapsed between php dates

hello friends I am programmed a system in which they ask me to show the days elapsed between two dates with Y-m-d format that would be the current date - the date on which the entry was made to the bd and I found the problem I do not calc...
asked by 30.06.2017 / 20:11
2
answers

Style a field with the text of a news item

I have a table called news with the typical fields: title, date, text, image1, etc. In the box box, to expand this the news field is a single big paragraph and when I want to publish the news it looks as coarse as it is. What do you recomm...
asked by 19.06.2017 / 11:00
2
answers

What does this portion of code mean in laravel?

Look at this line of laravel code on the internet, however I do not know in what form it is interpreted. The line is as follows: $oldCart = Session::has('cart') ? Session::get('cart') : null; I would appreciate your explanation.     
asked by 13.06.2017 / 22:41
2
answers

Fatal error: Call to a member function fetch_assoc () on boolean

I'm trying to make a php page with a login by copying a fragment that a partner passed me but at the time of executing it I skip that error:    Fatal error: Call to a member function fetch_assoc () on boolean. I do not know how to solve i...
asked by 10.06.2017 / 19:35
1
answer

JSON datatable php

I'm having trouble with my json, I'm not finding him around. My code is this: $salida = '{"data": ['; $paso = false; $i=0; foreach ($cirugias as $cirugia) { if ($paso){ $salida .= ','; } $salida .= '['; $salida .= '"'.strtoupper(nor...
asked by 22.05.2017 / 21:54
1
answer

Syntax error mysql when inserting record [closed]

I have a data insertion problem, This is my Code <?php if ($_POST['MM_insert']) { $nombre = $_POST['nombre_alumno']; $sa = $_POST['sexo']; $dt = $_POST['documento_tipo']; $nd = $_POST['num_documento']; $fr = $_POST[...
asked by 10.06.2017 / 18:21
2
answers

How to add value to an empty space arrangement (PHP)?

I have this arrangement: $datos = array( "nombre" => array("Juan Perez","Pablo Manrique","Nancy Peña"), "direccion" => array("Cra. 45 # 45 -56","Clle. 23 # 12 -19 Sur","Av. 34 #...
asked by 26.05.2017 / 23:20