OZONE Asylum
Forums
Server-Side Scripting - Oh my!
DIRECTORY_SEPARATOR HELP!
This page's ID:
31035
Search
QuickChanges
Forums
FAQ
Archives
Register
Edit Post
Who can edit a post?
The poster and administrators may edit a post. The poster can only edit it for a short while after the initial post.
Your User Name:
Your Password:
Login Options:
Remember Me On This Computer
Your Text:
Insert Slimies »
Insert UBB Code »
Close
Last Tag
|
All Tags
UBB Help
My code is as follows 1. Define the directory separator as DS constant [code]defined('DS') ? null : define('DS', DIRECTORY_SEPARATOR); [/code] 2. then i use this method on the photographs class [code] public function image_path(){ return $this->upload_dir.DS.$this->filename; } [/code] i have a protected attribute for my photograph class this is called: [code] protected $upload_dir = "images";[/code] 3. i loop through the pictures and attributes in this table [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] but the picture file link is broken and give me this in the source code for the picture location [code]<img src="../images\oday.png" width="100" />[/code] im guess that the DS is not giving me the right directory separator what am i doing wrong please help. Thank you in advanc
Loading...
Options:
Enable Slimies
Enable Linkwords
« Backwards
—
Onwards »
Maximum Security
OZONE
DHTML/Javascript
Server-Side Scripting - Oh my!
CSS - DOM - XHTML - XML - XSL - XSLT
Stupid Basic HTML
Visual Therapy
Photoshop
Photoshop Pong, Anyone?
***WARNING*** BIG SIG APPROACHING
Photography
3D Modelling & Rendering
Multimedia/Animation
Print Graphics
Holding Pens
Philosophy and other Silliness
Outpatient Counseling
Site reviews!
Mad Scientists' Laboratory
Getting to know the Grail