Forum Moderators: coopster

Message Too Old, No Replies

Adding path name in PHP echo statment

         

gordon

6:47 pm on Feb 27, 2004 (gmt 0)

10+ Year Member



What I am trying to accomplish is to have the file path added to the name of my image In my database in my DreamWeaver code so I don't have to type the file path for every single image in the database.

I have a field 'thumb' in which I will store the names of my imgaes. Of course for the images to display I need to include the file path.

If my file path was photo/family/ is there away to append it to the statement below.

<?php echo $row_rsengine['thumb'];?>

If not then for every image in my database I would have to type
/photo/family/imagename.jpg

It would be better if I could just type
imagename.jpg in MySQL and add then include the file path in the code in DreamWeaver

Yes, I am new to this. To help me learn PHP and dynamic sites with Dreamweaver I am working on a test project of an inventory of my Dad's HO train
collection.

Any suggestions would be appreciated.

jatar_k

6:59 pm on Feb 27, 2004 (gmt 0)

WebmasterWorld Administrator 10+ Year Member



If you use a config file or an included header on every page you could always define it in there.

$imgpath = "/photo/family/";

then your images could be

<?= $imgpath . $row_rsengine['thumb'];?>