Questions tagged as 'php'

1
answer

encrypt / decrypt MD5 structure (encrypted result only numbers and letters) with php

First of all, thanks in advance for reading this thread. You see, I use the following functions to encrypt / decrypt some variables at the server level and create URLs. I already use this function: link They even helped me right here with s...
asked by 24.04.2018 / 07:05
1
answer

Laravel (5.4) Parse error: syntax error, unexpected '-' (T_OBJECT_OPERATOR)

Description Last days they answered me in another question that could implement whereHas to make a query to two different tables. In this case the table noticias and notas same that does not let me receive the data in the...
asked by 08.04.2018 / 20:36
1
answer

Error in showing data using switch case?

If there is data returned or received by method $ _POST, it will have the value process if there are no returned or received values, it will have the value cancel The code states it in the following way, but there is a fatal err...
asked by 23.10.2017 / 05:10
1
answer

Problem in mysql count php, it works in phpmyadmin and not in php

I have this function that should bring me the account of the records in my database on my page: function cuentaticketspendienteempleado($conexion,$id){ $pendientes = mysqli_query($conexion, "SELECT COUNT(t.id) as contador_tickets, t.id as...
asked by 25.04.2018 / 17:35
3
answers

Laravel can not find the driver in App \ Http \ Controllers

I am creating a project in laravel, I have created a driver, and when I try to link it to the path, it throws me an error that does not find it. I show you the code    CONTROLLER: Home      namespace App\Http\Controllers\Home; use Illuminate\...
asked by 05.04.2018 / 18:46
1
answer

Replace spaces with characters

For the moment I have been able to deal with this: $link = ""; $longitud = strlen($pais); for($i = 0; $i<$longitud;$i++){ if($pais[$i] == ""){ $link .= '+'; }else{ $link .= $pais[$i]; } } The result...
asked by 13.06.2017 / 11:52
1
answer

PHP form when attaching file turns it into .dat

Good morning, Tengos two quibbles I have made a form in php so that they can attach files and send them to the mail send well the mail but the file calls it like this: Attached data without title 0066.dat giving equal the upload it with....
asked by 21.06.2017 / 10:28
3
answers

Add a for cycle within an echo with php

Greetings, I'm doing a for loop in an echo and it gives me a syntax error. This is the code <?php $resultado = '<html><h2>Productos:</h2><p>'.for ($i=0; $i<count($_POST["productos"]); $i++){ echo '<b>'.$...
asked by 24.11.2017 / 00:09
3
answers

Search for repeated values in multidimensional array (PHP)

How can I get the repeated values inside a multidimensional array in PHP? I have found some functions but they have not worked for me. Is there a native function that does that? <?php $array = array(array(7,18), array(12,7), array(12, 7, 13...
asked by 09.08.2016 / 09:12
2
answers

Display PDO query data in JSON format

I try to get the data from a query and print it on the screen but it does not show anything. $pdo=new PDO("mysql:dbname=usuario;host=localhost","root","root"); $statement=$pdo->prepare("SELECT * FROM usuario WHERE estado = 1 ORDER BY idusua...
asked by 02.03.2017 / 03:04