Questions tagged as 'php'

1
answer

show an alert when selecting an option

I would like to know how to display an alert in javascript when you select an option from a list. my code: <!DOCTYPE html> <html> <body> <select id="test"> <option id="uno" value="uno">uno</option> <op...
asked by 18.07.2018 / 01:13
1
answer

Fail on request data with json

I have a problem with a data request with json from a form that shows me this error: Uncaught SyntaxError: Unexpected end of JSON input     at JSON.parse ()     at XMLHttpRequest.xhr.onload (form.js: 52) What could be due? Thanks the model-ad...
asked by 30.07.2018 / 12:15
1
answer

How to display PHP data in ajax?

I am trying to load the PHP data on the page when it finishes loading, but it does not show me the data, here is a simple example: <?php $datos = new stdClass(); $datos->mensaje = "hola"; header('Content-type: application/json;...
asked by 28.07.2018 / 03:27
1
answer

Replace data from an array with a new PHP

The exercise I am doing is to make an interface of a theater which contains 5 rows and 5 seats or chairs. the user can make a series of actions between which they are Book, Release and Buy ("R", "L" and "V"). Well the problem is this: w...
asked by 19.07.2018 / 01:10
1
answer

sending an email with php from a local server

I am making a web application and I need to send the form data to a specific email, here the form code <!DOCTYPE html> <html> <head> <title>prueba</title> </head> <body>...
asked by 25.07.2018 / 06:20
1
answer

Problem with php AJAX accents PHP MYSQL using PDO

I can not receive the JSON from the php because the data has an accent I leave the code: PHP: <?php $pdo=new PDO("mysql:dbname=salas;host=127.0.0.1","root",""); $statement=$pdo->prepare("SELECT * FROM departamentos"); $statement->e...
asked by 01.06.2018 / 11:25
4
answers

Functions onclick on a href - PHP - Javascript

I have the following code in a form, it belongs to a column of a table with data collected from a MySQL database. echo "<td width=\"08%\" id=\"estado".$row['ID_OBLIGATORIO']."\">" ?> <!-- Columna ESTADO del usuario. --> <...
asked by 16.11.2016 / 12:57
1
answer

Obtain visitor's IP

I tell you my problem. I have started to make a program to obtain the IP of a visitor and send an email with this information to a given email. After searching the internet for several functions and inverting the theme I have not managed t...
asked by 06.11.2016 / 02:11
1
answer

Show data with filter in SQL query

Cordial greeting, I am trying to show the data of an instant search table, the code works correctly, I had made the query in such a way that it looked for me in the whole table, until then everything is fine, but now I need to ask the query with...
asked by 23.04.2018 / 23:00
2
answers

Add property to Eloquent object in Laravel

Using Laravel I query a table called Purchasing that extracts the fields purchase_id, product_name, price, purchase_date , and returns them to a json object, everything goes well . What I want to do is add a final property with the average...
asked by 05.07.2018 / 02:29