Xtremer360 Posted January 10, 2010 Share Posted January 10, 2010 When this function gets loaded it doesn't load the image just trying to figure out why. function roleplay($fedid,$rp,$iframe,$dirpath,$folder,$headshot,$fullshot,$bioheadwidth,$bioheadheight) { print "<div id=\"roleplays\">\n"; $query = "SELECT rp.id as rpid, rp.title as rp_title, rp.rpdate as rp_date, rp.location as location, rp.roleplay as roleplay, bio.charactername as charactername, bio.username as username, bio.posername as posername FROM efed_content_roleplays as rp INNER JOIN efed_bio as bio ON ( rp.bio_id = bio.id ) WHERE rp.id = '$rp' ORDER BY rp.id desc"; $result = mysql_query ($query); while ($row = mysql_fetch_assoc($result)) { $fieldarray=array('rpid','rp_title','rp_date','location','roleplay','charactername','username','posername'); foreach ($fieldarray as $fieldlabel) { if (isset($row[$fieldlabel])) { $$fieldlabel=$row[$fieldlabel]; $$fieldlabel=cleanquerydata($$fieldlabel); } } if (file_exists("$dirpath$headshot/$posername.jpg")) { if ($iframe == "yes") { print "<a href=$folder/roster.php?username=$username target=_top><img src=$folder$headshot/$posername.jpg border=0 align=left width=".$bioheadwidth." height=".$bioheadheight." hspace=5 vspace=5></img></a>\n"; } else { print "<a href=$folder/bio.php?username=$username target=_top><img src=$folder$headshot/$posername.jpg border=0 align=left width=".$bioheadwidth." height=".$bioheadheight." hspace=5 vspace=0></img></a>\n"; } } print "<font size=5> ".$rp_title."</font><br>\n"; print "<b>Featuring:</b> <a target=_top href=".$folder."/bio.php?username=".$username.">".$charactername."</a><br>\n"; if ($rp_date != "") { print "<b>Date:</b> ".$rp_date."<br>\n"; } if ($location != "") { print "<b>Location:</b> ".$location."<br>\n"; } print "<br><br><p style=\"margin-left:20px;margin-right:20px;\">\n"; print nl2br($roleplay)."<br>\n"; print "</p><hr>\n"; if ($iframe == "yes") { print "<center><a target=_top href=".$folder."/roster.php?username=".$username.">View ".$charactername."'s Biography</a></center>\n"; } else { print "<center><a target=_top href=".$folder."/bio.php?username=".$username.">View ".$charactername."'s Biography</a></center><br>\n"; } } print "</div>\n"; } Link to comment https://forums.phpfreaks.com/topic/187900-not-loading-image/ Share on other sites More sharing options...
trq Posted January 10, 2010 Share Posted January 10, 2010 What have you done to debug the problem? You are aware that all of the markup used within that function isn't valid? Could that be the issue? Link to comment https://forums.phpfreaks.com/topic/187900-not-loading-image/#findComment-992113 Share on other sites More sharing options...
Xtremer360 Posted January 10, 2010 Author Share Posted January 10, 2010 Everything loads correctly except for the image. Link to comment https://forums.phpfreaks.com/topic/187900-not-loading-image/#findComment-992115 Share on other sites More sharing options...
trq Posted January 10, 2010 Share Posted January 10, 2010 What have you done to debug the problem? Link to comment https://forums.phpfreaks.com/topic/187900-not-loading-image/#findComment-992120 Share on other sites More sharing options...
Xtremer360 Posted January 10, 2010 Author Share Posted January 10, 2010 Well I took out the second part of the else statement and that didn't show the image so I know it's not that. I don't know what else I could do debug it since all I really have to concentrate on is the part that is show the image. Link to comment https://forums.phpfreaks.com/topic/187900-not-loading-image/#findComment-992123 Share on other sites More sharing options...
Xtremer360 Posted January 10, 2010 Author Share Posted January 10, 2010 I've done a validator and it didn't even say anything about the image. I'm so confused. Link to comment https://forums.phpfreaks.com/topic/187900-not-loading-image/#findComment-992138 Share on other sites More sharing options...
Xtremer360 Posted January 10, 2010 Author Share Posted January 10, 2010 Any other ideas? Link to comment https://forums.phpfreaks.com/topic/187900-not-loading-image/#findComment-992215 Share on other sites More sharing options...
trq Posted January 10, 2010 Share Posted January 10, 2010 Try at least debugging your query. All those variable variables make debugging allot harder too, try replacing them with an associative array instead. Link to comment https://forums.phpfreaks.com/topic/187900-not-loading-image/#findComment-992239 Share on other sites More sharing options...
sasa Posted January 10, 2010 Share Posted January 10, 2010 try to add else part of your if statement if (file_exists("$dirpath$headshot/$posername.jpg")) { if ($iframe == "yes") { print "<a href=$folder/roster.php?username=$username target=_top><img src=$folder$headshot/$posername.jpg border=0 align=left width=".$bioheadwidth." height=".$bioheadheight." hspace=5 vspace=5></img></a>\n"; } else { print "<a href=$folder/bio.php?username=$username target=_top><img src=$folder$headshot/$posername.jpg border=0 align=left width=".$bioheadwidth." height=".$bioheadheight." hspace=5 vspace=0></img></a>\n"; } } else echo "<br />can't find file: $dirpath$headshot/$posername.jpg\<br />\n"; Link to comment https://forums.phpfreaks.com/topic/187900-not-loading-image/#findComment-992243 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.