Location: PHPKode > projects > MyDB > webide/myglobalvar.php
<?php
/*************************************************************
 * The MyDB librairy and applications are product of SQLFusion
 * It may be used and/or distributed under the terms of the Q Public
 * License (QPL) version 1.0, enclosed in the file licence.txt.
 ****************************************************************/
/** MyDB IDE Version 0.4    **/ 
/** Author Philippe Lewicki **/
 
      require("mydbconfig.inc.php");         


  if (!isset($globalvars)) {
      $globalvars = array() ; 
      session_register("globalvars"); 
	}

  if ($update) {
        $globalvars = array() ;  
  //      echo $nbrvars."-".$name1 ; 
      for ($i=1; $i <= $nbrvars;  $i++) {
	if ( strlen(${"name".$i}) >0) { 
 	             $globalvars[$i]["name"] = ${"name".$i } ; 
	              $globalvars[$i]["value"] = ${"value".$i } ; 
              }

          }
    }



?>

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN" "http://www.w3.org/TR/REC-html40/loose.dtd">
<HTML lang="en">
<HEAD>
<TITLE>Global Vars</TITLE>
<META name="author" content="Lewicki">
<META name="copyright" content="SQLFusion">

</HEAD>
<BODY>
<FORM method="get" action="myglobalvar.php">
<TABLE border="0" cellspacing="0" cellpadding="0">
<? for ($i=1; $i<= count($globalvars) ; $i++) { ?>
          <tr>
	<TD><INPUT name="name<? echo $i; ?>" type="text" size=10 value="<? echo $globalvars[$i]["name"]; ?>"></TD>
	<td>=</td>
	<TD><INPUT name="value<? echo $i; ?>" type="text" size=10 value="<? echo $globalvars[$i]["value"]; ?>"></TD>
</TR>
<? $numvars = $i;  } 
    $numvars++ ; 
?>
         <tr>
	<TD><INPUT name="name<? echo $numvars; ?>" size=10 type="text"></TD>
	<td>=</td>
	<TD><INPUT name="value<? echo $numvars; ?>" size=10 type="text"></TD>
</TR>
</TABLE>
<INPUT name="nbrvars" value="<? echo $numvars; ?>" type="hidden">
<DIV align="left"><INPUT name="update" type="submit" value="<?php echo $strUpadteGlobalVar; ?>"></DIV>
</FORM>
</BODY>
</HTML>
Return current item: MyDB