close ad
Help us test the new Databridge BETA with MySQLi support
open ad
View Menu

Technical Support Forums

Free, outstanding support from WebAssist and your colleagues

Making document title a link to actual document

Thread began 4/20/2010 2:55 pm by cnandrews291194 | Last modified 4/23/2010 3:11 pm by cnandrews291194 | 851 views | 5 replies

cnandrews291194

Further clarification

Hi Eric -

I appreciate your reply, and have tried the behavior, but no dice. I'm attaching the page this displays on, and the code below.

As you can see from the browser page, the row repeat is fine, etc. - the problem now is that each of the documents repeats on each row of the table.

Ideas?

Thanks,
Charles

content.php

<?php require_once('../Connections/CMM.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_DOCUMENTS = 10;
$pageNum_DOCUMENTS = 0;
if (isset($_GET['pageNum_DOCUMENTS'])) {
$pageNum_DOCUMENTS = $_GET['pageNum_DOCUMENTS'];
}
$startRow_DOCUMENTS = $pageNum_DOCUMENTS * $maxRows_DOCUMENTS;

mysql_select_db($database_CMM, $CMM);
$query_DOCUMENTS = "SELECT * FROM DOC_UPLOADS";
$query_limit_DOCUMENTS = sprintf("%s LIMIT %d, %d", $query_DOCUMENTS, $startRow_DOCUMENTS, $maxRows_DOCUMENTS);
$DOCUMENTS = mysql_query($query_limit_DOCUMENTS, $CMM) or die(mysql_error());
$row_DOCUMENTS = mysql_fetch_assoc($DOCUMENTS);

if (isset($_GET['totalRows_DOCUMENTS'])) {
$totalRows_DOCUMENTS = $_GET['totalRows_DOCUMENTS'];
} else {
$all_DOCUMENTS = mysql_query($query_DOCUMENTS);
$totalRows_DOCUMENTS = mysql_num_rows($all_DOCUMENTS);
}
$totalPages_DOCUMENTS = ceil($totalRows_DOCUMENTS/$maxRows_DOCUMENTS)-1;
?>
<!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>Table Content</title>
<style type="text/css">
<!--
.SMALL_TEXT {
font-family: "Trebuchet MS", Arial, Helvetica, sans-serif;
font-size: .8em;
line-height: 2em;
}
-->
</style>
</head>

<body>
<form id="form1" name="form1" method="post" action="">
<table width="100%" class="SMALL_TEXT">
<tr>
<td>DOCUMENT NAME</td>
<td>DOCUMENT</td>
<td>UPLOAD DATE</td>
<td>FIRST NAME</td>
<td>LAST NAME</td>
<td>DEPARTMENT</td>
<td>CATEGORY</td>
</tr>
<?php do { ?>
<tr>
<td><?php echo $row_DOCUMENTS['DOCNAME']; ?></td>
<td><?
$path = "UPLOADED DOCUMENTS";
$dir_handle = @opendir($path) or die("Unable to open $path");
echo "Directory Listing of $path<br/>";
while($file = readdir($dir_handle)) {
if(is_dir($file)) {
continue;
}

else if($file != '.' && $file != '..') {
echo "<a href='plugins/$path/$file'>$file</a><br/>";
}
}
//closing the directory
closedir($dir_handle);
?></td>
<td><?php echo $row_DOCUMENTS['UPLOAD_DATE']; ?></td>
<td><?php echo $row_DOCUMENTS['FNAME']; ?></td>
<td><?php echo $row_DOCUMENTS['LNAME']; ?></td>
<td><?php echo $row_DOCUMENTS['DEPARTMENT']; ?></td>
<td><?php echo $row_DOCUMENTS['CATEGORY']; ?></td>
</tr>
<?php } while ($row_DOCUMENTS = mysql_fetch_assoc($DOCUMENTS)); ?>
</table>
</form>
</body>
</html>
<?php
mysql_free_result($DOCUMENTS);
?>

Build websites with a little help from your friends

Your friends over here at WebAssist! These Dreamweaver extensions will assist you in building unlimited, custom websites.

Build websites from already-built web applications

These out-of-the-box solutions provide you proven, tested applications that can be up and running now.  Build a store, a gallery, or a web-based email solution.

Want your website pre-built and hosted?

Close Windowclose

Rate your experience or provide feedback on this page

Account or customer service questions?
Please user our contact form.

Need technical support?
Please visit support to ask a question

Content

rating

Layout

rating

Ease of use

rating

security code refresh image

We do not respond to comments submitted from this page directly, but we do read and analyze any feedback and will use it to help make your experience better in the future.

Close Windowclose

We were unable to retrieve the attached file

Close Windowclose

Attach and remove files

add attachmentAdd attachment
Close Windowclose

Enter the URL you would like to link to in your post

Close Windowclose

This is how you use right click RTF editing

Enable right click RTF editing option allows you to add html markup into your tutorial such as images, bulleted lists, files and more...

-- click to close --

Uploading file...