Questions tagged as 'php'

1
answer

Get answer through ajax

I have a hypothetical problem : Mipagina.php <?php if(isset($_GET['nombre']) && !empty($_GET['nombre'])) :?> <?php $nombre = $_GET['nombre'];?> Hola <?php echo $nombre;?> <?php else:?> <form...
asked by 19.08.2016 / 18:48
2
answers

How to download a .zip file from the server to the client via php?

What I want to do is to create a .rar or .zip file and then download it to my user's computer and delete it from my server once it has been downloaded, until now I have the conversion of my folder to a tablet but it leaves it in my local folder...
asked by 24.08.2016 / 03:51
1
answer

How to create the relationship of two tables in laravel lumen?

I have two tables attached so that In my project Laravel what would be the relationship that I would have to put in the model <?php namespace App; use Illuminate\Database\Eloquent\Model; class Archivo extends Model { prote...
asked by 24.02.2018 / 17:25
1
answer

Display records in a select based on the id of another select

I have a system to sanction administrative personnel. I recently solved the problem that changing a select called article would change the description in a textarea. Now I have the following question: I added to the system the possibi...
asked by 31.01.2017 / 22:06
2
answers

doubt queries mysqli vs poo queries prepared

I have been working with the mysqli driver for several months but a question has arisen more than a question is a doubt, I would like to obtain opinions from experts on this topic. The thing is that whenever I consult the bd either to insert o...
asked by 24.08.2018 / 15:48
1
answer

Error when consulting with INNER JOIN

Everything works ok less when I pass the user id with the variable $ user_id. It just fails me with the inner join, giving me the following error,    Catchable fatal error: Object of class User could not be converted to string in Crud...
asked by 17.04.2018 / 13:29
1
answer

Problems to read Text: Latin A with php

I have a problem with this script below the function it does is find the pads or # the Hashtag of a message the problem is that it does not recognize the text Latin A - UTF-8 , I want it to work but I do not know how to make the...
asked by 26.04.2018 / 05:11
4
answers

get the first 3 words of a sentence in PHP

I have a question about how to get the first 2 or 3 words of a sentence. For example: Example_1: $text_1 = "Chaleco azul con tejido algodón"; Resultado=> Chaleco azul Example_2: $text_2 = "Lampara de lectura para la cama"; Resultado...
asked by 15.02.2018 / 13:17
3
answers

Reduce amount of conditional

I have a small function that delivers the value that has the highest priority, which for now is not defined anywhere, just by order as I evaluate the values: public function obtenerValorMasImportante($datos = null) { if ($datos->getDat...
asked by 16.08.2016 / 21:37
2
answers

How do I change the value of a variable?

The fact is that I want to capture 2 variables per POST and that a group of if elseif compare them. Example <?php $var1 = $_POST['var1']; $var2 = $_POST['var2']; $var3 = 0; if ($var1 == 1 && $var2 == 2){ $var3++; } ?>...
asked by 02.05.2018 / 19:38