I hope you can help. I have a program using 2 pages (main.php and resize_image.php) fragments shown below. Each script works fine independenly of each other. My problem comes when I want to pass a value held on my database held in $story[picture] to resize_image.php..... It simply will not transfer the data.
FACTS:
I have done a var_dump($story[picture]);
in main.php and it returns exactly what I am expecting.
In main.php I have used echo "<IMG SRC=\"pictures/1.jpg\">";
. This works correctly as expected.
In main.php when I substitute echo "<IMG SRC=\"pictures/1.jpg\">";
for echo "<IMG SRC=\"resize_image.php?pictures/1.jpg\">";
it does not work
When I say work this means that it displays the picture to the screen. This is the job of resize_image.php
Lastly if I put the following line at the top of resize_image.php$image = "Club_Badge.jpg"; // dummy hard code.
and the following code in main.php echo "<IMG SRC=\"resize_image.php?pictures/1.jpg\">";
I get the script to output the picture called Club_Badge.jpg which is what I expect. Therefore I know the second script (resize_image.php) is being called from main.php.
I hope this all makes sense. I have been hitting my head against a wall with this one and wonder if anyone can help
Many thanks
JPC
It's not where you end. It's where you start from
--------- CODE FOR main.php --------------------
<?php
if (mysql_num_rows($story_result)>0)
{
$story = mysql_fetch_array($story_result);
echo "<TABLE BORDER=0 WIDTH=400>";
echo "<TR>";
echo "<TD ROWSPAN=2 WIDTH=100>";
if($story[picture])
{
$image = $story[picture];
echo "<IMG SRC=\"resize_image.php?pictures/1.jpg\">";
// echo "<IMG SRC=\"resize_image.php?$image\">"; // ultimate goal code
}
}
?>
--------- CODE FOR resize_image.php -------------
<php
if(!$max_width) $max_width = 150;
if(!$max_height) $max_height = 100;
$size = GetImageSize($image);
$width = $size[0];
$height = $size[1];
$x_ratio = $max_width/$width;
$y_ratio = $max_height/$height;
?>