Questions tagged as 'php'

2
answers

How can I "skip" elements of an array when I use "list"?

I have the following array $array = [25, 'Wallace', '26 anos', 'linguagens' => ['PHP', 'Python', 'C#'] I would like to use the list function to capture some elements directly in variables, like this: list($id, $nome, $...
asked by 13.05.2016 / 15:01
1
answer

How to make a page to know IPv6?

To know IPv4 I can use the code on a page: <?php echo $_SERVER["REMOTE_ADDR"]; ?> But I can not find anything similar to do the same with IPv6, which appears to me a lot is already sites with converters. Even though there is no...
asked by 29.09.2014 / 16:28
2
answers

PHP mail () function

I'm trying to send an email via PHP with HTML attributes, an email formatted with images and styles. I have tried using PHPMailer, but without success, I have used PHP's mail () function that meets my needs and sends the email without many probl...
asked by 14.10.2014 / 22:19
3
answers

Find out if a site is airborne or not

Is there a function in PHP to find out if an IP address (ie website) is in the air or not? I found this function in WEB but it did not satisfy me .... it takes a lot to load. function curl_info($url){ $ch = curl_init(); curl_se...
asked by 01.09.2014 / 15:10
3
answers

Find sum of values in array

I need to develop an algorithm that finds a specific value of the sum of some elements of an array. Ex: I have an array with 50 distinct values and I have a given value "X" . I know that the sum of the combination of some elements of this...
asked by 02.10.2014 / 13:57
4
answers

Validate form before sending

I have an HTML page with an e-mail submission form. I need to check on the same page whether the fields were filled out or not at the time the user clicks the Submit button. Apparently it is bypassing the javascript function and it is sending th...
asked by 17.07.2017 / 18:56
2
answers

View and edit registered data

I created a registration system and wanted to know how to make the information that was registered appear on the page and that the user can edit it. Follow my code below. <body> <form action="" method="POST"> <label><br /&...
asked by 11.06.2015 / 13:15
3
answers

How to list a json object to generate a txt file and download that file via ajax request?

I have an ajax request that sends a large object. That in the browser console is seen like this: Object {data: Array[4936], paging: Object} The following is the requisition code: $.ajax({ type: "POST", url: "gerararquivo.php",...
asked by 17.06.2015 / 19:31
2
answers

Assign MySQL query result to a PHP variable

How, after telling how many records I have in a database, how do I put the value inside a PHP variable: $sql = mysql_query("SELECT COUNT(*) FROM 'users'"); $row = mysql_fetch_array($sql); $total = $row['COUNT(*)']; I managed to do what I w...
asked by 17.06.2015 / 16:07
2
answers

Catch the line break in a file and put the content in a variable

I'm getting a file in PHP. $arquivo = file_get_contents($_FILES['arquivo']['tmp_name']); I want to know how do I get this file and put it in an array for every line break that it finds \ n . For example: Nome 1 Nome 2 Nome 3 Nome 4...
asked by 25.05.2015 / 15:59