dailygraphics Posted December 22, 2008 Report Share Posted December 22, 2008 (edited) Good afternoon all, I have a php question about a webpage on my site. I hope I can articulate the question correctly to not cause any confusion. The problem can be found at ***. Once a customer clicks on an image for the first time a page is brought up that has the line, product_info.php?Product_ID=17 The next page, product_info.php is not displayed. When a customer goes back to the product_list.php page and clicks on an image the product_info.php page comes up correctly. This only happens when a new internet session is started. I was just wanting to know if anyone had an idea as to why this is happening. If I need to supply more info please let me know. Thanks in advance for any help on this matter. Edited December 22, 2008 by dailygraphics Quote Link to comment Share on other sites More sharing options...
administrator Posted December 22, 2008 Report Share Posted December 22, 2008 Welcome to the board. You will need to post the relevant php code snippet ... showing us the rendered output of a PHP page is not going to help much. ... That is one reason why I removed your links. Stefan Quote Link to comment Share on other sites More sharing options...
dailygraphics Posted December 23, 2008 Author Report Share Posted December 23, 2008 (edited) Please be patient with me, I'm learning as I go. I'm not sure if this is the correct code snippet you are looking for but here you go. I did validate the page and received the error, I/O Error: Unknown mime type : image/jpeg. I don't understand that though and if it's relevant or not. <? echo $short_desc; ?> <? I hope I've been helpful, if not, let me know. Edited December 23, 2008 by dailygraphics Quote Link to comment Share on other sites More sharing options...
administrator Posted December 24, 2008 Report Share Posted December 24, 2008 I/O Error: Unknown mime type : image/jpeg The error is always relevant! echo $icon_img_link; ?> You can't echo an image. You can echo out an image string ... but not the actual image. Based on the error, I am guessing that somehow the error has to do with you passing/use an image in a bad way with PHP. :/ - It is hard to discern with the code fragments. If you could, in bullet points, tell us what the code is trying to do. Don't write an essay, because people will not read it. Make sure it is in clear easy to read steps. Stefan Quote Link to comment Share on other sites More sharing options...
dailygraphics Posted January 5, 2009 Author Report Share Posted January 5, 2009 (edited) Here is what the code should be doing. - Click on image - Image is linked to next page - Info for the next page is derived from database and displayed to correspond with the image customer chose. That's it. Edited January 5, 2009 by dailygraphics Quote Link to comment Share on other sites More sharing options...
dailygraphics Posted January 6, 2009 Author Report Share Posted January 6, 2009 As far as not being able to echo an image, I'm not sure what you mean. Forgive me if at any time I sound ignorant. For the code snippet, <? echo $icon_img_link; ?>, icon_img_link is the name of the field on my database where the images are stored. There used to be a form with a view items button that the customer clicked to view the items. I wanted the customer to be able to just click the image so I took the button away. Once I added the hyperlink to the image I started having the issue as described above. I guess my ultimate question would be, can I add a hyperlink to a dynamic image? If so, I am willing to do the work if someone would point me in the right direction. Thanks again. Quote Link to comment Share on other sites More sharing options...
dailygraphics Posted January 7, 2009 Author Report Share Posted January 7, 2009 Hi all, I've been looking at this all day again and trying to figure it out. I notice that the initial page that is brought up incorrectly has product_info.php(JPEG Image) as the title. The title should be Product Information. It's displayed correctly of course once going back and clicking the link again. I'm sure this is a simple fix but everything I've read is Greek to me. If anyone has any clue that would be great. Quote Link to comment Share on other sites More sharing options...
falkencreative Posted January 7, 2009 Report Share Posted January 7, 2009 Where is "$short_desc;" set? Additionally, does the URL change at all between the time the page is first viewed, and the second view? Quote Link to comment Share on other sites More sharing options...
dailygraphics Posted January 7, 2009 Author Report Share Posted January 7, 2009 Short_desc is set on the database. On my page I'm viewing in GoLive there is, not sure what it's called, but there's a blue rectangle that has, ?echo?, with the processing instructions, echo $short_desc;. So the various product description are drawn from this one page using our database. As far as the URL, it's displayed the same way both times. Quote Link to comment Share on other sites More sharing options...
sjhwebdesign Posted January 7, 2009 Report Share Posted January 7, 2009 you are using two methods to post link from the list of products to the product info page (a form and also a href with the product id) try: <? echo $short_desc; ?> Quote Link to comment Share on other sites More sharing options...
sjhwebdesign Posted January 7, 2009 Report Share Posted January 7, 2009 then on the product info page: <? $Product_ID = $_POST['Product_ID']; $getproduct = mysql_query("SELECT * FROM yourtable WHERE yourtableid = '$Product_ID'"); while ($product = mysql_fetch_array( $getproduct)) { product details------------------> } ?> Quote Link to comment Share on other sites More sharing options...
dailygraphics Posted January 8, 2009 Author Report Share Posted January 8, 2009 (edited) I hate to ask this question but where do I put the code on the product info page. Also, the images need to be displayed in rows of three instead of 1 column. Thanks for your help. Edited January 8, 2009 by dailygraphics Quote Link to comment Share on other sites More sharing options...
dailygraphics Posted January 13, 2009 Author Report Share Posted January 13, 2009 Can someone please advise me on where to add the code that sjhwebdesign recommended putting on the product_info.php page. I believe that page is causing my problem because I have uploaded old product_list.php pages and they are doing the same thing. Thanks! Quote Link to comment Share on other sites More sharing options...
sjhwebdesign Posted January 15, 2009 Report Share Posted January 15, 2009 PUT THIS PART AT THE TOP OF THE PAGE, THIS GETS THE PRODUCT ID FROM PREVIOUS FORM AND SPECIFIES WHERE TO FIND THE RELATIVE INFO IN YOUR DATA BASE. <? $Product_ID = $_POST['Product_ID']; $getproduct = mysql_query("SELECT * FROM yourtable WHERE yourtableid = '$Product_ID'"); ?> PUT THIS WHERE YOU WANT TO DISPLAY THE RESULTS <? while ($product = mysql_fetch_array( $getproduct)) { product details------------------> THIS IS YOUR RESULTS, IN THE LAYOUT YOUR REQUIRE EG.. ?> <? echo $product['titlefeildindatabase']; ?> ?<? echo $product['pricefeildindatabase']; ?> Paypal add to cart button <? } ?> 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.