Friday, February 25, 2011

how to read from weighbridge using php ?

am trying to get an image file to display in an email, the file is stored on the server but it will not send the file with the email. i have been working on this code now for a few days and i cannot get it to work.

the files that i need displaying change so i have incorporated an array to get the file extension, the email is sent with all the text and images which have been coded in using the absolute file path but the images i want to get from the if file exists function will no show.

here is the code for the file exist if anyone can see why this is not working please show me.

PHP Syntax (Toggle Plain Text)

1.
$image = "";
2.
$web_image_folder = 'http://www.acmeart.co.uk/mercury/image/thumbs';
3.
$exts = array('jpg', 'png', 'gif', 'jpeg');
4.
$image_name = 'thumb_image1';
5.

6.

7.
// check for each extension
8.
foreach($exts as $ext) {
9.
if (file_exists($web_image_folder.'/'.$image_name.'.'.$ext)) {
10.
$image = $image_name.'.'.$ext;
11.
}
12.
}
13.

14.
// check if we have an image
15.
if ($image != "") {
16.
// ok we have the image
17.
$broad_img1='';
18.
} else {
19.
// error, we can't find the image.
20.
}

1 comment:

  1. wide range of Electronic Weigh Bridges, Weighing Scales, Weighbridge machines, Portable Weighbridges, Mobile Weighbridges and all kind of Electronic Weighbridge Manufacturers in India
    View more Weighbridges exporters
    weighbridge
    mobile weighbridge exporters
    weighbridge suppliers

    ReplyDelete