diff options
| author | ziejd2 | 2018-09-13 23:59:20 -0500 |
|---|---|---|
| committer | ziejd2 | 2018-09-13 23:59:20 -0500 |
| commit | e3f7237ffcb19f19db3b68777b5a94b89e07f66a (patch) | |
| tree | 554a8013776ebeae3e2976074020c09c2d1af8b0 /sourcecodes/enter_netID.php | |
| parent | a7eb61ff7a09f39bee67014bf24b8919eaccfc19 (diff) | |
| download | BNW-e3f7237ffcb19f19db3b68777b5a94b89e07f66a.tar.gz | |
New parameter learning options
The main change here is in the parameter learning methods. The parameters that are learned at first (i.e., if there is no evidence) are the distributions that are found directly in the data. I had to create or significantly modify several BNT files for this. If there is evidence, the parameters are learned using a Dirichlet prior. This only required a couple of small changes to the BNW parameter learning files.
Diffstat (limited to 'sourcecodes/enter_netID.php')
| -rw-r--r-- | sourcecodes/enter_netID.php | 77 |
1 files changed, 77 insertions, 0 deletions
diff --git a/sourcecodes/enter_netID.php b/sourcecodes/enter_netID.php new file mode 100644 index 00000000..f90f78db --- /dev/null +++ b/sourcecodes/enter_netID.php @@ -0,0 +1,77 @@ +<!DOCTYPE HTML> +<html> + +<?php + +include("header_new.inc"); +include("input_validate.php"); + +$netID = ""; +$netIDErr = ""; +if ($_SERVER["REQUEST_METHOD"] == "POST") { + if (empty($_POST["netID"])) { + $netIDErr = "Entering a network ID is required"; + } else { + // $netID = valid_keyval($_POST["netID"]); + $netIDErr = "1"; + $netID = test_input($_POST["netID"]); + // $netIDErr = "1"; + // check if name only contains letters + if (strlen($netID)!=3) { + $netIDErr = "Network ID must be three letters"; + } + if (!preg_match('/^[a-zA-Z]+$/',$netID)) { + $netIDErr = "Only letters are allowed"; + } + } +} + +function test_input($data) { + $data = trim($data); + $data = stripslashes($data); + $data = htmlspecialchars($data); + return $data; +} +?> + + +<!-- Site navigation menu --> +<ul class="navbar"> + <li><a href="help.php" target="_blank">Help</a> + <li><a href="home.php">Home</a> +</ul> + +<div id="outer"> +<!-- Main content --> +<br> +<br> +<h1>Enter network ID from previously used network</h1> +<br> +<p align="justify"> + Networks that have previously been generated in BNW can be accessed by entering the network ID in the input box below. The network ID is currently a three character string that can be found on the left hand menu of any network page. Network files are periodically deleted from BNW so it is possible that older networks may no longer be active. +<br> +<br> +<p><span class="error"></span></p> +<FORM METHOD="post" ACTION="<?php echo htmlspecialchars($_SERVER["PHP_SELF"]);?>"> + Network ID:<INPUT TYPE="text" name="netID" value="<?php echo $netID;?>" style="padding: 2px 5px; border: 2px solid; border-color: black black black black; font-family: Georgia, ..., serif; font-size: 18px; +display: block; height: 30px; width: 100px;"><span class="error"> <?php echo $netIDErr;?></span> +<br><input type="submit" name="submit" value="Submit" style="display: block; height: 30px; width:100px; font-family: Georgia, ..., serif; font-size: 16px;"> +</FORM> +</p> +<br> + +<?php +if ($netIDErr=="1") +{ + $keyval=$netID; +?> +<script> + window.open("layout.php?My_key=<?php print($keyval);?>",'_self',false); +</script> +<?php +} +?> + +</div> +</body> +</html> \ No newline at end of file |
