|
Posted by J.O. Aho on 10/14/11 11:50
Frankly wrote:
> "J.O. Aho" <user@example.net> wrote in message
>> strawberry wrote:
>>
>>> I'm still not sure that the images bit is flexible enough, but I guess
>>> it's a start.
>> It depends on what would be stored there, if it's with full path to the
>> image, then it may or may not be enough, but if it's just the name of the
>> image (you can hardcode the path, so you don't need to save that in the
>> table), then many digital cameras uses 8.3 (12 character in total) as the
>> name for the image, in this case the 50 would be over kill, but then I
>> don't know what Frankly want to store.
>
> I dont really know what hardcoding the path involves.
Instead of storing "http://example.net/images/IMAGE.JPG" in the database you
may only store te image name "IMAGE.JPG" in the database, then you can query
the image name from the database and concat it with the hardcoded path.
$fullpathofimage="http://example.net/images/" . $row['ImageName'];
> As to what I want to do.
I think it's a good option.
> I would have to ask your opinions on the subject. which would be better for
> me at my skill level lol.
> any recommendations on which way to go would be great.
I would make an include file where I store variables with values for things I
would have fixed, like the path to the images in this example
---- includefile.php ----
<?PHP
$imagepath="http://example.net/images/";
?>
---- eof ----
and then you include that file to all your scripts and you have only one file
where to change the static info.
---- script1.php ----
<?PHP
include_once('includefile.php');
....
?>
<img src="<?PHP echo $imagepath.$imagename; ?>">
....
---- eof ----
I hope you get the picture of what I mean, bit late here so my brain is a bit
slow at the moment.
//Aho
[Back to original message]
|