Hello,
so basically i am not very experienced in PHP and this script is becoming the biggest challenge for me, probably because I lack of knowledge in PHP, so I am asking for some help and explanations.
Explanation of what I am doing:
I am trying to create a php script which gonna have a html form to create WIFI user on cisco WLC.
I know that WLC it self got this kind of thing, but the reason I want to do it is that I dont want to allow any staff members to connect to WLC even knowing that they are going to have limited rights and so on.
So I came-up with this idea that I am going to make this PHP script and HTML form which uses SNMP to create wifi user accounts, that's how I am planning to bypass using WLC interface.
So the first thing which drives me nuts is that I need to convert entered time from HTML form to seconds, this form has days, hours, minutes.
See attachment.
Basically I want to "echo" entered time period in seconds at the bottom of php script but I dont know how.
I know that this code is messy and ugly, but the idea itself covers that
Code looks like that:
Lifetime:
days
hours
mins
overall code looks like that(it is still missing PHP_SNMP functions):
</pre><form method="POST" action="index.php">
bgColor="#ffffcc" align=center>
Host:
wlc-1
wlc-2
Username:
Password:
Lifetime:
days
hours
mins
Vlan:
ISM Studies
<
This part of PHP script converts (username, password) input for HTML table to ascii decimal numbers that's because SNMP requires that.
$user = $_POST['user'];
$pass = $_POST['password'];
$host = $_POST['host'];
$arr = array($user);
$arr2 = array($pass);
foreach($arr as $value)
{
$index = 0;
while($index < strlen($value))
{
$ascii .= '.' . ord($value[$index]);
$dot_separated = implode(".", $value)."
";
$index++;
}
echo $ascii."
";
}
foreach($arr2 as $value)
{
$index = 0;
while($index < strlen($value))
{
$ascii2 .= '.' . ord($value[$index]);
$dot_separated = implode(".", $value)."
";
$index++;
}
echo $ascii2."
";
}
echo $host."
";
?>