The code you wrote will indeed work, if you have it withing the php tags, as in
PHP Code:
<?php $title = "XYZ"; echo "<img src=\"$title/$title.jpg\">"; // Notic I have to escape the quotes inside the string ?>
And since you're new to php it may not be obvious, but you can insert php code anywhere in the document, for example by doing this
PHP Code:
<?php $title = "XYZ"; echo "<title>$title</title>"; ?> </head> <body> <p>Some html code here...</p> <p>And then the image</p> <?php echo "<img src=\"$title/$title.jpg\">"; ?> </body> </html>
__________________
Your answers will only be as good as your question. Formulate it well and give all the necessary information.
|