-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathread_esxcli.php
More file actions
38 lines (23 loc) · 753 Bytes
/
Copy pathread_esxcli.php
File metadata and controls
38 lines (23 loc) · 753 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
<?php
//Read file content and returns it back to AJAX
if(isset($_POST['variable'])){
$esxclimajor=array();
$type=$_POST['variable'];
$fp=fopen("files/esxcli.txt", "r");
while (!feof($fp))
{
$line=fgets($fp);
$line=explode('\n', $line);
$esxclimajor[]=$line[0];
}
fclose($fp);
$i=0;
print '<script>var value = ' . json_encode($esxclimajor) . ';</script>';
foreach ($esxclimajor as $esxclicmd) {
echo '<li><a onclick="addText(\'$esxcli.\'+value['.$i.'] +\'\n\')">' . $esxclicmd . '</a></li>';
$i++;
}
}else{
echo 'Something went wrong on PHP page';
}
?>