Retrieve image URL
am 30.04.2007 04:48:14 von ron
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 "
";
Basically have a default icon unless I save a thumbnail and put that
url in the db.
My link code that does work:
echo "
".stripslashes($row["map_url1"]).">".stripslashes($row["url_ name1"])."";
This gonna make me crazy!
thx for any help.
Re: Retrieve image URL
am 30.04.2007 07:34:12 von ron
On Sun, 29 Apr 2007 19:48:14 -0700, Ron 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 "
";
>
>Basically have a default icon unless I save a thumbnail and put that
>url in the db.
>
>My link code that does work:
>echo "
>".stripslashes($row["map_url1"]).">".stripslashes($row["url _name1"])."";
>
>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!
Re: Retrieve image URL
am 30.04.2007 13:48:38 von Captain Paralytic
On 30 Apr, 06:34, Ron wrote:
> On Sun, 29 Apr 2007 19:48:14 -0700, Ron 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 "
";
>
> >Basically have a default icon unless I save a thumbnail and put that
> >url in the db.
>
> >My link code that does work:
> >echo "
> >".stripslashes($row["map_url1"]).">".stripslashes($row["url _name1"])."=
a>=AD";
>
> >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?
Re: Retrieve image URL
am 30.04.2007 15:46:17 von ron
On 30 Apr 2007 04:48:38 -0700, Captain Paralytic
wrote:
>On 30 Apr, 06:34, Ron wrote:
>> On Sun, 29 Apr 2007 19:48:14 -0700, Ron 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 "
";
>>
>> >Basically have a default icon unless I save a thumbnail and put that
>> >url in the db.
>>
>> >My link code that does work:
>> >echo "
>> >".stripslashes($row["map_url1"]).">".stripslashes($row["url _name1"])."";
>>
>> >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
Re: Retrieve image URL
am 30.04.2007 17:06:20 von Captain Paralytic
> wrote:
> >On 30 Apr, 06:34, Ron wrote:
> >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.
It worked because images/image_name.jpg is relative to the address of
the current page and thus inherits the address and directory
information of it. But if the image as on another server, it could be
an https:// or ftp:// or file:// or ... URL.
Re: Retrieve image URL
am 30.04.2007 18:09:45 von ron
On 30 Apr 2007 08:06:20 -0700, Captain Paralytic
wrote:
>> wrote:
>> >On 30 Apr, 06:34, Ron wrote:
>> >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.
>
>It worked because images/image_name.jpg is relative to the address of
>the current page and thus inherits the address and directory
>information of it. But if the image as on another server, it could be
>an https:// or ftp:// or file:// or ... URL.
So is it best to store the entire url? or what you put above?
And do you think the loop in a loop getting the records into an array
and then outputting would work?
I select * from table then:
$num_results = mysql_num_rows($result);
for ($i=0; $i <$num_results; $i++)
{
$row = mysql_fetch_array($result);
echo $row["icon_url"];
rinse and repeat
}
What I want to do is:
for ($i=0; $i <$num_results; $i++)
{
$row = mysql_fetch_array($result);
echo $row["icon_url"];
echo my other fields
READ images/this_record_dir all file names
echo "img src = "images/this_record_dir/image1.jpg abd so on
}
Can this be done?Or when you send the command back to the server it
loses the original array? Or how to store the file names in the db
itself via updateb query or something?
And thx for letting me think
}
Re: Retrieve image URL
am 01.05.2007 02:56:32 von ron
On Mon, 30 Apr 2007 09:09:45 -0700, Ron wrote:
>On 30 Apr 2007 08:06:20 -0700, Captain Paralytic
> wrote:
>
>>> wrote:
>>> >On 30 Apr, 06:34, Ron wrote:
>>> >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.
>>
>>It worked because images/image_name.jpg is relative to the address of
>>the current page and thus inherits the address and directory
>>information of it. But if the image as on another server, it could be
>>an https:// or ftp:// or file:// or ... URL.
>So is it best to store the entire url? or what you put above?
>
>And do you think the loop in a loop getting the records into an array
>and then outputting would work?
>I select * from table then:
>$num_results = mysql_num_rows($result);
>
> for ($i=0; $i <$num_results; $i++)
> {
> $row = mysql_fetch_array($result);
>echo $row["icon_url"];
>rinse and repeat
>}
>
>What I want to do is:
>for ($i=0; $i <$num_results; $i++)
> {
> $row = mysql_fetch_array($result);
>echo $row["icon_url"];
>echo my other fields
>READ images/this_record_dir all file names
>echo "img src = "images/this_record_dir/image1.jpg abd so on
>}
>
>Can this be done?Or when you send the command back to the server it
>loses the original array? Or how to store the file names in the db
>itself via updateb query or something?
>
>And thx for letting me think
>}
I think I am overthing this. Could easily make my layout with all the
tags and cut and past the code into that text field in the db. Tiny
text would probably get me 15 images...
Re: Retrieve image URL
am 01.05.2007 19:19:24 von unknown
Post removed (X-No-Archive: yes)