<?php
/*
filter.php
auth: Graham McCarthy @ Ryerson University Library
date: June 28th 2007
desc: connecting page between parseCatalogue.php and the catalogue
      Receives form fields, and puts them into a URL that facebook redirects to. 
*/

//Includes
require_once 'appinclude.php';
require 'dashboard.php';


//Accounts for both GET and POST methods.
if(isset($_POST["searchtype"]) && isset($_POST["searcharg"]))
{
	//Write a string URL
	$url = 'http://innopac.lib.ryerson.ca/search/' . $_POST["searchtype"]
													 . '?SEARCH=' .  urlencode($_POST["searcharg"]);
													 
	echo '<h1>Redirecting you to the <a href="' . $url . '" >Ryerson Library Catalogue</a></h1>';
		
	//redirect facebook to url										 
	$facebook->redirect($url);													 
}

//Accounts for both GET and POST methods
if(isset($_GET["searchtype"]) && isset($_GET["searcharg"]))
{
	$url = 'http://innopac.lib.ryerson.ca/search/' . $_GET["searchtype"]
													 . '?SEARCH=' .  urlencode($_GET["searcharg"]);													 
	echo '<h1>Redirecting you to the <a href="' . $url . '" >Ryerson Library Catalogue</a></h1>';
												 
	$facebook->redirect($url);													 
}

?>