|
Posted by Tom on 05/01/07 17:19
On Mon, 30 Apr 2007 06:46:17 -0700, Ron wrote...
>
>On 30 Apr 2007 04:48:38 -0700, Captain Paralytic
><paul_lautman@yahoo.com> wrote:
>
>>On 30 Apr, 06:34, Ron <nom...@cox.net> wrote:
>>> On Sun, 29 Apr 2007 19:48:14 -0700, Ron <nom...@cox.net> wrote:
>>> >Hi everyone,
>>>
>>> >I have a db that I can't retrieve an image url from. I have retrieved
>>> >a url for a map link but for some reason can't make this work.
>>>
>>> >I use phpmyadmin for my data entry and store my url like
>>> >www.mysite.com/image/image.jpg
>>>
>>> >Should I do it differently? include the http://???
>>> >Here is my code to retrieve picture URL:
>>> >echo "<img src=".stripslashes($row["icon_url"]).">";
>>>
>>> >Basically have a default icon unless I save a thumbnail and put that
>>> >url in the db.
>>>
>>> >My link code that does work:
>>> >echo "<a href=
>>>>".stripslashes($row["map_url1"]).">".stripslashes($row["url_name1"])."</a>";
>>>
>>> >This gonna make me crazy!
>>>
>>> >thx for any help.
>>>
>>> OK,
>>> I made this work.
>>> 1. Make sure the file you are linking to is actually on the server!
>>> 2. Also... Case Sensitive!
>>> 3. Man am I tired.
>>> Tried the link without th http:// and it didn't work.
>>>
>>> Is there a better way than what I have shown?
>>>
>>> thx!- Hide quoted text -
>>>
>>> - Show quoted text -
>>
>>If you don't store the http://, how are you going to know what sort of
>>URL it is?
>Was tired by then so i would include it lthough I did try just
>images/image_name.jpg and it worked fine.
>
>Mostly shrug my shoulders when I finally get something to work :)
>
>Now my challenge is to read file names from a directory and display
>them. This would be within an array. Can that work? Basically might
>have 10 pictures, or 2 or 100. So I think in my record I need to make
>a reference to where the picture for that record are kept. Like images
>for 1937 I could store http://www.mysite.com/images/1937 or maybe just
>images/1937.
>So when my first array is reading the stuff from the DB can I also
>have another array filled with this directory reference for the
>picures? That would be cool.
>
>Thanks
If the path or web server address and directory are constant, it would seem a
waste to have to store "http://www.mysite.com/images/" for each hypertext link
or the same directory name (e.g. '/images') for each entry in your database.
If the graphics are going to be stored in the same place, maybe just store the
file name in the db and print the redundant information. Such as...
echo "<img src=/images/".stripslashes($row["icon_url"]).">";
Tom
--
Newsguy.com
Basic Accounts $5.95 / mo. or $39.95 / yr.
[Back to original message]
|