4 Replies - 246 Views - Last Post: 18 April 2012 - 01:16 AM

#1 Madhya  Icon User is offline

  • New D.I.C Head

Reputation: 0
  • View blog
  • Posts: 18
  • Joined: 14-March 12

Diplaying images on a single page from their paths

Posted 17 April 2012 - 08:01 AM

I have 5 attachments, whose i want to print/display on a single page. I am using the following code to display one attachment, now i want to print the other 4 attachments below the first, by giving line breaks.
<?php
          $row_number = $from + 1;
          while($rowArray = mysql_fetch_array($resultArray) )
           {
     ?>   
  
 <?php
$f1=$rowArray['FullName'];
$f2=$rowArray['EmailAddr'];
$string=$rowArray['Message'];
$path1=$rowArray['file1'];
$path2=$rowArray['file2'];
$path3=$rowArray['file3'];
$path4=$rowArray['file4'];
$path5=$rowArray['file5'];

$limit=9;
$string1 = myTruncate($string,$limit);
?>
<tr>
 <td><font face="Arial, Helvetica, sans-serif"><?PHP echo $row_number++; ?></font></td>
<td><font face="Arial, Helvetica, sans-serif"><?php echo $f1; ?></font></td>
<td><font face="Arial, Helvetica, sans-serif"><?php echo $f2; ?></font></td>
<td><font face="Arial, Helvetica, sans-serif"><?php echo $string1; ?></font>
<a onclick="showDialog('<?php echo $string; ?>', '<?php echo $f1; ?>');" href="#">View</a>
<div id="dialog"></div>
</td>
<td>
<td><font face="Arial, Helvetica, sans-serif"><?php printf('<a href="%s">View all Files</a>',$path1); ?></font>

</td>



File1 is successfully showing, now how to display the 4 others right below the first one.

I want when a user click on View all files, all the 5 files are shown on a separate page.
Please if any body could help.

Is This A Good Question/Topic? 0
  • +

Replies To: Diplaying images on a single page from their paths

#2 Dormilich  Icon User is offline

  • 痛覚残留
  • member icon

Reputation: 2936
  • View blog
  • Posts: 7,690
  • Joined: 08-June 10

Re: Diplaying images on a single page from their paths

Posted 17 April 2012 - 08:09 AM

from the look of it the closing brace of the while() loop is missing (in the given code).

PS. <font> is deprecated, use CSS for that.
Was This Post Helpful? 0
  • +
  • -

#3 Madhya  Icon User is offline

  • New D.I.C Head

Reputation: 0
  • View blog
  • Posts: 18
  • Joined: 14-March 12

Re: Diplaying images on a single page from their paths

Posted 17 April 2012 - 09:06 AM

View PostDormilich, on 17 April 2012 - 08:09 AM, said:

from the look of it the closing brace of the while() loop is missing (in the given code).

PS. <font> is deprecated, use CSS for that.


Yea, i have missed copying the last braces. Please if you can provide any help.
And what does it mean font is deprecated.
Was This Post Helpful? 0
  • +
  • -

#4 Dormilich  Icon User is offline

  • 痛覚残留
  • member icon

Reputation: 2936
  • View blog
  • Posts: 7,690
  • Joined: 08-June 10

Re: Diplaying images on a single page from their paths

Posted 17 April 2012 - 10:07 PM

View PostMadhya, on 17 April 2012 - 06:06 PM, said:

And what does it mean font is deprecated.

that you should not use it.

@topic, you only get one file because you print only one (line #29).
Was This Post Helpful? 0
  • +
  • -

#5 Atli  Icon User is offline

  • D.I.C Lover
  • member icon

Reputation: 3115
  • View blog
  • Posts: 4,675
  • Joined: 08-June 10

Re: Diplaying images on a single page from their paths

Posted 18 April 2012 - 01:16 AM

Madhya said:

Please if you can provide any help

Like Dormilich says, if you only print one link, only one link will be printed. If you want the other four printed, you need to print the other four. - You already have code that prints one link. Look at how that is done and do the same for the other four links.

View PostDormilich, on 18 April 2012 - 05:07 AM, said:

View PostMadhya, on 17 April 2012 - 06:06 PM, said:

And what does it mean font is deprecated.

that you should not use it.

To elaborate on this. The HTML styling tags and attributes, like the <font> tag, have long since been replaced by CSS. Rather than do stuff like this:
<font face="Arial, Helvetica, sans-serif">Hey, old-timer!</font>


You could do this: (Although, this is hardly better.)
<span style="font-family: Arial, Helvetica, sans-serif;">Hello, 21'st century!</span>


The reason why CSS is preferred is because it also allows you to do stuff like this:
<!DOCTYPE html>
<html>
<head>
    <title>CSS Example</title>
    <style type="text/css">
    span.ArialFont {
        font-family: Arial, Helvetica, sans-serif;
    }
    </style>
</head>
<body>
    <span class="ArialFont">Hello, CSS classes!</span>
</body>
</head>


And, more importantly, the <style> block can be moved into an external file, allowing your styles to be cached, thus saving you (and everybody) bandwidth.

If you intend to work with websites at all, do yourself a huge favor and spend a few hours reading up on CSS, instead of wasting your time writing out <font> tags.
Was This Post Helpful? 0
  • +
  • -

Page 1 of 1