Questions tagged as 'php'

2
answers

list of a questionnaire in php

I have a questionnaire and I need to pass a list with the question and the value of the answer, I created a question table and an answer table in my database, but I am not able to pass the value of the answer in this list. > 1. database ta...
asked by 08.07.2014 / 17:03
2
answers

Join in Laravel 5.x in two tables?

I have two tables that are already related in MySQL and I use Laravel , I'm already persisting the information in the database. When I write a story, it is already assigned to the author (tables autor and news ). At...
asked by 03.05.2017 / 21:36
2
answers

Bring sql record even not having the necessary accent [duplicate]

I need to bring a record called Vidraçaria into a search, how can I bring this record by just writing Vidracaria in the search?    Or bring water by looking only agua The search works normal when the word is spelled co...
asked by 26.11.2018 / 20:37
1
answer

Email sending works locally but not on remote server

I have a problem sending email using a server I created in a contracted data center. Sending e-mail works locally normally, although SMTP is in a well-known hosting company (I've seen that they allow 20 emails per day for international IP). I...
asked by 19.01.2014 / 18:26
2
answers

Doubt when performing SQL with Eloquent of Laravel

I have a bug that I do not know the reason for it. I have in my controller the following Eloquent : $balances = BankUser::select(DB::raw('SUM(balance) AS total, created_at, DATE(created_at) AS total_at'))...
asked by 12.12.2018 / 16:46
2
answers

Assign function to variable?

How to properly perform the following assignment: preg-replace.php <?php function file_name(){ $pg = $_SERVER["PHP_SELF"]; echo $path_parts = pathinfo($pg, PATHINFO_FILENAME);//preg-replace } $string = file_name();//<<<...
asked by 12.07.2017 / 07:37
2
answers

MySQLi does not execute insert within a function

I have this function: function envia($mensgem) { $odb = mysqli_connect(HOST, USER, PASS, DATABASE); mysqli_query($odb, "INSERT INTO pedidos VALUES ('$mensagem')"); mysqli_close($odb); } I use this function on another page callin...
asked by 19.11.2016 / 06:13
3
answers

Send PHP variable to Shell Script

I have a .sh file and it has variables that I need to get from PHP, here's an example: //variavel 1 que preciso receber externamente NAME="" //variavel 2 que preciso receber externamente DIR="" tar -zcf $HOME.tar.gz $DIR Calling the...
asked by 29.07.2016 / 20:44
2
answers

How to confirm that the request was made through the site securely

I would like to know if there is any way for me to confirm that the request actually came from the site and not from outside, and is also being done by the page with the action of the user. I tried to work out a solution to this, but it did no...
asked by 19.08.2017 / 04:32
1
answer

Randomly display data from a database

I would like to stop displaying by date and descending and make it display randomly or as I know it - random. Below is the excerpt that I have to modify from the php file: public function getNewReleases() { return Album::with('artis...
asked by 14.09.2017 / 16:30