Jump to content

Recommended Posts

Hey guys i have a prob showing a pdf file?

 

its funny cause i  can't seem to show the pdf file but if i fallow the link it is good?

 

does php prevent pdf?

 

here is what im talking about.

 

so i have an admin panel to upload the specials of the month in pdf format.

 

so i put a button on my index page and it opens up a query page:


$q3 = "SELECT * 
FROM  `promo_site` 
WHERE  `current` =  'YES'
LIMIT 0 , 30";
$res3 = mysql_query($q3);
$row3 = mysql_fetch_assoc($res3);

cause he can select in the admin if it is a current promo or not(list box yes or no)

php on the page
<a href="http://l.....link/GYMSOFT/resources/PROMO/<?php echo $row3['doc'] ?>

so it should show the doc in the directory,but all i see is a broken image icon?and if i view the source i can see the link is perfect,caopy and paste it in a difrent window and it works???

 

Link to comment
https://forums.phpfreaks.com/topic/175094-show-if-yes/
Share on other sites

<? mysql_connect("localhost", "svvvvr", "tecvvvvr") or die(mysql_error()) ;
mysql_select_db("v") or die(mysql_error()) ;



$q3 = "SELECT * 
FROM  `promo_site` 
WHERE  `current` =  'YES'
LIMIT 0 , 30";
$res3 = mysql_query($q3);
$row3 = mysql_fetch_assoc($res3);



?>


<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>Untitled Document</title>
</head>

<body>
<table width="239" border="0">
  <tr>
    <td width="233"><a href="http://link/resources/PROMO/<?php echo $row3['doc'] ?>"><img src="images/logo_banner_promo.jpg" width="236" height="173" /></a>
    
    </td>
  </tr>
</table>
</body>
</html>

 

this is with a link on image.cause i had to link it to the doc so it can work..

or

echo '<img src="/link/'. $row3['doc'] .'" border="0" alt="" width=130/>

 

<br />'; this only showed a broken image icon..

 

the doc in databse hase the full name included the extension.

Link to comment
https://forums.phpfreaks.com/topic/175094-show-if-yes/#findComment-922849
Share on other sites

Hi

 

Minor issue. Missing semi colon. Not sure it is the problem but it won't help.

 

<td width="233"><a href="http://link/resources/PROMO/<?php echo $row3['doc']; ?>"><img src="images/logo_banner_promo.jpg" width="236" height="173" /></a>

 

All the best

 

Keith

Link to comment
https://forums.phpfreaks.com/topic/175094-show-if-yes/#findComment-922880
Share on other sites

see it is a broken link maybe the icon.

 

it is showing that cause the pdf does not show.its like if the pdf and php echo don't mix..

 

Replace the link icon with just some text for now. Eliminates that from being the issue.

 

Php doesn't care that it is a pdf. As far as php is concerned it is just some text which it is echoing out.

 

All the best

 

Keith

Link to comment
https://forums.phpfreaks.com/topic/175094-show-if-yes/#findComment-922897
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  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.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.