-
Notifications
You must be signed in to change notification settings - Fork 0
/
index.php
40 lines (35 loc) · 817 Bytes
/
index.php
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
<?php
/*
require_once("DB.php");
ini_set('max_execution_time', 3600);
$dictionary = "largedictionary.txt";
print("test");
$file = fopen($dictionary,"r");
if(!$file){
print("coule not open file. ");
}
while(!feof($file)){
$line = fgets($file);
print($line);
$stmt = $dbh->prepare("INSERT INTO `Words` (`word`) VALUES (?)");
$stmt->bindParam(1,$line);
$stmt->execute();
}
print("Complete");
fclose($file);
*/
//will implement with pulling from database later
require_once("Dictionary.php");
$case=0;
if($_POST){
if(isset($_POST['StringA']) && isset($_POST['StringB'])){
$WordDictionary = new Dictionary();
$ShortestPath = $WordDictionary->WordLadderCompute($_POST['StringA'],$_POST['StringB']);
$case = 1;
}
else{
$case = 0;
}
}
require_once("WordLadder.php");
?>