How to correct the error "Undefined variable"?

2

I found two open-source point control systems on the internet: sisponto and wponto . But they are making several mistakes. Some I have corrected, of the type that did not give space or lack semicolon, but others do not understand, like this one.

The complete error is:

  

(!) Notice: Undefined variable: _PALAVRAS in C: \ wamp \ www \ sisponto \ inc \ header.php on line 26 Call Stack #TimeMemoryFunctionLocation 10.0009244840 {main} () .. \ index.php: 0 20.0020251112include ('C: \ wamp \ www \ sisponto \ inc \ header.php') .. \ index.php: 3 "/ > (!) Notice: Undefined variable: _DESCRICAO in C: \ wamp \ www \ sisponto \ inc \ header.php on line 27 Call Stack #TimeMemoryFunctionLocation 10.0009244840 {main} () .. \ index.php: 0 20.0020251112include ('C: \ wamp \ www \ sisponto \ inc \ header.php') .. \ index.php: 3 "/ > (!) Notice: Undefined variable: _AUTOR in C: \ wamp \ www \ sisponto \ inc \ header.php on line 28 Call Stack #TimeMemoryFunctionLocation 10.0009244840 {main} () .. \ index.php: 0 20.0020251112include ('C : \ wamp \ www \ sisponto \ inc \ header.php ') .. \ index.php: 3 "/ > (!) Notice: Undefined variable: _LICENCA in C: \ wamp \ www \ sisponto \ inc \ header. php on line 29 Call Stack #TimeMemoryFunctionLocation 10.0009244840 {main} () .. \ index.php: 0 20.0020251112include ('C: \ wamp \ www \ sisponto \ inc \ header.php') .. \ index.php: 3 "/ > (!) Notice: Undefined variable: _DATA in C: \ wamp \ www \ sisponto \ inc \ header.php on line 30 Call Stack #TimeMemoryFunctionLocation 10.0009244840 {main} () .. \ index.php: 0 20.0020251112include ('C : \ wamp \ www \ sisponto \ inc \ header.php ') .. \ index.php: 3 "/ > (!) Notice: Undefined variable: time in C: \ wamp \ www \ sisponto \ inc \ header. php on line 31 Call Stack #TimeMemoryFunctionLocation 10.0009244840 {main} () .. \ index.php: 0 20.0020251112include ('C: \ wamp \ www \ sisponto \ inc \ header.php'

Source code of header.php :

<?
// Caso _ERROS esteja setado para False, desabilita a 
// exibição de erros, caso contrario, habilita!
  if ($_ERROS == "True") 
   error_reporting(0);
  else
   error_reporting(E_ALL);

  if (isset($_GET['origem'])) {
     $tempo=3;
  }else{
     $tempo=9999999;
  }
?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="pt-br" lang="pt-br">
<head>
        <?php include ("conf\common.php"); ?>
        <meta http-equiv="content-type" content="text/html; charset=UTF-8" />
        <meta name="Keywords" content="<?=$_PALAVRAS?>" />
        <meta name="Description" content="<?=$_DESCRICAO?>" />
        <meta name="Autor" content="<?=$_AUTOR?>" />
        <meta name="License" content="<?=$_LICENCA?>" />
        <meta name="Date" content="<?=$_DATA?>" />
        <meta HTTP-EQUIV="Refresh" CONTENT="<?=$tempo?>; URL=<?=$_URL?>">

        <title><?=$_TITULO?></title>
        <link rel="Stylesheet" href="<?=$_DIRINC?>/styles.css" />
        <script type="text/javascript" language="JavaScript" src="<?=$_DIRINC?>/functions.js"></script>
</head>
<body>
<?
// Estabelece a conexão com o banco de dados
  $CON = pg_connect("host=$_HOST dbname=$_DB user=$_USER password=$_PASS") or msgerro("Impossível acessar a base de dados!");
?>

The site can be accessed at the following address: http://200.171.59.245/wponto/

    
asked by anonymous 22.09.2014 / 17:57

1 answer

-1

The reason why you can not access the variables is because the short_open_tags option is by default off and you are using this option to insert php into html.

Php can be inserted into the html in several ways:

a standard

<?php echo "olá mundo" ?>

short tags (needs to be enabled);

<? echo "olá mundo" ?> ou evitando o comando echo <?=$var ?>

ASP style (needs to be enabled);

<% echo "olá mundo" %>

style script

<script language="php">
 echo "olá mundo";
</script>

If you do not, you can go to php.ini to enable short tags or change your code

<meta name="Keywords" content="<?=$_PALAVRAS?>" />

for

<meta name="Keywords" content="<?php echo $_PALAVRAS ?>" />
    
22.09.2014 / 19:49