Hello Jason.
Yes, the page is set up like you said. I applied another hidden element on the form but still did not work.
Follows the code of the page:
<?php
session_start(); // Inicia a session
include "functions.php"; // arquivo de funções.
session_checker(); // chama a função que verifica se a session iniciada da acesso à página.
?>
<?php require_once('Connections/conn.php'); ?>
<?php require_once("WA_DigitalFilePro/HelperPHP.php"); ?>
<?php
if (!function_exists("GetSQLValueString")) {
function GetSQLValueString($theValue, $theType, $theDefinedValue = "", $theNotDefinedValue = "")
{
if (PHP_VERSION < 6) {
$theValue = get_magic_quotes_gpc() ? stripslashes($theValue) : $theValue;
}
$theValue = function_exists("mysql_real_escape_string") ? mysql_real_escape_string($theValue) : mysql_escape_string($theValue);
switch ($theType) {
case "text":
$theValue = ($theValue != "") ? "'" . $theValue . "'" : "NULL";
break;
case "long":
case "int":
$theValue = ($theValue != "") ? intval($theValue) : "NULL";
break;
case "double":
$theValue = ($theValue != "") ? doubleval($theValue) : "NULL";
break;
case "date":
$theValue = ($theValue != "") ? "'" . $theValue . "'" : "NULL";
break;
case "defined":
$theValue = ($theValue != "") ? $theDefinedValue : $theNotDefinedValue;
break;
}
return $theValue;
}
}
$maxRows_rsArquivos = 15;
$pageNum_rsArquivos = 0;
if (isset($_GET['pageNum_rsArquivos'])) {
$pageNum_rsArquivos = $_GET['pageNum_rsArquivos'];
}
$startRow_rsArquivos = $pageNum_rsArquivos * $maxRows_rsArquivos;
mysql_select_db($database_conn, $conn);
$query_rsArquivos = "SELECT `arquivos`.*, `users`.*, `users`.`UserFirstName` AS Professor FROM `arquivos` LEFT JOIN `users` ON `arquivos`.`Professor` = `users`.`UserID` WHERE arquivos.Serie = 3 AND arquivos.Ativo = 1";
$query_limit_rsArquivos = sprintf("%s LIMIT %d, %d", $query_rsArquivos, $startRow_rsArquivos, $maxRows_rsArquivos);
$rsArquivos = mysql_query($query_limit_rsArquivos, $conn) or die(mysql_error());
$row_rsArquivos = mysql_fetch_assoc($rsArquivos);
if (isset($_GET['totalRows_rsArquivos'])) {
$totalRows_rsArquivos = $_GET['totalRows_rsArquivos'];
} else {
$all_rsArquivos = mysql_query($query_rsArquivos);
$totalRows_rsArquivos = mysql_num_rows($all_rsArquivos);
}
$totalPages_rsArquivos = ceil($totalRows_rsArquivos/$maxRows_rsArquivos)-1;?>
<?php
WA_DFP_SetupDownloadStatusStruct("WA_DownloadResult1");
if($_SERVER["REQUEST_METHOD"] == "POST"){
WA_DFP_DownloadFile("WA_DownloadResult1", "../../downloads", "".((isset($_POST["hiddenField"]))?$_POST["hiddenField"]:"") ."", "[FileName]", 1, $database_conn, $conn, "arquivos", "ArquivoID", "".$row_rsArquivos['ArquivoID'] ."", "CountDownload");
}
?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>Downloads 8 Série</title>
<link href="css/styles_downloads_arquivos.css" rel="stylesheet" type="text/css" />
<style type="text/css">
.Spacious {
padding-top: 3px;
padding-right: 7px;
padding-bottom: 3px;
padding-left: 7px;
text-transform: uppercase;
background-image: -moz-linear-gradient(top, #18536b, #1c5a73);
background-image: -o-linear-gradient(top, #18536b, #1c5a73);
background-image: -webkit-linear-gradient(#18536b, #1c5a73);
background-image: -webkit-gradient(linear,left top, left bottom, color-stop(0, #18536b), color-stop(1, #1c5a73));
background-image: linear-gradient(top, #18536b, #1c5a73);
filter: progid:DXImageTransform.Microsoft.Gradient(StartColorStr='#18536b', EndColorStr='#1c5a73', GradientType=0);
-ms-filter: progid:DXImageTransform.Microsoft.Gradient(StartColorStr='#18536b', EndColorStr='#1c5a73', GradientType=0);
background-position: 0 16px;
border-style: solid;
color: #cccccc;
background-color: #1c5a73;
border-color: #636668;
font-family: Arial, Verdana, sans-serif;
font-size: 0.6em;
border-width: 1px;
}
.Spacious:hover {
background: none;
color: #ffffff;
background-color: #18536b;
}
</style>
</head>
<body>
<div id="BannerTopoInst">
<table width="940" border="0" cellspacing="0" cellpadding="0">
<tr>
<td colspan="4"><img src="assets/images/clearpixel.gif" width="806" height="45" border="0" /></td>
</tr>
<tr>
<td width="150"> </td>
<td width="616"><span class="BannerTopoInstTitulo">Download</span><span class="BannerTopoInstTituloActive">Material Acadêmico</span></td></td>
<td width="23"><img src="assets/images/clearpixel.gif" width="20" height="45" border="0" /></td>
</tr>
</table>
</div>
<span class="Texto1"><?php echo "Bem vindo <strong>". $_SESSION['nome'] ." ". $_SESSION['sobrenome'] . "</strong>!<br />
Você está acessando a área restrita de downloads para os alunos cadastrados no Sistema de Ensino Universo!<br />
Seu último login foi em: ". date('d/m/Y', strtotime($_SESSION['data_ultimo_login'])) . '-' . date('H:i:s', strtotime($_SESSION['data_ultimo_login'])) ." <br />";
?></span><br />
<p>
<p class="ArquivosTitulo2">Material acadêmico / 3º Ano</span> - <a href="logout.php">SAIR</a><br /></p>
<?php if ($totalRows_rsArquivos == 0) { // Show if recordset empty ?>
<p class="FormCampoObrigatorio">No momento, não existem materiais acadêmicos para download para esta série.</p>
<?php } // Show if recordset empty ?>
<?php if ($totalRows_rsArquivos > 0) { // Show if recordset not empty ?>
<table width="940" border="0" cellspacing="2" cellpadding="0">
<tr>
<td width="228" height="25" bgcolor="#EBEBEB" class="ArquivosTitulo1">Disciplina</td>
<td width="301" bgcolor="#EBEBEB" class="ArquivosTitulo1">Título</td>
<td width="293" height="25" bgcolor="#EBEBEB" class="ArquivosTitulo1">Professor</td>
<td width="108" height="25" align="center" bgcolor="#EBEBEB" class="ArquivosTitulo1">Ação</td>
</tr>
<tr>
<td height="10" colspan="4"><img src="assets/images/clearpixel.gif" width="10" height="10" border="0" /></td>
</tr>
<?php do { ?>
<tr>
<td class="Texto1"><?php echo $row_rsArquivos['Disciplina']; ?></td>
<td class="Texto1"><?php echo $row_rsArquivos['Titulo']; ?></td>
<td class="Texto1"><?php echo $row_rsArquivos['Professor']; ?></td>
<td><form id="form1" name="form1" method="post" action="">
<input type="submit" value="Download" class="Spacious" id="Spacious" name="Spacious" />
<input name="hiddenField" type="hidden" id="hiddenField" value="<?php echo $row_rsArquivos['ProductLocation']; ?>" />
<input name="hiddenField2" type="hidden" id="hiddenField2" value="<?php echo((isset($_POST["hiddenField"]))?$_POST["hiddenField"]:"") ?>" />
</form></td>
</tr>
<?php } while ($row_rsArquivos = mysql_fetch_assoc($rsArquivos)); ?>
<tr>
<td> </td>
<td> </td>
<td> </td>
<td> </td>
</tr>
</table>
<?php } // Show if recordset not empty ?>
</body>
</html>
<?php
mysql_free_result($rsArquivos);
?>
Thank you.