add string to image field view

This public forum is for user-to-user discussions of PHPMaker. Note that this is not support forum.
Post Reply
meetmec12
User
Posts: 13

add string to image field view

Post by meetmec12 »

Hello , i have a table with upload image path. eg 123pics.jpg i need to add my site domain name before it can be viewed . The table was populated from a different php script . I tried adding the upload path in phpmaker but couldn't solve it.

i echoed images from my own script this way:

echo "<td>" ."<img src='mydomain name/uploads/".$row['pics']."' class='preview' style='width:50px;height:50px;'>". "</td>";

my $row['pics'] is stored in database as 123pics.jpg but i need my domain name/uploads added to display image in php maker script. i hope this explains my situation better.

Any help will be appreciated (am on PHPMKR10)


meetmec12
User
Posts: 13

Post by meetmec12 »

I was able to solve this. i edit the generated code on my pics field _picsview.php
<?php if (!ew_EmptyStr($image->pics->ViewValue)) { ?><img src="<?php echo $image->pics->ViewValue ?>" alt="" style="border: 0;"<?php echo $image->pics->ViewAttributes() ?>><?php } ?></span>

by adding the domain name before echoing the db value <img src="<?php echo"mydomainname/uplooads/". $image->pics->ViewValue ?>


Post Reply