Welcome to WebHeadStart.org

Web Technologies

Sponsored By

WebHeadStart.org is currently in beta.
Please pardon our appearance as we work to provide you with the most comprehensive reference on today's web technologies.

Interested in advertising on WebHeadStart? Become an advertising partner today!

[WWW-HTML Mailing List Archive Home] [Messages By Thread] [Messages By Date]

Re: PHP and HTML, and how to access PHP variables from HTML

From: David Dorward <david@dorward.me.uk>
Date: Sat, 16 Jul 2005 12:39:17 +0100
To: jim sullivan <jim-sullivan@comcast.net>
Cc: www-html@w3.org
Message-ID: <20050716113917.GA9701@us-lot.org>

On Fri, Jul 15, 2005 at 03:19:11PM -0400, jim sullivan wrote:
>    This is a general question on how to reference script variables from HTML,

You don't. HTML is a document description language, not a programming
language. It has methods to hook scripting into it, but all the
variable handling must be done in the languges that are hooked not in
the HTML itself.

>    although the example I use is with PHP.

As far as I'm aware, client side support for PHP is nil.

>    <?php
>    foreach(glob("*.jpg") as $imagefile)
>    {
>    ?>
>    <img src=$imagefile title="$imagefile">
>    <?php
>    }
>    ?>

That would be an example of PHP being used to author an HTML document
on the fly. Since HTML is just a matter of the syntax of the output
format (You should have quotes around the value of the src attribute,
you are missing the required alt attribute, and the filename of the
image is unlikely to be useful advisory information), your question
would be better addressed to a PHP discussion list rather then one for
the discussion of the future design of HTML.

-- 
David Dorward                                      http://dorward.me.uk 
Received on Saturday, 16 July 2005 11:45:40 GMT
Valid XHTML 1.0! Valid CSS! Site Map | Privacy Policy | Terms of Use | WebHeadStart.org © 2005 All Rights Reserved.