Go Back   CodingForums.com > :: Server side development > PHP

Before you post, read our: Rules & Posting Guidelines

Reply
 
Thread Tools Rate Thread
Enjoy an ad free experience by logging in. Not a member yet? Register.
Old 07-23-2012, 08:39 PM   PM User | #1
sirsaula
New Coder

 
Join Date: Jun 2012
Posts: 19
Thanks: 1
Thanked 0 Times in 0 Posts
sirsaula is an unknown quantity at this point
Pictures not displaying

I am using PHP to output an HTML table but when it does the pictures refuses to display.

The php array $members['smallimg'] linkts to the .jpg file for example
http://www.powerme.edu/me/images/fac...kumar_2012.jpg

PHP Code:
// If there is at least 1 member listed as Faculty, then we are going to get the header and table set up and ready to display each member.
    
if ($facultyfound == true)
    {
        
$html .= '<h2><a name="faculty"></a>Faculty</h2>';
    
        
$html .= '<tr>';
        
$html .= '<th width="12%">Photo</th>';
        
$html .= '<th width="11%">Name</th>';
        
$html .= '<th width="9%">Title</th>';
        
$html .= '<th width="14%">Contact</th>';
        
$html .= '<th width="54%">Research</th>';
        
        
$html .= '</tr>';
        
        for (
$i 0$i $size$i++)
        {
            
/*
                While we are looping through the for loop, we check each node to see if that node's information corresponds to the given department
                shortname and that the member is Faculty. If that is true, then we display the necessary information about them. If the XML element
                that normally contains information is actully empty, then it will just leave that space empty on the table as well in the corresponding
                position.
            */
            
if ($members[$i]['department'] == $thedepartment && $members[$i]['facultytype'] == 'Faculty')
            {
                
$html .= '<tr name="'.$members[$i]['shortname'].'">';
                
$html .= '<td style="vertical-align: middle; text-align: center;"><a name="'.$members[$i]['shortname'].'"></a><img src="'.
                    
$members[$i]['smallimg'].'" width="70" height="70"></td>';
                
$html .= '<td style="vertical-align: middle; text-align: center;"><a href="http://www.power.edu/'.$deptURL.'/faculty/faculty.php?name='.
                    
$members[$i]['firstname'].' '.$members[$i]['lastname'].'">'.$members[$i]['firstname'].' '.$members[$i]['lastname'].', '.
                    
$members[$i]['credentials'].'</a></td>';
                

                
$html .= '<td style="vertical-align: middle; text-align: center;">'.$members[$i]['title'].'</td>';
          
                
                
$html .= '</tr>';
            }
        }
        
    } 
sirsaula is offline   Reply With Quote
Old 07-23-2012, 08:52 PM   PM User | #2
Keleth
Senior Coder

 
Join Date: Jun 2008
Location: New Jersey
Posts: 2,354
Thanks: 45
Thanked 247 Times in 244 Posts
Keleth is on a distinguished road
That image doesn't even work. Are you sure the images are linked properly? PHP returns text to a browser, so something simple as displaying images is all on the HTML you've written, and that its not working has nothing to do with the PHP.
Keleth is offline   Reply With Quote
Old 07-23-2012, 09:15 PM   PM User | #3
Len Whistler
Senior Coder

 
Len Whistler's Avatar
 
Join Date: Jul 2002
Location: Vancouver, BC Canada
Posts: 1,323
Thanks: 26
Thanked 100 Times in 100 Posts
Len Whistler is on a distinguished road
What does the browser source code look like? One of the easiest ways to de-bug PHP is to look at the browser source code.



----
__________________
Leonard Whistler
Len Whistler is offline   Reply With Quote
Reply

Bookmarks

Jump To Top of Thread


Thread Tools
Rate This Thread
Rate This Thread:

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 On
HTML code is Off

Forum Jump


All times are GMT +1. The time now is 04:23 AM.


Advertisement
Log in to turn off these ads.