Questions tagged as 'php'

1
answer

Excerpt function in wordpress

I have the following excerpt function in wordpress add_filter( 'excerpt_more', 'wpdocs_excerpt_more' ); /** * Filter the except length to 20 words. * * @param int $length Excerpt length. * * @return int (Maybe) modified ex...
asked by 13.12.2017 / 09:34
1
answer

Filter elements of an array in php

my question is how to filter elements of an array, in this case I want the notes% co_from% to 6 to be filtered, my array is simple: array:7 [▼ 0 => 1 1 => 2 2 => 4 3 => 10 4 => 7 5 => 5 6 => 10 ] Once filt...
asked by 12.12.2017 / 01:03
1
answer

Header that does not want to work [duplicated]

I want to redirect to a web page with header in php but it throws me an error that says something like: PHP Warning: Cannot modify header information - headers already sent by (output started at /home/sitio/public_html/includeses/analyticst...
asked by 18.11.2017 / 16:19
1
answer

execute program with php opening a terminal

What happens is that I am currently doing a PHP program where I run C programs I give inputs from a text file and I save your outputs to analyze them, what happens is that I want the output to come out with all the format, including line brea...
asked by 30.11.2017 / 08:42
1
answer

Why does not the variable I want in PHP come out of the console?

Greetings, I have this JS code where I use AJAX ($ ("# pass") is the password of the form): function egiaztatuPasahitza(){ var data = $("#pass"); var request = $.ajax({ url:'egiaztatuPasahitza.php',...
asked by 30.11.2017 / 22:32
1
answer

Foreach + InnerHtml take a concrete value

I have a foreach where several forms are generated and for each one there is a modify button, I want to give that button modify to take the input name="txtdireccion_mac" that belongs to it. --- HTML @foreach($datos_usuario as $value)...
asked by 29.11.2017 / 22:44
2
answers

Failed PHP Array

Failure in the first line of the array, can someone tell me what the error is?    Parse error: syntax error, unexpected '= >' (T_DOUBLE_ARROW), expecting   ']' $DAW [ 'Sistemas informaticos'=>$horas['plazas'=>30,'horas'=>100]...
asked by 30.11.2017 / 19:39
1
answer

How to download a file with PHP

Hello and Happy New Year for all Today I have a question as I can make a script to download a file from a url and change the name of the file with php this is my code I hope you help me and thanks <?php $headers = "https://r8---sn-0op...
asked by 02.01.2018 / 02:14
1
answer

Insert 'N' times of records with the same inputs

Good afternoon, I would like to know where my error is, since what you said above does not work for me. I placed a print_r and it gives me the following result ... INSERT INTO trafos (centro) VALUES ('1')INSERT INTO trafos (centro) VAL...
asked by 26.12.2017 / 22:49
2
answers

Problem connecting to MySQL from PHP (Resolved) [closed]

(RESOLVED: I had the password wrong) I get this error when connecting: (I have omitted user and pass for obvious reasons)    Access denied for user 'test'@'127.0.0.1' (using password: YES) <?php $mysqli = new mysqli("127.0.0.1",...
asked by 27.12.2017 / 12:02