Permalink
Browse files

Merge branch 'master' of https://github.com/kcalmes/a-team.git

  • Loading branch information...
2 parents 2acd5d6 + abd45da commit 4d7d2bc5b3f1d1ec4a7b4d857e2e28784f3dddde David committed Dec 14, 2012
Showing with 38 additions and 0 deletions.
  1. +9 −0 redirectToIndex.html
  2. +9 −0 redirectToMirror.html
  3. +20 −0 searchService2.php
View
@@ -0,0 +1,9 @@
+<html>
+ <head>
+ <title>Redirecting...</title>
+ <meta HTTP-EQUIV="REFRESH" content="0; url=http://www.williamsware.com/cs/a-team/index.html">
+ </head>
+ <body>
+ <h1>Redirecting...</h1>
+ </body>
+</html>
View
@@ -0,0 +1,9 @@
+<html>
+ <head>
+ <title>Redirecting...</title>
+ <meta HTTP-EQUIV="REFRESH" content="0; url=http://www.williamsware.com/cs/a-team/studentMirror.html">
+ </head>
+ <body>
+ <h1>Redirecting...</h1>
+ </body>
+</html>
View
@@ -0,0 +1,20 @@
+<?php
+ $link = mysql_connect('williamswarecom.fatcowmysql.com', 'lawrence', 'pitridish');
+ if(!link) {die('Could not connect: ' . mysql_error());}
+ mysql_select_db("cs240", $link);
+
+ $result = mysql_query("SELECT url, isDoc, tags, title FROM Resources");
+
+ $toEcho = "{'results':[";
+
+ while($row = mysql_fetch_array($result)) {
+ if(($_GET['query'] && ((stristr($row['tags'], $_GET['query'])) || (stristr($row['title'], $_GET['query']))) ) || ! $_GET['query']) {
+ $toEcho = $toEcho . "{ \"url\":\"" . $row['url'] . "\", ";
+ $toEcho = $toEcho . "\"title\":\"" . $row['title'] . "\", ";
+ $toEcho = $toEcho . "\"isDoc\":\"" . $row['isDoc'] . "\" }, ";
+ }
+ }
+
+ $toEcho = $toEcho . "] }";
+ echo str_ireplace("}, ] }", "} ] }", $toEcho);
+?>

0 comments on commit 4d7d2bc

Please sign in to comment.