prajakta29 Posted December 29, 2011 Report Share Posted December 29, 2011 (edited) hie everyone.... i want to display images on word document thru php coding... i have successfully generated the word document evn it is displaying all other data from database except images...it is showing the path on word page instead of image... whats the problem...i have used the same path of images in other applications to display images.... <?php mysql_connect ("abc","web","peter"); mysql_select_db("inmatch"); $requestid=$_GET['requestid']; $clientid=$_GET['clientid']; $query="select RM.RegID,P.Blowup from shortlist MT, registration_male RM,photo P WHERE MT.RequestID='$requestid' AND MT.ClientId=$clientid AND MT.RegID=RM.RegID AND P.RegID=RM.RegID "; $result=mysql_query($query); $str="<table width='50%' border='1' align='center'><tr><td>RegID</td><td>Photo</td></tr>"; while ($row=mysql_fetch_array($result)) {$regid=$row[0]; $blow=$row[1]; if($regid) $objectIndex = "PHT"; $whereclause = " WHERE RegID=".$regid; $otherclause = ""; $fields = "PhotoID, BlowUp, DisplayType, RegID"; //$result_array = _getRows($objectIndex, $fields, $whereclause, $otherclause); $result_array="select ".$fields. "from" .$objectIndex."where" .$whereclause; $blowup_indx = 1; $regid_indx = 3; { for($i=0;$i<count($result_array);$i++) { $photo='<img src=//192.168.0.2/site/inmatch /photographs/ . $result_array[$i][$blowup_indx] >'; $str.="<tr><td>$regid</td><td>$photo</td></tr>"; }}} $str.="</table>"; header("Content-type: application/vnd.ms-word"); header("Content-Disposition: attachment;Filename=shortlisedpics.doc"); echo $str; exit; ?> Edited December 30, 2011 by prajakta29 Quote Link to comment Share on other sites More sharing options...
prajakta29 Posted January 4, 2012 Author Report Share Posted January 4, 2012 hie everyone.... i want to display images on word document thru php coding... i have successfully generated the word document evn it is displaying all other data from database except images...it is showing the path on word page instead of image... whats the problem...i have used the same path of images in other applications to display images.... <?php mysql_connect ("abc","web","peter"); mysql_select_db("inmatch"); $requestid=$_GET['requestid']; $clientid=$_GET['clientid']; $query="select RM.RegID,P.Blowup from shortlist MT, registration_male RM,photo P WHERE MT.RequestID='$requestid' AND MT.ClientId=$clientid AND MT.RegID=RM.RegID AND P.RegID=RM.RegID "; $result=mysql_query($query); $str="<table width='50%' border='1' align='center'><tr><td>RegID</td><td>Photo</td></tr>"; while ($row=mysql_fetch_array($result)) {$regid=$row[0]; $blow=$row[1]; if($regid) $objectIndex = "PHT"; $whereclause = " WHERE RegID=".$regid; $otherclause = ""; $fields = "PhotoID, BlowUp, DisplayType, RegID"; //$result_array = _getRows($objectIndex, $fields, $whereclause, $otherclause); $result_array="select ".$fields. "from" .$objectIndex."where" .$whereclause; $blowup_indx = 1; $regid_indx = 3; { for($i=0;$i<count($result_array);$i++) { $photo='<img src=//192.168.0.2/site/inmatch /photographs/ . $result_array[$i][$blowup_indx] >'; $str.="<tr><td>$regid</td><td>$photo</td></tr>"; }}} $str.="</table>"; header("Content-type: application/vnd.ms-word"); header("Content-Disposition: attachment;Filename=shortlisedpics.doc"); echo $str; exit; ?> plss rep me as soon as possible... Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.