Questions tagged as 'php'

1
answer

Laravel on the server Locaweb: Unexpected character in input: '\' (ASCII = 92) state = 1

I'm hosting at Locaweb and it's giving this error.    Warning: Unexpected character in input: '\' (ASCII = 92) state = 1 in   /home/storage/a/b7/b3/reciclaoleovegetal/public_html/public/index.php   online 52       Parse error: syntax...
asked by 25.09.2017 / 15:44
2
answers

Empty function return

Could anyone tell me why my insert2 function is returning null after insertion? it should be returning the string with the success message. <?php require_once 'conexao.php'; $con = new Conexao(); function insert($dados, $tabela, $campo_uni...
asked by 14.09.2017 / 19:11
2
answers

How to Read this json with PHP

How do I read this JSON file with PHP. I tried this way, but it does not work. <?php $json_str = '{ "numero":"1000", "log": { "message": "testing connection to the target URL", "level": "INFO", "time"...
asked by 23.09.2017 / 16:15
1
answer

perform sum of values codeiginiter

I need to add some values to the end of a table as shown below: HerearethecodesI'musing:Controller:functionindex(){$this->template->set('title','ListadeOrçamentos');$config=array("base_url" => base_url('orcamentos/p'), "per...
asked by 05.06.2017 / 15:15
1
answer

CodeIgniter form_open_multipart, how to use

I'm using CodeIgniter in a project but I'm having a hard time sending information, I have a view that contains a form with the registration fields:                              <?php echo form_open_multipart('Contro...
asked by 26.11.2018 / 12:51
3
answers

Format real (br) value for decimal (10,2) of mysql

Good afternoon, guys! How to format Real (br) value for numeric (10,2) of mysql using php number_format? I tried to use: $num="89,90"; ou $num="1.089,90"; number_format($num, 2, '.', ''); But it's zeroing the cents.     
asked by 13.12.2018 / 20:39
2
answers

List year in current year select for 10 years ago in descending order

I'm needing to list in a select the last 10 years. For this, I'm doing it this way: <select name="AnoInicio" class="form-control"> <option value="">Ano</option> <?php for ($anoInicio = date('Y') - 10; $anoInic...
asked by 18.12.2018 / 20:45
1
answer

Scope of PHP variable

So, I've been banging my head for some time now with a basic scope question, but I could not figure out why. In the function below, I'm trying to access a position of the object that is running at the time of Foreach, though it is giving the...
asked by 22.11.2018 / 13:16
2
answers

include with parameter?

Does include with parameter? I have a page .php that contains the following code: <ul class="nav nav-tabs"> <li class="active"><a data-toggle="tab" href="#segunda">Segunda-Feira</a></li> <li>&l...
asked by 08.08.2017 / 00:51
1
answer

Why is not it good to use this function and how do I identify the user's IP then?

public function get_client_ip() { $ipaddress = ''; if (isset($_SERVER['HTTP_CLIENT_IP'])) $ipaddress = $_SERVER['HTTP_CLIENT_IP']; else if(isset($_SERVER['HTTP_X_FORWARDED_FOR'])...
asked by 21.07.2017 / 22:10