Questions tagged as 'php'

2
answers

What is the difference between opening PHP (? php?) and (??)? [duplicate]

Friends, I know that the question sounds silly, that I've been studying php for just over a year and this question arose when I used the opening <? ?> and it works in the same way, but I'm sure I do not know why. Can someone more...
asked by 22.09.2017 / 17:19
2
answers

Remove text strings that start and end in "" and "" [closed]

I was looking for how to make a string remove all substring that starts and ends with "<" and ">" . Can someone guide me? Edit: Yes, I was referring to labels with all their content.     
asked by 21.11.2016 / 14:26
4
answers

Variable Error CodeIgniter

I'm working on Codeigniter and I have a variable error. I am newly familiar with this framework and well the code is as follows: Controller: public function Todo(){ $new_id = $this->input->post('id'); $this->load->mo...
asked by 15.12.2016 / 20:59
2
answers

How to access multiple rows in SQL from php

When I make a query to a table that results in two rows, for example: $sql= "SELECT id, nombre, apellido FROM usuarios WHERE nombre = 'Juan'"; $res = $db->query($sql) or die("error: ".$sql); $row = $res->fetch_assoc(); and I get this...
asked by 15.12.2016 / 12:06
4
answers

Obtain the maximum value of a database

Good afternoon, I'm trying to capture a value from my database through a query but this gives me an error, the code is as follows: $consultarRepresentante = mysqli_query($conexion, "select max(id_representante) from representantes")...
asked by 19.11.2016 / 18:13
2
answers

Hide download link path in PHP or javascript

I'm doing a download manager in PHP, through which a user can download a file. What I intend is the following Instead of passing the direct route to the file (www.dominio.com/ftp/archivo.rar) pass it, www.dominio.com/descarga.php?id=3 this in...
asked by 11.03.2017 / 00:41
3
answers

How to take a variable and declare it in each function with php?

I have a variable defined $sql which has as value a statement sql the problem is that I need the same statement in different functions, but I do not want in each function to have to put $sql = "SELECT * FROM....." but direct...
asked by 26.04.2017 / 13:12
1
answer

Insert value in table and automatically obtain the registration ID that you will have

I am making an insertion to a database and would like that automatically after the INSERT the PHP file will get the ID that corresponds to the record (ID_PLANILLA). This I need since I must automatically show a graph with the data obtained....
asked by 24.04.2017 / 17:20
2
answers

How to save text in a txt with fwrite in php

In the following example, I save the content I want in a txt file, until here it works perfectly, the problem that the txt file creates in asci format and saves the content with strange characters. If you can help me, super grateful. Greeting...
asked by 02.01.2019 / 17:55
2
answers

Have several projects in laravel on a server?

I am trying to upload my project in laravel to my vps server. I do not know how to manage several projects on the apache web server. My directory structure is /var/www/html ... As I read in tutorials, it says that you have to leave the...
asked by 11.02.2016 / 15:39