Page 1 of 1

Confused about foward slashes

Posted: Mon Jun 30, 2003 10:33 am
by ddoc
I am getting very confused with the issue of forward slashes in variables. In my application I have something like this, which works fine:

$poo="images/ad/";
$oop="ad1.gif";
for($x=0;$x<=10;$x++)
{
$z=$poo.$oop;
echo "z = ".$z."<br>";
echo "<img src=\"$z\">";
}

When I look at the new variable $z I get a pathname and filename. When I put these into HTML (from with <?php .. ?> ), as ;

echo "<img statement as the src=\"$z\">";

it isn't even echo'd

Can anyone tell me what is wrong ?

Many thanks

Posted: Mon Jun 30, 2003 10:47 am
by Stoker
what does it output?

Posted: Mon Jun 30, 2003 10:51 am
by ddoc
if I make $poo="images/ad";

then concat them together, the <img is recognised and an image holder is created. If $poo="images/ad/"; then nothing gets eco'd at all. So it seems to be the trailing forwards slash that causes the problem.