Questions tagged as 'php'

2
answers

Consultation with ajax is not done and it does not give me an error

I'm starting with ajax. I have an input that generates a search with ajax in my mysql database, but it does not return any results and the console does not show any error $(document).ready(function() { $("#resultadoBusqueda").html('...
asked by 28.12.2018 / 12:07
2
answers

Make a permutator in php

I found the following switch coded in Javascript: <script> var letras = "abcdefghijklmnopqrstuvwxyz"; letras = letras.split(""); numLetras = letras.length; permuta = new Array; combina = 2; //nº de letras a combinar...
asked by 27.12.2018 / 15:11
1
answer

How to change the action="" of a form?

I have a problem and I would like to know if you can give me a hand. I have tried to change my action="" of a form. I have tried a lot of code but I still can not get the result. What attempt to make? the action goes as follows: <form actio...
asked by 07.11.2018 / 04:26
1
answer

get variable with js and send them by ajax

I have some links that I create from a database; I go through all the registers and the samples. Now I need to send the id of recurso of which the button is being pressed, through AJAX to know with what recurso I am working....
asked by 07.12.2018 / 01:56
3
answers

Validate empty fields by post method in php

my question is that php does not recognize the empty fields inside $_POST , which contains the arrangement of my form. I have the following code: index.php <!DOCTYPE html> <html> <head> <title>Document...
asked by 04.01.2019 / 21:57
2
answers

Choose an array element randomly

I have an array with the elements: $base = array( 'root', 'user', 'admin', 'hack', 'cloud', 'apple', 'linux', 'blue', 'dark',...
asked by 03.01.2019 / 22:14
1
answer

Alternative to session_destroy (), without deleting variables

I'm working with php sessions, and I have a quick question to answer, but I'm not clear on the official PHP documentation. What I want to do is that after starting a session (session_start ()), I close it, but without destroying the variable...
asked by 05.01.2019 / 13:47
1
answer

How to add a summed and grouped mysql query to a table

What I need is that in a table I show the sum of a field that is grouped: $sql = "SELECT SUM(cantidad) AS cnt FROM produccion group by producto "; <!-- Tabla donde se listará la consulta --> <table class="table...
asked by 08.11.2018 / 20:31
2
answers

formulate query to show data

As I do so that in my table I throw the invoices that went to credit and cash since if I put an and in the query does not throw data to me because to say on a date there is only credit and in the query I ask both credit and counted data and I do...
asked by 31.10.2018 / 17:56
1
answer

I would like you to help me with this error: mysqli_num_rows () expectsparameter1tobemysqli_result, boolean given

<?php $alert=""; if (!empty($_POST)) { if (empty($_POST['usuario']) || empty($_POST['contraseña'])) { $alert="Ingrese su usuario y su clave"; }else{ require_once "conexion.php"; $user = $_P...
asked by 02.11.2018 / 01:16