PhpDig.net

Go Back   PhpDig.net > PhpDig Forums > Mod Submissions

Reply
 
Thread Tools
Old 10-07-2003, 06:42 AM   #1
chazter
Green Mole
 
Join Date: Sep 2003
Posts: 8
Add PDF files to be indexed - Solution

I hope this helps for future reference. In one of my PHP pages, I created a variable in PHP to hold my list of PDF files to be indexed from an array and put that variable in a hidden html tag.

====================
<?php

//Create Query

$sql = ("SELECT * FROM newsdetail");
$mysql_result=mysql_query($sql,$connection);

$num_rows=mysql_num_rows($mysql_result);

//Initialize $listURLAll variable

$listURLAll="";

//Check to see if Query returns Records

if ($num_rows != 0) {

//If records exist create array

while ($row = mysql_fetch_array($mysql_result)) {


//$pID represents a specific category of PDF files

$pID = $row["NewsDetail_ID"];

//Optional Switch Statement. I have pdf files in different locations


switch($pID) {
case 1:
$dir = "filings/";
break;
case 2:
$dir = "advisories/";
break;
case 3:
$dir = "headlines/";
break;
case 4:
$dir = "newsletter/";
break;
case 5:
$dir = "press/";
break;
case 6:
$dir = "reports/";
break;

}

$pTitle = $row["NewsDetail_Title"];
$pFile = $row["NewsDetail_FileName"];
$pext = ".pdf";

//$listURL represents a URL path of a pdf file per record

$listURL=("<a href=$dir$pFile$pext target=blank>$pTitle</a><br>");

//$listURLALL represents a list of URL paths to be appended after each record pass

$listURLAll = $listURLAll.$listURL;

} // End While

} // End If
?>

<!-- hidden text tag, the VALUE represents the $listURLAll to be indexed for the PHPdig spider. -->

<input type="hidden" name="hiddenURL" value="<?php echo $listURLAll ?>">
chazter is offline   Reply With Quote
Reply

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
searching PDF files bcunico External Binaries 3 02-24-2006 01:40 AM
Not indexing pdf files jayhawk External Binaries 13 02-18-2004 05:13 AM
How to index a directory with pdf files simonced How-to Forum 3 02-13-2004 10:41 AM
Add PDF files to be indexed chazter External Binaries 4 10-07-2003 06:43 AM
Search PDF files chazter External Binaries 4 10-02-2003 06:47 AM


All times are GMT -8. The time now is 02:02 AM.


Powered by vBulletin® Version 3.7.3
Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright © 2001 - 2005, ThinkDing LLC. All Rights Reserved.