How do I make a hyperlink with dynamic data from a php data base table?
Level - Dreamweaver infrequent user
I have a standard master-detail couple of pages using MySQL and PHP. This function is working correctly. One of the data items on the Details page contains the name of a PDF document (including the .pdf suffix). The PDFs are stored in the PDFs library under the Site Root. I am wanting the ability of the page user to look at the associated PDF. Keeping it as simple as possible I just set up a text field 'View Report' followed by the Dynamic Text for the document name. I tried defining the Link Properties with the PDFs library name (plus the root level) followed by the code I thought it needed to identify the selected PDF document ( <? php echo $row_rslivesDetail['ReportLink']; ?> ). The first part is correct because when the code failed I changed it to a fixed PDF document and that worked. I've tried various combinations but not been successful. Can someone please suggest what I'm doing wrong with the code.
Regards
Cliff
Do the PDFs actually reside in your MySql database or are they just in a folder on your server?
To parse files from a folder, you could use something like this:
<h2>PDF Files</h2>
<?php
class SortingIterator implements IteratorAggregate
private $iterator = null;
public function __construct(Traversable $iterator, $callback)
if (!is_callable($callback)) {
throw new InvalidArgumentException('Given callback is not callable!');
$array = iterator_to_array($iterator);
usort($array, $callback);
$this->iterator = new ArrayIterator($array);
public function getIterator()
return $this->iterator;
?>
<!--results-->
<h3>2014</h3>
<?php
function mysort($a, $b)
return $a->getPathname() > $b->getPathname();
$item = new SortingIterator(new RecursiveIteratorIterator(new RecursiveDirectoryIterator('pdfs/2014/')), 'mysort');
foreach ($item as $file) {
echo '<li><a href="' . $file . '">' . $file->getFilename() . '</a> - '. round( $file->getSize() / 1052) . ' KB </li>';
?>
</ul>
In my example above, pdfs is my main folder and 2014 is my sub-folder.
Results echo inside a list with each file name hyperlinked. See screenshot.
Nancy O.
Similar Messages
-
How to fill my collapsible panels with dynamic content from PHP scripts?
Hi people,
I'm trying to generate dynamically generated content in a
Spry collapsible panel. Previously I've generated PHP files that as
an output generates a dynamic table with the data I want to show. I
figured it would be possible to use an php include option to
generate this table in a content section of a Spry collapsible
panel. However, when I do this the collapsible panels appear to
join and when panel1 is clicked all tables close instead of only
panel 1 and all tables are put benath each other without putting it
in each seperate panel. But when i replace the file with only the
text "content" it works fine. Do i maybe have to add some kind of
command at the end of my php file to make it look like the
"content"-text or is this not the problem?
I've been looking for the answer now for a couple of weeks on
various forums and nothing seemed to work for me. Can please
somebody help me out?
Greets,
Damian
The code in its non working form:
<head>
<!--Link the CSS style sheet that styles the Collapsible
Panel-->
<link href="SpryAssets/SpryCollapsiblePanel.css"
rel="stylesheet"
type="text/css" />
<!--Link the Spry Collapsible Panel JavaScript
library-->
<script src="SpryAssets/SpryCollapsiblePanel.js"
type="text/javascript"></script>
</head>
<body>
<!--Create the Collapsible Panel widget and assign
classes to each element-->
<div id="CollapsiblePanel1" class="CollapsiblePanel1">
<div class="CollapsiblePanelTab">Tab</div>
<div class="CollapsiblePanelContent"><?php
include('details_books.php');?></div>
</div>
<div id="CollapsiblePanel2" class="CollapsiblePanel2">
<div class="CollapsiblePanelTab">Tab</div>
<div class="CollapsiblePanelContent"><?php
include('details_authors.php');?></div>
</div>
<!--Initialize the Collapsible Panel widget object-->
<script type="text/javascript">
var CollapsiblePanel1 = new
Spry.Widget.CollapsiblePanel("CollapsiblePanel1");
</script>
<script type="text/javascript">
var CollapsiblePanel2 = new
Spry.Widget.CollapsiblePanel("CollapsiblePanel2");
</script>
</body>you need to save the page as a php page (.php) It works
fine -
pls send ans for this
1b5595eb-fcfc-48cc-90d2-43ba913ea79f wrote:
pls send ans for this
use any text editor to eliminate the dot before loading -
HT4059 How do I make ibook purchase with iTunes gift card rather than credit card on account.
How do I make ibook purchase with iTunes gift card rather than credit card on account.
go to settings- itunes app store- click appleid and view account - may need password - then under billing info select none. however it will auto use the gift card regardless first
-
How do i make a slideshow with iphoto for my mother and view on apple TV?
How do i make a slideshow with iPhoto fo rmy mother and view on my appleTV. I guess i need to know the best/easiest way. Do i create a slideshow in iPhoto and then it will automatically pop up on my apple TV Photos? or is it really not that easy? i don't want to do airplay......i would like to sit and enjoy it with her.
micloud sync would only be an option if you login with your appleID
so think flickr is the easy way -
How can i make my hyperlinks open in a new window or tab?
how can i make my hyperlinks open in a new window or tab?
The program is InDesign… we need to cease links which will open the linked document in a separate window. Also, the links must be maintained once a pdf is made and the files moved to another computer….
-
How can i make audio player with osmf??
i want to know how can i make audio player with osmf and flex4.5 ?
Thanks again...I suppose I'd just like it louder in case the radio is on when the directions are given. The difference between the iPhone & Nokia is like night & day!
BTW, do you know if the Maps program is using data from my cell phone plan as we drive? Or are the corresponding maps downloaded into the phone once for the trip?
Thanks again!! -
How can I make textedit start with a new (blank) document?
How can I make textedit start with a new (blank) document?
Instead of it starting up with a dialogue box to select an existing or start a new document.@Alley_Cat thanks for the ideas.
I turned off System Preferences > iCloud > Documents&Data - problem solved.
I'll use DropBox instead - it provides the options for a better experience. I hope Apple keep working on iCloud so that it doesn't go the way of Moble Me. -
How can I make the popup with empty fileds and create new record?
I would like to use a popup to create new record.
I created a af:popup by drag and drop a VO from data control to jsff. then, I created a button and place a af:showPopupBehavior. I was able to popup window by click the button.
however, the window filled with the information from the 1st record. and when I select a record in table and click popup, the popup is filled with that record.
How can I make the popup with empty fileds and create new record by saving the popup?
ThanksYou can have edit and new buttons, in the PopupFetchEvent identify button source (using popupFetchEvent.getLaunchSourceClientId()) if new button clicked clear the binding using below code.
If you want to see empty fields, in the popup PopupFetchEvent clear the input component bindings.
resetBindingValue("#{bindings.<componentid>.inputValue}", null);
public static void resetBindingValue(String expression, Object newValue) {
FacesContext ctx = FacesContext.getCurrentInstance();
Application app = ctx.getApplication();
ExpressionFactory elFactory = app.getExpressionFactory();
ELContext elContext = ctx.getELContext();
ValueExpression valueExp = elFactory.createValueExpression(elContext,expression,Object.class);
Class bindClass = valueExp.getType(elContext);
valueExp.setValue(elContext,newValue);
} -
I have viber installed on my iPhone. But whenever I receive a call from Viber, it would not ring. How do I fix this problem? How do I make it ring with incoming call?
Bring your phone into Apple for evaluation
-
HT201236 how do you make a bullet with keyboard shortcuts?
how do you make a bullet with keyboard shortcuts?
According to this https://discussions.apple.com/thread/1381905?start=0&tstart=0 Option 8 will insert a bullet.
-
How do I make ALL files with RTF extension open in Nisus Writer?
How do I make ALL files with RTF extension open in Nisus Writer? Right now it opens in Text Edit. I don't want to change it for one file. I want all files, regardless of how many or where they are.
select a .rtf file in finder and enter command+i. in the resulting popup go to the "open with" section and change the app to open it to Nisus Writer and click "Change All".
-
How do i make my payment with a money order
how do i make my payment with a money order
I will send you an address and you can trust me to pass it on to Adobe.
Seriously...contact who you purchased from. This site cant help you. -
So I bought a video on iTunes, how do I make it compatible with iMovie so I can edit it and make my own video? If I can't do this, then how do those people on YouTube make videos with clips from TV shows and Movies?
Videos purchased from iTunes cannot be copied.
-
How can I make a slideshow with pictures and burn it to a dvd? what program to use?
how can i make a slideshow with my pictures and then burn it to a dvd?
Apple's builtin "iPhoto" application can do that easily. Open iPhoto and click on "Help" at the top of the screen for assistance in creating it.
Hope this helps
Maybe you are looking for
-
I want to buy a new apple tv but it used hdmi cables and my house is only wired for analog. Is there any way I can use the apple tv on analog cables?
-
While running facebook ipad is suddenly coming to homescreen
while running facebook app(after latest update on today) sometimes it is minimized and homescreen pops up..any solution?
-
I am a new user of Solaris 10 on SPARC processor. My requirement is to run Ubuntu inside a virual machine on top of Solaris 10 platform. Already tried out Oracle VM VirtualBox. Though it comes with a distribution for Solaris on x86, it does not have
-
BI Statistics Query - RRI Issue
Hi Experts, I have copied a BI Statistics querys and customized it. The RRI Options available for the original query are available for the copied query as well. However, I do not want to keep all of them. When i checked the T.code RSBBS for the copi
-
I have requirement as follows: User generates a report by running a pl/sql procedure. Report is based on DB table which is deleted completely every day and data will not be available for 1 hour. Requirement is, during this 1 hr period also user shoul