TightURL
[ class tree: TightURL ] [ index: TightURL ] [ all elements ]

Source for file tighturl.php

Documentation is available at tighturl.php

  1. <?php
  2. /**
  3. * TightURL :: A blind redirection service
  4. *
  5. * Copyright (c) 2004, Ron Guerin <ron@vnetworx.net>
  6. * portions Copyright (c) 2002,2003 Free Software Foundation
  7. *
  8. * This file implements a blind redirection service named TightURL.
  9. * TightURL is Free Software; you can redistribute it and/or modify it
  10. * under the terms of the GNU General Public License as published by
  11. * the Free Software Foundation; either version 2 of the License, or
  12. * (at your option) any later version.
  13. *
  14. * TightURL is distributed in the hope that it will be useful,
  15. * but WITHOUT ANY WARRANTY; without even the implied warranty of
  16. * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
  17. * See the GNU General Public License for more details.
  18. *
  19. * If you are not able to view the LICENSE, which should
  20. * always be possible within a valid and working TightURL release,
  21. * please write to the Free Software Foundation, Inc.,
  22. * 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
  23. * to get a copy of the GNU General Public License or to report a
  24. * possible license violation.
  25. *
  26. * @package TightURL
  27. * @author Ron Guerin <ron@vnetworx.net>
  28. * @license http://www.fsf.org/licenses/gpl.html GNU Public License
  29. * @copyright Copyright &copy; 2004 Ron Guerin
  30. * @filesource
  31. * @link http://tighturl.com TightURL
  32. * @version 0.1
  33. *
  34. */
  35. /**
  36. * This is the TightURL release number.
  37. */
  38. define(VERSION, "0.1");
  39.  
  40. /**
  41. * TightURL will not work with PHP versions older than this.
  42. */
  43. define(REQUIRED_PHP_VERSION, "4.3.0");
  44.  
  45. // System defaults, DO NOT EDIT THIS FILE
  46. // Edit tighturl.config.inc.php instead!
  47.  
  48.  
  49.  
  50. /**
  51. * MySQL variables
  52. *
  53. * @global string $dbhost
  54. */
  55. $dbhost = "localhost";
  56. /**
  57. * MySQL variables
  58. *
  59. * @global string $dbuser
  60. */
  61. $dbuser = "dbuser";
  62. /**
  63. * MySQL variables
  64. *
  65. * @global strgin $dbpass
  66. */
  67. $dbpass = "dbpass";
  68. /**
  69. * MySQL variables
  70. *
  71. * @global string $tighturl
  72. */
  73. $dbname = "tighturl";
  74. /**
  75. * MySQL variables
  76. *
  77. * @global string $dbtable
  78. */
  79. $dbtable = "urls";
  80.  
  81. /**
  82. * 404-Method: TRUE or FALSE
  83. *
  84. * @global int $FOFMethod
  85. */
  86. $FOFMethod=FALSE; //0=Full URL path or mod_rewrite, 1=404-Method compressed URLs
  87. /**
  88. * Reserved URLs: TRUE or FALSE
  89. *
  90. * @global int $Reserved
  91. */
  92. $Reserved=TRUE; //0=Do not use Reserved URLs, 1=Use Reserved URLs
  93. // URIBL variables
  94.  
  95. $uribl = array("multi.surbl.org");
  96. $uriblurl = array("www.surbl.org");
  97.  
  98. // Text strings and style variables
  99. $svcname = "URLSquisher";
  100. $verbtext = "Squish";
  101. $pasttext = "Squished";
  102. $tagline = "Squish long URLs to make short ones";
  103. $headcolor = "#006600";
  104. $tablecolor = "#00CC99";
  105. $copystart = date("Y");
  106. $copyrightholder = "SquishURL Enterprises";
  107. global $copyright, $conn, $db;
  108.  
  109. // Reserved URLs
  110. $ReservedURL = array("faq","help","code","source","docs","cvs","arch","url",
  111. "about","admin","setup","svn");
  112.  
  113. // You REALLY don't want to edit below here unless you know what you're doing.
  114.  
  115. ob_start(); // Turn on output buffering to avoid header issues
  116. initialize_service();
  117. main();
  118. ob_end_flush(); // Turn off output buffering, flush buffer
  119. exit;
  120.  
  121. // *************************************************************************
  122.  
  123. /**
  124. * Main. Process whatever the incoming request is.
  125. */
  126. function main() {
  127.  
  128. global $REQUEST_URI, $FOFMethod, $uribl, $uriblrbl, $uribls;
  129. global $svcname, $verbtext, $pastext, $tagline,
  130. $headcolor, $tablecolor, $copystart, $self;
  131.  
  132. echo "<html>\n";
  133. echo " <head>\n";
  134. echo " <title>".$svcname."</title>\n";
  135. echo " </head>\n";
  136. echo " <body>\n";
  137. if ( (isset($_REQUEST['save']) && $_REQUEST['save'] == 'yes')
  138. && (isset($_REQUEST['url']) && !empty($_REQUEST['url']) ) ) {
  139. save_URL($_REQUEST['url']);
  140. }
  141. elseif ( isset($_REQUEST['i']) && !empty($_REQUEST['i']) ) {
  142. lookup_ID($_REQUEST['i']);
  143. }
  144. elseif ($FOFMethod && preg_match("/^\/+([a-zA-Z0-9]+)$/",$REQUEST_URI,$matches)) {
  145. lookup_ID($matches[1]);
  146. }
  147. elseif ($FOFMethod && $REQUEST_URI != "/") {
  148. display_HTML("","Error: Couldn't find a valid ".$svcname." URI.");
  149. }
  150. else {
  151. display_HTML("main");
  152. }
  153. echo " </body>\n";
  154. echo "</html>\n";
  155. }
  156.  
  157. function initialize_service() {
  158. global $validurlpattern, $validippattern, $FOFMethod, $copyright, $copystart, $uribls,
  159. $uribl, $uriblrbl, $self, $conn, $db;
  160.  
  161. if (version_compare(phpversion(), REQUIRED_PHP_VERSION)<0) {
  162. die_HTML("","TightURL ".VERSION." needs PHP >= ".REQUIRED_PHP_VERSION." (you are using ".phpversion().")<br />\n");
  163. }
  164. $os=strpos(strtolower(PHP_OS), "win")===false?"nix":"win";
  165.  
  166. $validurlpattern="^(http|https|ftp)\://([a-zA-Z0-9\.\-]+(\:[a-zA-Z0-9\.&%\$\-]+)*@)";
  167. $validurlpattern.="*((25[0-5]|2[0-4][0-9]|[0-1]{1}[0-9]{2}|[1-9]{1}[0-9]{1}|[1-9])";
  168. $validurlpattern.="\.(25[0-5]|2[0-4][0-9]|[0-1]{1}[0-9]{2}|[1-9]{1}[0-9]{1}|[1-9]|0)";
  169. $validurlpattern.="\.(25[0-5]|2[0-4][0-9]|[0-1]{1}[0-9]{2}|[1-9]{1}[0-9]{1}|[1-9]|0)";
  170. $validurlpattern.="\.(25[0-5]|2[0-4][0-9]|[0-1]{1}[0-9]{2}|[1-9]{1}[0-9]{1}|[0-9])";
  171. $validurlpattern.="|localhost|([a-zA-Z0-9\-]+\.)*[a-zA-Z0-9\-]+\.(com|edu|gov|int|mil|net|org";
  172. $validurlpattern.="|biz|arpa|info|name|pro|aero|coop|museum|us|ca|uk|jp|ru|ua|fr|gr|de|dk|tr|ie";
  173. $validurlpattern.="|it|au|br|cc|ch|cn|es|fi|gr|hk|hu|il|in|kr|mx|my|nl|no|nu|nz|ph|pl";
  174. $validurlpattern.="|ad|ae|af|ag|ai|al|am|an|ao|aq|ar|as|at|aw|az|ba|bb|bd|be|bf|bg|bh|bi|bj|bm";
  175. $validurlpattern.="|bn|bo|bs|bt|bv|bw|by|bz|cf|cd|cg|ch|ci|ck|cl|cm|co|cr|cs|cu|cv|cx|cy|cz|dj";
  176. $validurlpattern.="|dm|do|dz|ec|ee|eg|eh|er|et|fj|fk|fm|fo|fx|ga|gb|gd|ge|gf|gh|gi|gl|gm|gn|gp";
  177. $validurlpattern.="|gq|gs|gt|gu|gw|gy|hm|hn|hr|ht|id|io|iq|ir|is|jm|jo|ke|kg|kh|ki|km|kn|kp|kw";
  178. $validurlpattern.="|ky|kz|la|lb|lc|li|lk|lr|ls|lt|lu|lv|ly|ma|mc|md|mg|mh|mk|ml|mm|mn|mo|mp|mq";
  179. $validurlpattern.="|mr|ms|mt|mu|mv|mw|mz|na|nc|ne|nf|ng|ni|np|nr|nt|om|pa|pe|pf|pg|pk|pm|pn|pr";
  180. $validurlpattern.="|pt|pw|py|qa|re|ro|ru|rw|sa|sb|sc|sd|se|sg|sh|si|sj|sk|sl|sm|sn|so|sr|st|su";
  181. $validurlpattern.="|sv|sy|sz|tc|td|tf|tg|th|tj|tk|tm|tn|to|tp|tr|tt|tv|tw|tz|ua|ug|um|uy|uz|va";
  182. $validurlpattern.="|vc|ve|vg|vi|vn|vu|wf|ws|ye|yt|yu|za|zm|zr|zw";
  183. $validurlpattern.="|[a-zA-Z]{2}))(\:[0-9]+)*(/($|[a-zA-Z0-9\.\,\?\'\\\+&%\$#\=~_\-]+))*$";
  184.  
  185. $validippattern="/^(http|https|ftp):\/\/(\d{1,2}|1\d\d|2[0-4]\d|25[0-5])\.(\d{1,2}|1\d\d|2[0-4]\d|25[0-5])";
  186. $validippattern.="\.(\d{1,2}|1\d\d|2[0-4]\d|25[0-5])\.(\d{1,2}|1\d\d|2[0-4]\d|25[0-5])/";
  187.  
  188. if (file_exists("tighturl.config.inc.php")) { include("tighturl.config.inc.php"); }
  189. if ($FOFMethod) { header("HTTP/1.1 200 OK"); }
  190.  
  191. // Figure out our copyright string
  192. $thisyear = date("Y");
  193. $copyright = $copystart;
  194. if ($copystart != $thisyear) { $copyright.="-".$thisyear; }
  195. for ($i=0; $i<count($uribl); $i++) {
  196. if ($i > 0) { $uribls.=", "; }
  197. $uribls.= "<a href='http://".$uriblurl[$i]."'>".$uribl[$i]."</a>";
  198. }
  199.  
  200. // Figure out correct self
  201. if (strncmp($_SERVER['PHP_SELF'],$REQUEST_URI,strlen($_SERVER['PHP_SELF'])) != 0) {
  202. $self .="/";
  203. }
  204. else {
  205. $self .= $_SERVER['PHP_SELF']."/"; // We need the script name
  206. }
  207.  
  208. // Connect to MySQL, open database.
  209. $conn = mysql_connect($dbhost, $dbuser, $dbpass) or die_HTML("Cannot connect to database.");
  210. $db = mysql_select_db($dbname, $conn) or die_HTML("Cannot select database. ".mysql_error());
  211. }
  212.  
  213. /**
  214. * Windows version of the *nix-only PHP function checkdnsrr.
  215. */
  216. function wincheckdnsrr($host, $rtype = '') {
  217. if (!empty($host)) {
  218. if ($rtype == '') $rtype = "MX";
  219. exec("nslookup -type=$rtype $host",$result);
  220. foreach ($result as $line) {
  221. if (eregi("^$host",$line)) { return true; }
  222. }
  223. return false;
  224. }
  225. return false;
  226. }
  227.  
  228. /**
  229. * addslashes wrapper to check for gpc_magic_quotes
  230. * @author Gavin Zuchlinski <gav@libox.net>
  231. */
  232. function nice_addslashes($string) {
  233. // if magic quotes is on the string is already quoted, just return it
  234. $magic_quotes = (bool) ini_get('magic_quotes_gpc');
  235. if ($magic_quotes == TRUE)
  236. return $string;
  237. else
  238. return addslashes($string);
  239. }
  240.  
  241. /**
  242. * sanitize a string for SQL input (simple slash out quotes and slashes)
  243. */
  244. function sanitize_sql_string($string, $min='', $max='') {
  245. $string = nice_addslashes($string); //gz
  246. $pattern = "/;/"; // jp
  247. $replacement = "";
  248. $len = strlen($string);
  249. if((($min != '') && ($len < $min)) || (($max != '') && ($len > $max)))
  250. return FALSE;
  251. return preg_replace($pattern, $replacement, $string);
  252. }
  253.  
  254. /**
  255. * Counts the number of times a substring is contained in a given string.
  256. */
  257. function countSubstrs($haystack, $needle) {
  258. return (($p = strpos($haystack, $needle)) === false) ? 0 : (1 + countSubstrs(substr($haystack, $p+1), $needle));
  259. }
  260.  
  261. /**
  262. * Checks to see if a given URL is on a URI blacklist. Currently this means SURBL. http://www.surbl.org
  263. *
  264. * Returns TRUE if the domain is listed on any configured URIBLs.
  265. */
  266. function On_URIBL($url) {
  267. global $uribl, $uriblurl, $validippattern, $os;
  268. if ($url) {
  269. // Test for IP address, reverse the quads if found
  270. if (preg_match($validippattern,$url,$matches)) {
  271. $domain=$matches[5].".".$matches[4].".".$matches[3].".".$matches[2];
  272. }
  273. else {
  274. // strip out second-level domain name
  275. preg_match("|.?://(www\.)?([^/:]+)|",$url,$matches); // Needs work
  276. $domain = $matches[2];
  277. // kluge to compensate for inadequate regex above
  278. while (countSubstrs($domain,".") > 1) {
  279. $chop = strpos($domain,".");
  280. $domain = substr($domain,$chop + 1);
  281. }
  282. }
  283. // Query multi.surbl.org to see if domain/IP appears as target in known spam
  284. for ($i=0; $i<count($uribl); $i++) {
  285. if ($os == "nix") {
  286. $recexists = checkdnsrr($domain.".".$uribl[$i],"A");
  287. }
  288. else {
  289. $recexists = wincheckdnsrr($domain.".".$uribl[$i],"A");
  290. }
  291. if ($recexists) {
  292. $uribls.="<a href='http://".$uriblurl[$i]."'>".$uribl[$i]."</a> ";
  293. }
  294. }
  295. if ($uribls) { return $uribls; } else { return FALSE; }
  296. }
  297. }
  298.  
  299. /**
  300. * Checks to see if a given URL is a Reserved URL.
  301. *
  302. * Returns TRUE if the ID is listed as a Reserved URL.
  303. */
  304. function On_Reserve($id) {
  305. $res=FALSE;
  306.  
  307. if ($id) {
  308. $sexatrigesimal = base_convert($id, 10, 36);
  309. for ($i=0; $i<count($ReservedURL); $i++) {
  310. if ($sexatrigesimal == strtolower($ReservedURL[$i])) return TRUE;
  311. }
  312. return FALSE;
  313. }
  314. }
  315.  
  316. /**
  317. * Save the given URL in the database if unique and return the ID or return an existing ID for given URL.
  318. * The ID returned will be a sexatrigesimal (Base-36) number.
  319. *
  320. * Saves the URL in the database, converts the decimal ID value returned by the database to
  321. * a sexatrigesimal value, and displays the generated TightURL.
  322. */
  323. function save_URL($url) {
  324. global $dbtable, $svcname, $FOFMethod, $validurlpattern, $pasttext, $self;
  325.  
  326. if (file_exists("tighturl.tmpl")) $html = file_get_contents("tighturl.tmpl");
  327.  
  328. if ( !ereg($validurlpattern, $url) ) {
  329. display_HTML("","Error: That URL is not valid.",$url,"",$url);
  330. }
  331. else {
  332. if ( $url != sanitize_sql_string($url, $min='', $max='')) {
  333. display_HTML("","Error: Bad URL.",$url,"",$url);
  334. }
  335. else {
  336. $lists = On_URIBL($url);
  337. if (! $lists) {
  338. $req = "SELECT * FROM $dbtable WHERE url = '$url';";
  339. $res = mysql_query($req)
  340. or die_HTML("Error: Duplicate check query failed<br />");
  341. if (mysql_num_rows($res) == 0) {
  342. do {
  343. $req ="INSERT INTO $dbtable (id, url) ";
  344. $req .= "VALUES ('', '$url');";
  345. if (mysql_query($req)) {
  346. $decimal = mysql_insert_id();
  347. }
  348. else {
  349. display_HTML("","Error: Database failure.");
  350. }
  351. $reserved = on_Reserve($id);
  352. if ($reserved) {
  353. // Blank out URL in record just written
  354. }
  355. while ($reserved)
  356. }
  357. else {
  358. // Return existing ID for this duplicate request
  359. $decimal = mysql_result($res, 0, "id");
  360. }
  361. $sexatrigesimal = base_convert($decimal, 10, 36);
  362. $address = "http://".$_SERVER['HTTP_HOST'].$self;
  363. if (! $FOFMethod) { $address .= "?i="; } // We need the parameter tag
  364.  
  365. $address .= $sexatrigesimal; // Append the Base-36 ID to the URL
  366.  
  367. display_HTML("save","",$url,$address);
  368. }
  369. else {
  370. display_HTML("","Error: Submitted URL (".$url.") is listed in ".$lists." You may not create a ".$svcname." link for it.");
  371. }
  372. }
  373. }
  374. }
  375.  
  376. /**
  377. * Looks up given ID in the database and redirects, displays template, or
  378. * displays error page. Expects the ID to be a sexatrigesimal (Base-36) number,
  379. * which is the format used by TightURLs.
  380. *
  381. * We convert the ID to decimal before looking it up in the database, as the
  382. * ID field is a MySQL autoincrement decimal value.
  383. */
  384. function lookup_ID($sexatrigesimal) {
  385. global $dbtable, $svcname;
  386. $decimal = base_convert ($sexatrigesimal, 36, 10);
  387.  
  388. $req = "SELECT * FROM $dbtable WHERE id = '$decimal';";
  389. $res = mysql_query($req)
  390. or die_HTML("Error: Query failed<br />");
  391.  
  392.  
  393.  
  394. // Here, determine if there's a record in the DB. If yes, show it, if
  395. // it's not a blank URL. Otherwise if it's on the reserved list, show
  396. // template file. Otherwise generate error.
  397.  
  398. if (On_Reserve($decimal)) {
  399. display_HTML($sexatrigesimal);
  400. }
  401. else {
  402.  
  403.  
  404.  
  405. if (mysql_num_rows($res) == 0) {
  406. header("HTTP/1.1 404 Not Found");
  407. display_HTML("","Error: That ".$svcname." ID is not in our database.");
  408. }
  409. else {
  410. header("Location: ".mysql_result($res, 0, "url"));
  411. }
  412. }
  413.  
  414. /**
  415. * Display HTML page using template and template variables.
  416. *
  417. * Reads in the main system template file (tighturl.tmpl) into $html .
  418. *
  419. * $template
  420. * Checks for the existence of a subtemplate named tighturl.$template.tmpl
  421. * and replaces template variable $HTML in the main template tighturl.tmpl
  422. * with the contents of tighturl.$template.tmpl if any.
  423. *
  424. * Then any remaining $HTML from the only or inner template is replaced by $content,
  425. * along with $url, $tighturl, and $input. A variety of other replacements are
  426. * made using various global variables.
  427. *
  428. * $content
  429. * HTML content to be replace template variable $HTML
  430. *
  431. * $url
  432. * URL submitted to TightURL
  433. *
  434. * $tighturl
  435. * TightURL generated for $url
  436. *
  437. * $input
  438. * When submitted URL does not validate it is passed back as $input
  439. *
  440. * Template variables are words in all capital letters that start with a
  441. * $ symbol, such as $TEMPLATEVARIABLE. TightURL now supports at least
  442. * 20 template variables. At runtime, these template variables are replaced
  443. * by program variables.
  444. * - $HTML : HTML passed into the function as $input by the program or an inner template
  445. * - $URL : URL submitted to TightURL
  446. * - $URLLEN : Length of the submitted URL
  447. * - $TIGHTURL : TightURL generated for the submitted URL
  448. * - $TIGHTURLLEN : Length of generated TightURL
  449. * - $DIFF : Difference in length between submitted and TightURLs
  450. * - $INPUT : Bad input URL being passed back to output form
  451. * - $SVCNAME : Name of the TightURL service
  452. * - $HEADCOLOR : Color of the H1 Header tag
  453. * - $TABLECOLOR : Color of the table containing URL input field
  454. * - $TAGLINE : Tagline of the TightURL service
  455. * - $CPASTTEXT : Capitalized past-tense word for tightening URLs
  456. * - $PASTTEXT : Non-Capitalized past-tense word for tightening URLs
  457. * - $CVERBTEXT : Capitalized action word for tightening URLs
  458. * - $VERBTEXT : Non-Capitalized action word for tightening URLs
  459. * - $COPYRIGHT : Copyright duration string generated from $copystart global variable,
  460. * will be current 4-digit year if $copystart not defined.
  461. * - $COPYRIGHTHOLDER : Name of copyright holder
  462. * - $URLBLS : HTML string of URIBLs TightURL is checking
  463. * - $HOST : Hostname TightURL is running on
  464. * - $SELF : Name TightURL is invoked as
  465. */
  466. function display_HTML ($template,$content = "",$url="",$tighturl="",$input="") {
  467. global $svcname, $verbtext, $pasttext, $tagline, $uribls,
  468. $headcolor, $tablecolor, $copyright, $copyrightholder, $self;
  469.  
  470. if (file_exists("tighturl.tmpl")) {
  471. $html = file_get_contents("tighturl.tmpl");
  472. if (($template != "") && file_exists("tighturl.".$template.".tmpl")) {
  473. $template = file_get_contents("tighturl.".$template.".tmpl");
  474. $html = preg_replace("/\\\$HTML/",$template,$html);
  475. }
  476. elseif ($template != "") {
  477. header("HTTP/1.1 404 Not Found");
  478. $html = preg_replace("/\\\$HTML/","Error: Template file tighturl.".$template.".tmpl cannot be found.",$html);
  479. }
  480. if (substr($content, 0, 6) == "Error:") {
  481. $content = preg_replace("/Error:/","<big><font color='red'>Error:",$content)."</font></big>";
  482. }
  483. if ($content) $content.="<br />\n";
  484. // Always replace longer similar tokens before shorter ones. Things won't work the
  485. // way you expect if you replace $URL first, and then replace $URLLEN.
  486. $html = preg_replace("/\\\$HTML/",$content,$html);
  487. $html = preg_replace("/\\\$URLLEN/",strlen($url),$html);
  488. $html = preg_replace("/\\\$URL/",$url,$html);
  489. $html = preg_replace("/\\\$INPUT/",$input,$html);
  490. $html = preg_replace("/\\\$TIGHTURLVER/",VERSION,$html);
  491. $html = preg_replace("/\\\$TIGHTURLLEN/",strlen($tighturl),$html);
  492. $html = preg_replace("/\\\$TIGHTURL/",$tighturl,$html);
  493. $html = preg_replace("/\\\$DIFF/",strlen($url)-strlen($tighturl),$html);
  494. $html = preg_replace("/\\\$SVCNAME/",$svcname,$html);
  495. $html = preg_replace("/\\\$HEADCOLOR/",$headcolor,$html);
  496. $html = preg_replace("/\\\$TABLECOLOR/",$tablecolor,$html);
  497. $html = preg_replace("/\\\$TAGLINE/",$tagline,$html);
  498. $html = preg_replace("/\\\$CPASTTEXT/",$pasttext,$html);
  499. $html = preg_replace("/\\\$PASTTEXT/",strtolower($pasttext),$html);
  500. $html = preg_replace("/\\\$VERBTEXT/",strtolower($verbtext),$html);
  501. $html = preg_replace("/\\\$CVERBTEXT/",$verbtext,$html);
  502. $html = preg_replace("/\\\$COPYRIGHTHOLDER/",$copyrightholder,$html);
  503. $html = preg_replace("/\\\$COPYRIGHT/",$copyright,$html);
  504. $html = preg_replace("/\\\$URIBLS/",$uribls,$html);
  505. $html = preg_replace("/\\\$HOST/",$_SERVER['HTTP_HOST'],$html);
  506. $html = preg_replace("/\\\$SELF/",$self,$html);
  507. $html = preg_replace("/\\\$__/","$",$html); // Template Variables shown as text instead of substituted
  508. echo $html;
  509. }
  510. else {
  511. header("HTTP/1.1 404 Not Found");
  512. echo "<big><font color='red'>Error: TightURL Redirection service (".$svcname.") site template not found.</font></big><br />\n";
  513. }
  514. }
  515.  
  516. /**
  517. * Die in an HTML-friendly way
  518. */
  519. function die_HTML($errmsg,$func=__FUNCTION__,$lineno=__LINE__) {
  520. $text="<br />Error: ".$errmsg."<br />Function: ".$func."<br />Line: ".$lineno."</body></html>";
  521. die;
  522. }
  523. ?>

Documentation generated on Mon, 25 Oct 2004 06:48:56 -0400 by phpDocumentor 1.3.0RC3