Jump to content
Killersites Forums

display images on word document


prajakta29
 Share

Recommended Posts

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 by prajakta29
Link to comment
Share on other sites

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...

Link to comment
Share on other sites

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.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Loading...
 Share

×
×
  • Create New...