Infused Solutions » phpGene » HTML Functions

<?php

  
// FUNCTION to redirect to another page
  
function redirect($site) {
    echo
"<SCRIPT LANGUAGE=\"JavaScript\">\n";
    echo
"window.location = '$site'\n";
    echo
"</SCRIPT>";
  }

  
//FUNCTION to open table
  
function open_table($args) {
    if (isset(
$args["width"])) {
      
$width_string = " width=\"".$args["width"]."\"";
    }
    if (isset(
$args["height"])) {
      
$height_string = " height=\"".$args["height"]."\"";
    }
    if (isset(
$args["border"])) {
      
$border_string = " border=\"".$args["border"]."\"";
    }
    if (isset(
$args["cellspacing"])) {
      
$cellspacing_string = " cellspacing=\"".$args["cellspacing"]."\"";
    }
    if (isset(
$args["cellpadding"])) {
      
$cellpadding_string = " cellpadding=\"".$args["cellpadding"]."\"";
    }
    print
"<table".$width_string.$height_string.$border_string.$cellspacing_string.$cellpadding_string.">\n";
  }

  
//FUNCTION to close a table
  
function close_table() {
    print
"</table>\n";
  }
    
  
//FUNCTION to open new row
  
function open_row() {
    print
"<tr>\n";
  }

  
//FUNCTION to close a row
  
function close_row() {
    print
"</tr>\n";
  }

  
//FUNCTION to open a column
  
function open_column($args) {
    if (isset(
$args["width"])) { $width_string = " width=\"".$args["width"]."\""; }
    if (isset(
$args["height"])) { $height_string = " height=\"".$args["height"]."\""; }
    if (isset(
$args["class"])) { $class_string = " class=\"".$args["class"]."\""; }
    if (isset(
$args["align"])) { $align_string = " align=\"".$args["align"]."\""; }
    if (isset(
$args["valign"])) { $valign_string = " valign=\"".$args["valign"]."\""; }
    if (isset(
$args["colspan"])) { $colspan_string = " colspan=\"".$args["colspan"]."\""; }
    if (isset(
$args["nowrap"])) { $nowrap_string = " nowrap"; }
    print
"<td".$width_string.$height_string.$class_string.$align_string.$valign_string.$colspan_string.$nowrap_string.">\n";
  }    

  
//FUNCTION to close a column
  
function close_column() {
    print
"</td>\n";
  }
?>

© 1999-2003 Keith Morrison, Infused Solutions
infused.org software - phpGene