Questions tagged as 'php'

3
answers

PHP: Parse error: syntax error, unexpected '='

I try to create a contact form that will send your data to a gmail email. For this I use the library PHPMailer , but first I am trying to get the mail with a simple text, that is without passing any variable. The problem is that it gives a...
asked by 08.09.2016 / 20:25
2
answers

How to show a single record in PHP

I have the following code, it connects to the database and executes a query and I store it in result2 until it is all right, but at the time that I print the records I want that only prints a single record only the date and time and not t...
asked by 05.10.2016 / 21:49
2
answers

Value within php array

I have the following php structure. require_once('api.php'); $data = array( 'DETALLES' => array( array( 'ITEM' => 'N1', 'DESCRIPCION' => 'DESCRIPCION', ) ), ); $api = new api(); $res...
asked by 30.07.2018 / 21:27
2
answers

Mapping database with Laravel

I have to do a web project in php and I know general aspects of Laravel, so I would like to use it in the development, what stops me for the moment is to map the database that I have created in mysql with laravel, it is possible to do this? I wa...
asked by 12.07.2018 / 05:58
2
answers

Update a div with ajax when there is a change

I want to make a div recharge only when it finds a modification in the database I currently have this so, if you can help me I would appreciate it is for a shift system that I am doing <?php $result = $mysqli->query("SELECT * FRO...
asked by 27.07.2018 / 15:58
1
answer

Error in JAVASCRIPT

I have the following problem with javascript And this is the code $(function(){ $.post("../php/cargar_marcas.php", function(data){ $("#marca").html(data); }); }); The truth is that I have always done it, the php scr...
asked by 06.08.2018 / 19:31
3
answers

How to use double and single quotes in a string in PHP to go to MYSQL?

I have this text saved in this variable: $variable: Tuberia de acero al carbono Ø4" sch 40 ; $idDetalle = 1; What I want is to insert this in a column of a MYSQL table but it does not respect the quotes ("") that I put. $cadena_insertar...
asked by 01.08.2018 / 19:36
1
answer

Recognize images from a url - Regular Expressions

I have a function in which recognizes the url <?php function findReplaceURL($text){ $reg_exUrl = "/(http|https|ftp|ftps)\:\/\/[a-zA-Z0-9\-\.]+\.[a-zA-Z]{2,3}(\/\S*)?/"; if(preg_match($reg_exUrl, $text, $url)) { return preg_replace($reg_...
asked by 10.11.2018 / 02:46
2
answers

How to pass 2 variables through AJAX to another PHP

Well what I want to do is send 2 variables js with value of an input by AJAX to a file that receives them, for example: $ _POST ['idReceptor']. If you sent a single variable it is sent well but I can not send 2. var idEmisor = $("#idEmisor").v...
asked by 05.11.2018 / 20:27
1
answer

Show contents of a database with php

I'm doing a job for the school, in which they ask me to do a "mini replica" of what would be twitter, so we can see data handling with php and so on. Well, I have reached the point of registering users, logging in and saving tweets in a database...
asked by 06.04.2018 / 16:49