techker Posted September 22, 2009 Share Posted September 22, 2009 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??? Quote Link to comment https://forums.phpfreaks.com/topic/175094-show-if-yes/ Share on other sites More sharing options...
trq Posted September 22, 2009 Share Posted September 22, 2009 Post your actual code. Quote Link to comment https://forums.phpfreaks.com/topic/175094-show-if-yes/#findComment-922834 Share on other sites More sharing options...
techker Posted September 22, 2009 Author Share Posted September 22, 2009 thats it?it just gets the info in the database and posts it. Quote Link to comment https://forums.phpfreaks.com/topic/175094-show-if-yes/#findComment-922841 Share on other sites More sharing options...
trq Posted September 22, 2009 Share Posted September 22, 2009 That code is far from valid, post your actual code if you want help, we are not mind readers. Quote Link to comment https://forums.phpfreaks.com/topic/175094-show-if-yes/#findComment-922846 Share on other sites More sharing options...
techker Posted September 22, 2009 Author Share Posted September 22, 2009 <? 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. Quote Link to comment https://forums.phpfreaks.com/topic/175094-show-if-yes/#findComment-922849 Share on other sites More sharing options...
trq Posted September 22, 2009 Share Posted September 22, 2009 Is your domain really link ? Quote Link to comment https://forums.phpfreaks.com/topic/175094-show-if-yes/#findComment-922851 Share on other sites More sharing options...
techker Posted September 22, 2009 Author Share Posted September 22, 2009 no..i removed it cause it is not online yet. Quote Link to comment https://forums.phpfreaks.com/topic/175094-show-if-yes/#findComment-922853 Share on other sites More sharing options...
trq Posted September 22, 2009 Share Posted September 22, 2009 Ok, after re-reading your post I'm lost. A pdf, isn't an image, why are you seeing a broken image icon? Again, I suggest you post your actual code. This time with a decent description of what you expect, and what you are getting. Quote Link to comment https://forums.phpfreaks.com/topic/175094-show-if-yes/#findComment-922867 Share on other sites More sharing options...
kickstart Posted September 22, 2009 Share Posted September 22, 2009 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 Quote Link to comment https://forums.phpfreaks.com/topic/175094-show-if-yes/#findComment-922880 Share on other sites More sharing options...
techker Posted September 22, 2009 Author Share Posted September 22, 2009 that can be it.( 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.. like i said if i view source i can see that the link is good. Quote Link to comment https://forums.phpfreaks.com/topic/175094-show-if-yes/#findComment-922889 Share on other sites More sharing options...
trq Posted September 22, 2009 Share Posted September 22, 2009 pdfs do not simply show in place like images do, they need to be opened in a new page (by a pdf browser plugin) or downloaded. Quote Link to comment https://forums.phpfreaks.com/topic/175094-show-if-yes/#findComment-922891 Share on other sites More sharing options...
kickstart Posted September 22, 2009 Share Posted September 22, 2009 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 Quote Link to comment https://forums.phpfreaks.com/topic/175094-show-if-yes/#findComment-922897 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.