" Test if ' in O'Hara works
Matches may turn out to be buried in tags e.g. "row" in a
'Richard Bapty', // textbox
'dept' => '',
'flag' => 1, //
'uog' => '1',
'debug' => '0',
'anchor' => 'anchor',
);
$formenu1 = "\n\n";
$debugmenu = array( // Example of spec for a mkmenu() menu
// 'value' => 'text of line on menu'
'2' => 'Verbose',
'1' => 'medium',
'0' => "Only emergencies."
); // can also just have list of values (no texts), and call
// mkformmenu('varname', $menuarray, 1);
$deptmenu = array('', 'computing', 'chemistry', 'dcs', 'psychology');
$uogmenu = array('1', '0');
$flagmenu = array('1', '0');
// x. Get the FORM variables set
$url0 = 'http://www.psy.gla.ac.uk';
$formurl = $url0 . $PHP_SELF; //PHP_SELF => /~steve/tmp/decode.php
// Look for simple request value with no var=val
$reqstr = preg_replace('/&.*/', '', urldecode($QUERY_STRING));
if (preg_match('/=/', $reqstr)) { $reqstr = ''; };
$hasarg = 0; /// In case want to display differently if no user args yet.
if (isset($findstr)) { $hasarg = 1; }
else {
$findstr = $vars['findstr'];
if ($reqstr) { $findstr = $reqstr; $hasarg = 1; };
};
// set all defaults if not set by GET (user)
foreach (array_keys($vars) as $varname)
{ if (!isset(${$varname})) ${$varname} = $vars[$varname]; };
/* obsolete manual settings
// TEST
//$debug = 1;
//$start = 'http://www.gla.ac.uk/services/learningteaching/contactus/staffcontacts/';
//$dept = 'computing';
$name = 'Deneka donald';
$name = 'craig xxxxxxxx';
$name = 'quintin Cutts';
$name = 'Arthur Whittaker';
$name = 'james Currall';
$name = 'Richard Bapty';
$name = 'Rob Hill';
$name = 'asdfasdfadfasdf';
$name = 'zzzz';
//$dept = 'chemistry';
$flag = 1;
$uog = 1;
// END of Test settings
*/
// REQUEST ? ARGS EXPECTED ====================================
// $who or $name: Name to be found e.g. 'steve Draper'
// $end: Short cut page to go to if available
// $start: Search page to start with
// $anchor: say what anchor tag in use and tell php that there is one
// $flag: if present (any value) then output index page of everything
//tried/found, instead of the best page itself.
// $dept=chemistry If present, first search univ list of depts, match,
//go to dept. page, search for "staff" hoping for staff list,
// then search that for original names.
// $uog: if present (any value) then print official person page.
// ==================================== My PARAMETERS
$defaultanchor = 'anchor';
$defaultfindstr = 'Draper';
$startlist = 'http://www.gla.ac.uk/services/learningteaching/contactus/staffcontacts/';
$uogurl = 'gla.ac.uk'; // NOT http: ...
//$uogdb = 'http://www.gla.ac.uk:443/stafflist/surname.cfm?surname=';
$uogdb = 'http://www.gla.ac.uk/stafflist/?action=search&surname=';
$uogdb = 'http://www.gla.ac.uk/stafflist/index.html?action=search&surname=';
// to be treated as a db, urls must end in =
$uogdepts = 'http://www.gla.ac.uk/departments/';
$dcs = 'http://www.dcs.gla.ac.uk/contacts/search.cfm?position=everybody';
$defaultstart = $uogdb;
$logfile = 'phpnames.html'; // or get this script name and s/.php/.html/
$logfileurl = $logfile;
$endindex = "\n