Re: Re: Displaying images

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 





On 5/28/09 2:09 PM, "Bastien Koert" <phpster@xxxxxxxxx> wrote:



On Thu, May 28, 2009 at 3:06 PM, Miller, Terion <tmiller@xxxxxxxxxxxxxxxxxxxx> wrote:



Well I have tried Numerous scripts and ways and still can't get the image to display.

I have echoed the file and have been able to get the gibberish image code to display but not a real image, here is my full code if anyone wants to have a look, I am going crossed eyed here.





These are just a few of the ways I have been trying to get the img tag to work on my output.php page:

       <tr>            <td>Scout Photo:</td>              <td>              <a href="image.php?filename=<?php echo$row['photoName']; ?>"><?php echo$row['photoName']; ?></A><br>                            <?php echo "\n<br>Scout Photo : "."<img src=\image.php?filename=" .$row['photoName']. "\">"; ?>                                          <?php echo "<img src=\"image.php?filename=".$row['photoName']."\">\n"; ?>                            <?php echo "<img src=\"image.php?id=".$row['ePID']."\">\n"; ?>                            <img src="image2.php?filename=<?php echo $row['photoName']; ?>">


Here is one way I was trying to get to work for the image.php page where the headers are supposed to work and don't

include("inc/dbconn_open.php");
error_reporting(E_ALL);


//if (isset($_FILES['ePhoto'])){$ePhoto = $_FILES['ePhoto'];} else {$ePhoto ="";}

$filename = $_GET['$filename'];

$image = stripslashes($_REQUEST[photoName]);

$sql = "SELECT ePhoto, photoName, photoType from eagleProjects WHERE photoName = $filename";
$result=mysql_query($sql);
$data = mysql_fetch_array ($result);



$type = $data['photoType'];
$name = $data['photoName'];

  header("Content-type: $type");
  header("Content-Disposition: attachment; filename=$name");


echo $data["photoName"];
echo $data["ePhoto"];

exit;

Terin,

I just gave the same code to another person on another forum and he had no issues getting that to work. If it does not work, you will need to ensure that the value you pass to the show_image file is the same value that you are using to look up the image. So if its an id number make sure you are using the same id field to look up the image.

Hi Bastien,
I am using the ID to call the image any other ideas...

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



[Index of Archives]     [PHP Home]     [Apache Users]     [PHP on Windows]     [Kernel Newbies]     [PHP Install]     [PHP Classes]     [Pear]     [Postgresql]     [Postgresql PHP]     [PHP on Windows]     [PHP Database Programming]     [PHP SOAP]

  Powered by Linux