-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathcarma-ftp.php
More file actions
45 lines (31 loc) · 750 Bytes
/
Copy pathcarma-ftp.php
File metadata and controls
45 lines (31 loc) · 750 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
<?php
/* Template Name: CARMA
** Author: Samuel
**/
get_header();
?>
<div class="container">
<br>
<h4>RIR FTP FILES</h4>
<?php
$url = "ftp://ftp.ripe.net";
// connect and login to FTP server
$ftp = ftp_connect("ftp.ripe.net");
if (!$ftp) die('could not connect.');
// login
$login = ftp_login($ftp, "anonymous", "");
if (!$login) die('could not login.');
// enter passive mode
$passsive = ftp_pasv($ftp, true);
if (!$passsive ) die('could not enable passive mode.');
// get listing
$listing = ftp_nlist($ftp, "/pub/stats/ripencc/");
foreach($listing as $value){
echo "<a href='$url$value'>", substr($value, strrpos($value, '\\') + 1) ,"</a><br>";
}
?>
<br>
<!--<a href="#" class="btn btn-danger">CARMA</a>-->
</div>
<?
get_footer();