Skip to main content
Inspiring
April 18, 2006
Question

"InnerHTML" in PHP?

  • April 18, 2006
  • 27 replies
  • 2656 views
How would I use PHP to copy the filename into the alt attribute? For
example,

<img
src="a-really-long-filename-that-I-also-want-to-use-without-hyphens.jpg"
alt="<?php echo("WHATTHEHECKGOESHERE?"); ?>">

--
Murray --- ICQ 71997575
Adobe Community Expert
(If you *MUST* email me, don't LAUGH when you do so!)
==================
http://www.dreamweavermx-templates.com - Template Triage!
http://www.projectseven.com/go - DW FAQs, Tutorials & Resources
http://www.dwfaq.com - DW FAQs, Tutorials & Resources
http://www.macromedia.com/support/search/ - Macromedia (MM) Technotes
==================



This topic has been closed for replies.

27 replies

Inspiring
April 20, 2006
> The one coming from PVII is rather tasty....

I like that too, but that's really a full on database app.

Acutally, while my tool can be used as a photo gallery, it's really focused
on being a portfolio management tool for artists/designers. So maybe not
quite what you are looking for anyways.

I think things like PVII and Gallery and Flickr are great for mass
uploading/sharing of pics.

-Darrel


Inspiring
April 19, 2006
> Really? Know of any good ones?

The one coming from PVII is rather tasty....

--
Murray --- ICQ 71997575
Adobe Community Expert
(If you *MUST* email me, don't LAUGH when you do so!)
==================
http://www.dreamweavermx-templates.com - Template Triage!
http://www.projectseven.com/go - DW FAQs, Tutorials & Resources
http://www.dwfaq.com - DW FAQs, Tutorials & Resources
http://www.macromedia.com/support/search/ - Macromedia (MM) Technotes
==================


"darrel" <notreal@nowhere.com> wrote in message
news:e264np$k09$1@forums.macromedia.com...
>
>>> If you can hold off for a few weeks, I might have a solution for
>>> you...(I'm working on a database driven photo gallery application)
>
> Really? Know of any good ones? I'm doing it mainly because I didn't find
> any good ones. I don't want to reinvent the wheel, either, though.
>
>>> Otherwise, maybe look at Gallery or some other system
>>
>> Where is this?
>
> http://gallery.menalto.com/
>
> -Darrel
>


Inspiring
April 19, 2006

>> If you can hold off for a few weeks, I might have a solution for
>> you...(I'm working on a database driven photo gallery application)

Really? Know of any good ones? I'm doing it mainly because I didn't find any
good ones. I don't want to reinvent the wheel, either, though.

>> Otherwise, maybe look at Gallery or some other system
>
> Where is this?

http://gallery.menalto.com/

-Darrel


Inspiring
April 19, 2006
Me either.... 8)

--
Murray --- ICQ 71997575
Adobe Community Expert
(If you *MUST* email me, don't LAUGH when you do so!)
==================
http://www.dreamweavermx-templates.com - Template Triage!
http://www.projectseven.com/go - DW FAQs, Tutorials & Resources
http://www.dwfaq.com - DW FAQs, Tutorials & Resources
http://www.macromedia.com/support/search/ - Macromedia (MM) Technotes
==================


"crash" <crash@bcdcdigital.com> wrote in message
news:e2613j$ff5$1@forums.macromedia.com...
> Sounds like the ticket. good luck. i wouldn't want to spot-check that.
>
>> Imagine a page with 400 images referenced. Each image has a filename
>> with hyphens. Each image has an empty alt attribute (or even one with
>> the hyphenated filename). I suppose I could concoct a RegExp that would
>> only scan for hyphens in the alt attribute and replace them with spaces,
>> no?
>>
>> --
>> Murray --- ICQ 71997575
>
>


Inspiring
April 19, 2006
Sounds like the ticket. good luck. i wouldn't want to spot-check that.

> Imagine a page with 400 images referenced. Each image has a filename with
> hyphens. Each image has an empty alt attribute (or even one with the
> hyphenated filename). I suppose I could concoct a RegExp that would only
> scan for hyphens in the alt attribute and replace them with spaces, no?
>
> --
> Murray --- ICQ 71997575


Inspiring
April 19, 2006
Yeah - I'm thinking a regexp F&R is the way to do it.

--
Murray --- ICQ 71997575
Adobe Community Expert
(If you *MUST* email me, don't LAUGH when you do so!)
==================
http://www.dreamweavermx-templates.com - Template Triage!
http://www.projectseven.com/go - DW FAQs, Tutorials & Resources
http://www.dwfaq.com - DW FAQs, Tutorials & Resources
http://www.macromedia.com/support/search/ - Macromedia (MM) Technotes
==================


"Tom Muck" <tommuck@NOSPAM.basic-drumbeat.com> wrote in message
news:e25mm3$1q1$1@forums.macromedia.com...
>> Here's the deal: I'm making a photo gallery for my brother. He has
>> hundreds, nay thousands, of images taken all over the world (as a
>> professional wildlife photographer). He gives me the images with names
>> as I indicated earlier (words and keywords separated by hyphens).
>>
>> I am using an app that can display the alt attribute's value as a photo
>> caption. This would be why I am asking these goofy questions - to
>> automatically transfer the filename to the alt attribute, and to strip
>> out the hyphens. But I think a stake has been driven through this one's
>> heart by the comment that dynamically written content like that is not
>> 'on the page'. So - I'm back to the drawing board.
>>
>> What's that you say? Why don't I use a database? That would, of course,
>> be the obvious solution. But his data is not in a form that lends itself
>> to that approach at this moment! 8(
>
> Obviously a database is best, but I don't see where the problem is here.
> If this is a dynamic application, you can write the titles/alt tags when
> you write the src attributes. If this is a static site, you can do a
> find/replace and put the src attribute into the alt attribute (changing
> your hyphens to spaces at the same time.) Either way you don't need the
> JS.
>
>
> --
> --
> Tom Muck
> co-author Dreamweaver MX 2004: The Complete Reference
> http://www.tom-muck.com/
>
> Cartweaver Development Team
> http://www.cartweaver.com
>
> Extending Knowledge Daily
> http://www.communitymx.com/
>
>
>


Inspiring
April 19, 2006
> Any chance you can modify the app to use the TITLE attribute?
>

No. I'm not concerned about accessibility here.

> If you can hold off for a few weeks, I might have a solution for
> you...(I'm working on a database driven photo gallery application)

Seems that everyone and their nephew is working on one nowadays! 8)

> Otherwise, maybe look at Gallery or some other system

Where is this?

--
Murray --- ICQ 71997575
Adobe Community Expert
(If you *MUST* email me, don't LAUGH when you do so!)
==================
http://www.dreamweavermx-templates.com - Template Triage!
http://www.projectseven.com/go - DW FAQs, Tutorials & Resources
http://www.dwfaq.com - DW FAQs, Tutorials & Resources
http://www.macromedia.com/support/search/ - Macromedia (MM) Technotes
==================


"darrel" <notreal@nowhere.com> wrote in message
news:e25ecu$jjk$1@forums.macromedia.com...
>> I am using an app that can display the alt attribute's value as a photo
>> caption.
>
> Ewww...
>
> Any chance you can modify the app to use the TITLE attribute?
>
>> What's that you say? Why don't I use a database? That would, of course,
>> be the obvious solution. But his data is not in a form that lends itself
>> to that approach at this moment! 8(
>
> If you can hold off for a few weeks, I might have a solution for
> you...(I'm working on a database driven photo gallery application)
>
> Otherwise, maybe look at Gallery or some other system that your brother
> could upload the images to himself (thereby taking you out of the loop ;o)
>
> -Darrel
>


Inspiring
April 19, 2006
Imagine a page with 400 images referenced. Each image has a filename with
hyphens. Each image has an empty alt attribute (or even one with the
hyphenated filename). I suppose I could concoct a RegExp that would only
scan for hyphens in the alt attribute and replace them with spaces, no?

--
Murray --- ICQ 71997575
Adobe Community Expert
(If you *MUST* email me, don't LAUGH when you do so!)
==================
http://www.dreamweavermx-templates.com - Template Triage!
http://www.projectseven.com/go - DW FAQs, Tutorials & Resources
http://www.dwfaq.com - DW FAQs, Tutorials & Resources
http://www.macromedia.com/support/search/ - Macromedia (MM) Technotes
==================


"crash" <crash@bcdcdigital.com> wrote in message
news:e25nf8$2uf$1@forums.macromedia.com...
>I agree with Tom. Is there some reason this can't be a dynamic site (ie,
>not necessarily drawing data from a database, but changing content from the
>server)? From your post title it doesn't appear to be.
>
> Or is it the "on the page" that has you stopped? If this is the case, why
> not write a PHP script that will alter the file itself on the server.
> Publish the page - run a script - have your alt tags? Of course, a DW
> solution would probably be more fitting in this case - but could not
> change already constructed pages.
>
> Jon
>
> "Tom Muck" <tommuck@NOSPAM.basic-drumbeat.com> wrote in message
> news:e25mm3$1q1$1@forums.macromedia.com...
>>> Here's the deal: I'm making a photo gallery for my brother. He has
>>> hundreds, nay thousands, of images taken all over the world (as a
>>> professional wildlife photographer). He gives me the images with names
>>> as I indicated earlier (words and keywords separated by hyphens).
>>>
>>> I am using an app that can display the alt attribute's value as a photo
>>> caption. This would be why I am asking these goofy questions - to
>>> automatically transfer the filename to the alt attribute, and to strip
>>> out the hyphens. But I think a stake has been driven through this one's
>>> heart by the comment that dynamically written content like that is not
>>> 'on the page'. So - I'm back to the drawing board.
>>>
>>> What's that you say? Why don't I use a database? That would, of
>>> course, be the obvious solution. But his data is not in a form that
>>> lends itself to that approach at this moment! 8(
>>
>> Obviously a database is best, but I don't see where the problem is here.
>> If this is a dynamic application, you can write the titles/alt tags when
>> you write the src attributes. If this is a static site, you can do a
>> find/replace and put the src attribute into the alt attribute (changing
>> your hyphens to spaces at the same time.) Either way you don't need the
>> JS.
>>
>>
>> --
>> --
>> Tom Muck
>> co-author Dreamweaver MX 2004: The Complete Reference
>> http://www.tom-muck.com/
>>
>> Cartweaver Development Team
>> http://www.cartweaver.com
>>
>> Extending Knowledge Daily
>> http://www.communitymx.com/
>>
>>
>>
>
>


Inspiring
April 19, 2006
I agree with Tom. Is there some reason this can't be a dynamic site (ie,
not necessarily drawing data from a database, but changing content from the
server)? From your post title it doesn't appear to be.

Or is it the "on the page" that has you stopped? If this is the case, why
not write a PHP script that will alter the file itself on the server.
Publish the page - run a script - have your alt tags? Of course, a DW
solution would probably be more fitting in this case - but could not change
already constructed pages.

Jon

"Tom Muck" <tommuck@NOSPAM.basic-drumbeat.com> wrote in message
news:e25mm3$1q1$1@forums.macromedia.com...
>> Here's the deal: I'm making a photo gallery for my brother. He has
>> hundreds, nay thousands, of images taken all over the world (as a
>> professional wildlife photographer). He gives me the images with names
>> as I indicated earlier (words and keywords separated by hyphens).
>>
>> I am using an app that can display the alt attribute's value as a photo
>> caption. This would be why I am asking these goofy questions - to
>> automatically transfer the filename to the alt attribute, and to strip
>> out the hyphens. But I think a stake has been driven through this one's
>> heart by the comment that dynamically written content like that is not
>> 'on the page'. So - I'm back to the drawing board.
>>
>> What's that you say? Why don't I use a database? That would, of course,
>> be the obvious solution. But his data is not in a form that lends itself
>> to that approach at this moment! 8(
>
> Obviously a database is best, but I don't see where the problem is here.
> If this is a dynamic application, you can write the titles/alt tags when
> you write the src attributes. If this is a static site, you can do a
> find/replace and put the src attribute into the alt attribute (changing
> your hyphens to spaces at the same time.) Either way you don't need the
> JS.
>
>
> --
> --
> Tom Muck
> co-author Dreamweaver MX 2004: The Complete Reference
> http://www.tom-muck.com/
>
> Cartweaver Development Team
> http://www.cartweaver.com
>
> Extending Knowledge Daily
> http://www.communitymx.com/
>
>
>


Inspiring
April 19, 2006
> Here's the deal: I'm making a photo gallery for my brother. He has
> hundreds, nay thousands, of images taken all over the world (as a
> professional wildlife photographer). He gives me the images with names as
> I indicated earlier (words and keywords separated by hyphens).
>
> I am using an app that can display the alt attribute's value as a photo
> caption. This would be why I am asking these goofy questions - to
> automatically transfer the filename to the alt attribute, and to strip out
> the hyphens. But I think a stake has been driven through this one's heart
> by the comment that dynamically written content like that is not 'on the
> page'. So - I'm back to the drawing board.
>
> What's that you say? Why don't I use a database? That would, of course,
> be the obvious solution. But his data is not in a form that lends itself
> to that approach at this moment! 8(

Obviously a database is best, but I don't see where the problem is here. If
this is a dynamic application, you can write the titles/alt tags when you
write the src attributes. If this is a static site, you can do a
find/replace and put the src attribute into the alt attribute (changing your
hyphens to spaces at the same time.) Either way you don't need the JS.


--
--
Tom Muck
co-author Dreamweaver MX 2004: The Complete Reference
http://www.tom-muck.com/

Cartweaver Development Team
http://www.cartweaver.com

Extending Knowledge Daily
http://www.communitymx.com/