Révision f1a9b09d
Ajouté par Colin Fleming il y a presque 10 ans
usr/local/www/diag_ping.php | ||
---|---|---|
85 | 85 |
include("head.inc"); ?> |
86 | 86 |
<body link="#000000" vlink="#000000" alink="#000000"> |
87 | 87 |
<?php include("fbegin.inc"); ?> |
88 |
<table width="100%" border="0" cellpadding="0" cellspacing="0"> |
|
88 |
<table width="100%" border="0" cellpadding="0" cellspacing="0" summary="ping">
|
|
89 | 89 |
<tr><td> |
90 | 90 |
<?php if ($input_errors) print_input_errors($input_errors); ?> |
91 | 91 |
<form action="diag_ping.php" method="post" name="iform" id="iform"> |
92 |
<table width="100%" border="0" cellpadding="6" cellspacing="0"> |
|
92 |
<table width="100%" border="0" cellpadding="6" cellspacing="0" summary="tabcont">
|
|
93 | 93 |
<tr> |
94 | 94 |
<td colspan="2" valign="top" class="listtopic"><?=gettext("Ping"); ?></td> |
95 | 95 |
</tr> |
96 | 96 |
<tr> |
97 | 97 |
<td width="22%" valign="top" class="vncellreq"><?=gettext("Host"); ?></td> |
98 | 98 |
<td width="78%" class="vtable"> |
99 |
<?=$mandfldhtml;?><input name="host" type="text" class="formfldunknown" id="host" size="20" value="<?=htmlspecialchars($host);?>"></td> |
|
99 |
<?=$mandfldhtml;?><input name="host" type="text" class="formfldunknown" id="host" size="20" value="<?=htmlspecialchars($host);?>" /></td>
|
|
100 | 100 |
</tr> |
101 | 101 |
<tr> |
102 | 102 |
<td width="22%" valign="top" class="vncellreq"><?=gettext("IP Protocol"); ?></td> |
103 | 103 |
<td width="78%" class="vtable"> |
104 | 104 |
<select name="ipproto" class="formselect"> |
105 |
<option value="ipv4" <?php if ($ipproto == "ipv4") echo 'selected="selected"' ?>>IPv4</option>
|
|
106 |
<option value="ipv6" <?php if ($ipproto == "ipv6") echo 'selected="selected"' ?>>IPv6</option>
|
|
105 |
<option value="ipv4" <?php if ($ipproto == "ipv4") echo "selected=\"selected\"" ?>>IPv4</option>
|
|
106 |
<option value="ipv6" <?php if ($ipproto == "ipv6") echo "selected=\"selected\"" ?>>IPv6</option>
|
|
107 | 107 |
</select> |
108 | 108 |
</td> |
109 | 109 |
</tr> |
... | ... | |
116 | 116 |
foreach ($sourceips as $sip): |
117 | 117 |
$selected = ""; |
118 | 118 |
if (!link_interface_to_bridge($sip['value']) && ($sip['value'] == $sourceip)) |
119 |
$selected = 'selected="selected"';
|
|
119 |
$selected = "selected=\"selected\"";
|
|
120 | 120 |
?> |
121 | 121 |
<option value="<?=$sip['value'];?>" <?=$selected;?>> |
122 | 122 |
<?=htmlspecialchars($sip['name']);?> |
... | ... | |
130 | 130 |
<td width="78%" class="vtable"> |
131 | 131 |
<select name="count" class="formfld" id="count"> |
132 | 132 |
<?php for ($i = 1; $i <= MAX_COUNT; $i++): ?> |
133 |
<option value="<?=$i;?>" <?php if ($i == $count) echo "selected"; ?>><?=$i;?></option> |
|
133 |
<option value="<?=$i;?>" <?php if ($i == $count) echo "selected=\"selected\""; ?>><?=$i;?></option>
|
|
134 | 134 |
<?php endfor; ?> |
135 | 135 |
</select> |
136 | 136 |
</td> |
... | ... | |
138 | 138 |
<tr> |
139 | 139 |
<td width="22%" valign="top"> </td> |
140 | 140 |
<td width="78%"> |
141 |
<input name="Submit" type="submit" class="formbtn" value="<?=gettext("Ping"); ?>"> |
|
141 |
<input name="Submit" type="submit" class="formbtn" value="<?=gettext("Ping"); ?>" />
|
|
142 | 142 |
</td> |
143 | 143 |
</tr> |
144 | 144 |
<tr> |
145 | 145 |
<td valign="top" colspan="2"> |
146 | 146 |
<?php if ($do_ping) { |
147 |
echo "<font face='terminal' size='2'>";
|
|
147 |
echo "<font face=\"terminal\" size=\"2\">";
|
|
148 | 148 |
echo "<strong>" . gettext("Ping output") . ":</strong><br />"; |
149 |
echo('<pre>'); |
|
149 |
?> |
|
150 |
<script type="text/javascript"> |
|
151 |
//<![CDATA[ |
|
152 |
window.onload=function(){ |
|
153 |
document.getElementById("pingCaptured").wrap='off'; |
|
154 |
} |
|
155 |
//]]> |
|
156 |
</script> |
|
157 |
<?php |
|
158 |
echo "<textarea id=\"pingCaptured\" style=\"width:98%\" name=\"code\" rows=\"15\" cols=\"66\" readonly=\"readonly\">"; |
|
150 | 159 |
$ifscope = ''; |
151 | 160 |
$command = "/sbin/ping"; |
152 | 161 |
if ($ipproto == "ipv6") { |
... | ... | |
166 | 175 |
$cmd = "{$command} {$srcip} -c" . escapeshellarg($count) . " " . escapeshellarg($host); |
167 | 176 |
//echo "Ping command: {$cmd}\n"; |
168 | 177 |
system($cmd); |
169 |
echo('</pre>');
|
|
178 |
echo('</textarea> </font>');
|
|
170 | 179 |
} |
171 | 180 |
?> |
172 | 181 |
</td> |
... | ... | |
180 | 189 |
</td></tr> |
181 | 190 |
</table> |
182 | 191 |
<?php include("fend.inc"); ?> |
192 |
</body> |
|
193 |
</html> |
Formats disponibles : Unified diff
Tidy up "diag_ping.php" XHTML
Add SUMMARY to TABLES
Close INPUT tags
Update HTML Boolean operators
Change the PRE tag to a TEXTAREA tag and ad a piece of JavaScript code
to take off the warp
Add missing closing BODY and HTML tags