Exit
  • Global community
    • Language:
      • Deutsch
      • English
      • Español
      • Français
      • Português
  • 日本語コミュニティ
  • 한국 커뮤니티
0

Constructing MYSQL DB/PHP: Image question

LEGEND ,
Nov 07, 2007 Nov 07, 2007
Hello all,

I have two of David Powers' books and I'm getting better by the day at
PHP and MYSQL. However, I am stuck in the planning phase of a new
website and I'm wondering if someone could give me "I'd do it this way"
pointers.

I have a DB set up for news articles, and these news articles are
generally about events that have taken place. Photos are taken of these
events, and are all different sizes and aspect ratios.

What I'd like to be able to do is have an Admin page on a CMS that
allows for not only the insertion of a headline/subhead/body, but also
an image. I'd like the image to be uploaded to the website (not the DB,
which is hosted on a different server), with a link automatically
generated so that when the detail page is called from the master page,
the image shows up in a div that I have constructed for the detail page.
Also, if there's not an image available for the event, I'd like the page
to display correctly without showing a broken image icon.

How would I go about planning for this, and do I need an extension that
performs the PHP upload, etc? I've seen some out on the web from some
different sites, but I'm at the point where I know that "I don't know
what I don't know" about this subject and I'm not sure of the correct
questions to ask.

Thank you anyone for any pointers you can give me.

-John
TOPICS
Server side applications
301
Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
LEGEND ,
Nov 07, 2007 Nov 07, 2007
John R. Lenz wrote:
> I have two of David Powers' books

Only two? ;-)

> What I'd like to be able to do is have an Admin page on a CMS that
> allows for not only the insertion of a headline/subhead/body, but also
> an image. I'd like the image to be uploaded to the website (not the DB,
> which is hosted on a different server)

You can either hand-code the image upload (there are details in "PHP
Solutions"), or get an extension to handle it for you. I've not used any
of the extensions, so can't comment on how good/bad they are.

> Also, if there's not an image available for the event, I'd like the page
> to display correctly without showing a broken image icon.

That's a simple if... else condition.

if (!empty($row_recordsetName['image'])) {
// display the image
}

--
David Powers, Adobe Community Expert
Author, "The Essential Guide to Dreamweaver CS3" (friends of ED)
Author, "PHP Solutions" (friends of ED)
http://foundationphp.com/
Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
LEGEND ,
Nov 07, 2007 Nov 07, 2007

"David Powers" <david@example.com> wrote in message
news:fgssap$3fv$1@forums.macromedia.com...

> I've not used any of the extensions, so can't comment on how good/bad
> they are.

I've used DMXzone's PureASP upload - I presume their PHP upload extension is
similar. It's pretty good and I like the ability to limit which types of
files can be uploaded. I've used WebAssist's Digital File Pro upload
extension - I find it a lot less user-friendly than DMX' and there's no
ability to restrict file type (except that it be an image format).


Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
LEGEND ,
Nov 13, 2007 Nov 13, 2007
LATEST
I meant to get back to you two and tell you thank you for your
responses. This will help.

-John

Hunter Elliott wrote:
> "David Powers" <david@example.com> wrote in message
> news:fgssap$3fv$1@forums.macromedia.com...
>
>> I've not used any of the extensions, so can't comment on how good/bad
>> they are.
>
> I've used DMXzone's PureASP upload - I presume their PHP upload extension is
> similar. It's pretty good and I like the ability to limit which types of
> files can be uploaded. I've used WebAssist's Digital File Pro upload
> extension - I find it a lot less user-friendly than DMX' and there's no
> ability to restrict file type (except that it be an image format).
>
>
Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines