![]() Topic awaiting preservation: DIRECTORY_SEPARATOR HELP! (Page 1 of 1) |
|
|---|---|
|
Bipolar (III) Inmate From: |
posted 06-07-2009 03:03
My code is as follows code: defined('DS') ? null : define('DS', DIRECTORY_SEPARATOR);
code: public function image_path(){
return $this->upload_dir.DS.$this->filename;
}
code: protected $upload_dir = "images";
code: <table class="bordered">
<tr>
<th>Image</th>
<th>Filename</th>
<th>Caption</th>
<th>Size</th>
<th>Type</th>
</tr>
<?php echo DS ?>
<?php foreach($photos as $photo): ?>
<tr>
<td><img src="../<?php echo $photo->image_path(); ?>" width="100" /></td>
<td><?php echo $photo->filename; ?></td>
<td><?php echo $photo->caption; ?></td>
<td><?php echo $photo->size; ?></td>
<td><?php echo $photo->type; ?></td>
</tr>
<?php endforeach; ?>
</table>
code: <img src="../images\oday.png" width="100" />
|
|
Lunatic (VI) Inmate From: under the bed |
posted 06-07-2009 06:31
perhaps relevant: http://old.alanhogan.com/tips/php/directory-separator-not-necessary |
|
Bipolar (III) Inmate From: |
posted 06-07-2009 14:26
Thank you DL-44 |
|
Neurotic (0) Inmate Newly admitted From: |
posted 01-09-2010 04:03
quote:
|
|
Bipolar (III) Inmate From: |
posted 01-15-2010 04:03
oh sorry i didnt put it.. i have a mac now so the code works just fine.. but i just defined the directory separator like this code: define('DS', "/")
|