kate_rose Posted June 24, 2008 Share Posted June 24, 2008 Hi again, I have a series of web pages & I am using SESSION variables to pass values from one to another. I am trying to use one to display an image with the following code: <!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> <style type="text/css"> #wrapper{ position: absolute top: 0px; left: 0px; margin: 0px; padding: 0px; border: 0px; background-color: #669999; width: 1000; height: 410px; overflow: visible; } #navigation { position: absolute; top: 420px; left: 0px; margin: 0px; padding: 0px; border: 0px; background:#C96; height: 40px; width: 100px; overflow: hidden; } </style> <body> <div id="wrapper"> <?php $imagepath = $_SESSION['image_path']; echo "<img src=\"$imagepath\"/>"; echo "<p> ljljlkjlj </p>"; ?> <img src=" <div id="navigation"> <form action="browser.php" method="post"> <input type="submit" name="show" value="escape"> <input type="submit" name="show" value="previous"> <input type="submit" name="show" value="next"> </form> </div> </div> </body> </html> The SESSION 'image_path' definitely has a value in it because I made it reload & echo it on the previous page to check. The echo <img etc. has worked just fine when tested on another page that contained no html or css. The paragraph <p> below the image display which is just for testing is displaying just fine. I also just tried displaying the same pic from outside the php code tags & it worked fine though I did use the actually imagepath & not the SESSION variable. I just can't figure out why its not working. Any thoughts? Thanks, Kate Link to comment https://forums.phpfreaks.com/topic/111698-solved-image-display-not-working-php-imbedded-in-html-with-css/ Share on other sites More sharing options...
dmccabe Posted June 24, 2008 Share Posted June 24, 2008 if you take it outside the DIV and just do: echo $imagepath; echo "<img src='$imagepath'>"; What do you get? Link to comment https://forums.phpfreaks.com/topic/111698-solved-image-display-not-working-php-imbedded-in-html-with-css/#findComment-573310 Share on other sites More sharing options...
nashruddin Posted June 24, 2008 Share Posted June 24, 2008 add this line at the top of your HTML: <?php session_start(); ?> Link to comment https://forums.phpfreaks.com/topic/111698-solved-image-display-not-working-php-imbedded-in-html-with-css/#findComment-573317 Share on other sites More sharing options...
kate_rose Posted June 24, 2008 Author Share Posted June 24, 2008 Thanks Nash, I figured it was something simple that I was just missing . K- Link to comment https://forums.phpfreaks.com/topic/111698-solved-image-display-not-working-php-imbedded-in-html-with-css/#findComment-573320 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.