Hi guys
trying to echo the id which is stored in $field6
but when the x image displays and i press properties it says that there is no id being calledPHP Code:echo"<img src=image.php?id='$field6'>";
many thanks in advance for your help
| SitePoint Sponsor |




Hi guys
trying to echo the id which is stored in $field6
but when the x image displays and i press properties it says that there is no id being calledPHP Code:echo"<img src=image.php?id='$field6'>";
many thanks in advance for your help




that didnt work
Well, that should pass $field6 to your image.php file. What's in your image.php file? Did you try to
? What's the value of $field6?PHP Code:echo $_GET['id'];
Neanderthal Technology




$field6 is the id of the image
if i write it like this
echo "<img src=image.php?id=18>";
then it works fine
but I need to replace the value of 18 with field6
how would line be written with echo $_GET['id'];
Alternatively, you could try
but that shouldn't make much of a difference.PHP Code:echo '<img src="image.php?id='.$field6.'" alt="" />';
Are you sure $field6 is set properly?
Above the echo line, add
If that works then something goes wrong when assigning the value to $field6..PHP Code:$field6 = '18';
Neanderthal Technology
Are you calling this from a database or is this a variable set earlier in the page?
In any case, when using a variable, you have to echo/print it:
PHP Code:echo "<img src=\"image.php?id=$field\" alt=\"\" />";
// Or
echo "<img src=\"image.php?id=".$field."\" alt=\"\" />";




Fixed it guys
thanks
Bookmarks