× The internal search function is temporarily non-functional. The current search engine is no longer viable and we are researching alternatives.
As a stop gap measure, we are using Google's custom search engine service.
If you know of an easy to use, open source, search engine ... please contact support@midrange.com.



Larry,
Joel's answers are correct.

You will also find examples of calling DB2/400 either via Zend's
documentation or in the following article:
http://www.mcpressonline.com/mc?1@@.6b50a08e. Calling RPG examples from
PHP in the follow-on article:
http://www.mcpressonline.com/mc?50@xxxxxxxxxxxxxxxxx@.6b50a180 .

For those of you that don't want to hard code PHP --> you will hear
about a product from Zend before this month is over.

Thank you.

Regards,
Jim Dillard

---------------------------------------------
Jim Dillard
IBM Alliance Manager
Direct: 408-342-8886
Email: JDillard@xxxxxxxx

-----Original Message-----
From: web400-bounces@xxxxxxxxxxxx [mailto:web400-bounces@xxxxxxxxxxxx]
On Behalf Of Joel Cochran
Sent: Tuesday, October 02, 2007 8:33 AM
To: Web Enabling the AS400 / iSeries
Subject: Re: [WEB400] PHP

Hi Larry:

The example you sent uses echo to output everything. Check out these
options instead:

1) Drop in and out of PHP as required:

<html>
<head><title>My Web Page</title></head>
<body>
<p>The Year is:

<?php
echo Date('Y');
?>

</p>
</body>

This will actually dump the return value of the call to the Date()
function inline into your HTML. In this example, it is a bit of
overkill, but for more complex operations such as database access, file
includes, or calculations this makes sense. You still use echo when you
want to output from within PHP code (and of course white space is
ignored), but as you'll see in the next option even that is routinely
unnecessary.


2) Use PHP Expressions to embed data:
<html>
<head><title>My Web Page</title></head>
<body>
<?php
$date = Date('Y');
?>
<p>The Year is: <%= $date %></p>
</body>

This is from memory, and I haven't coded PHP from scratch in a while,
but I think it is correct. Basically, you can embed data fields or even
function calls directly inline.

Both of these approaches make your PHP code a lot more palatable.

HTH,

--
Joel Cochran
http://www.developingfor.net


On 10/2/07, Larry Kleinman <larry@xxxxxxxxxxxxxxxxx> wrote:

Hi - I'm making the switch from Net.Data to PHP and have some really
basic
questions. Most important, at least right now:

Net.Data allows ordinary HTML inside of a Net.Data function. For
example

%HTML (S1) {
<html>
<head>
</head>

<body>
Some text here
@S1 ( )
Some more text here
</body>
%}

will display "Some text here" then call the function name S1, then
display
"Some more text here"



In PHP, it looks like i have to use the Echo funciton whenever I want
to
do
straight HTML

<?php
Function input ( ) {
echo "
some text here
";

S1 ( )
echo "
some text here
";


}
?>

Is this correct?

Larry Kleinman
Kleinman Associates, Inc.
212-949-6469
203-255-4100
--
This is the Web Enabling the AS400 / iSeries (WEB400) mailing list
To post a message email: WEB400@xxxxxxxxxxxx
To subscribe, unsubscribe, or change list options,
visit: http://lists.midrange.com/mailman/listinfo/web400
or email: WEB400-request@xxxxxxxxxxxx
Before posting, please take a moment to review the archives
at http://archive.midrange.com/web400.



As an Amazon Associate we earn from qualifying purchases.

This thread ...

Replies:

Follow On AppleNews
Return to Archive home page | Return to MIDRANGE.COM home page

This mailing list archive is Copyright 1997-2024 by midrange.com and David Gibbs as a compilation work. Use of the archive is restricted to research of a business or technical nature. Any other uses are prohibited. Full details are available on our policy page. If you have questions about this, please contact [javascript protected email address].

Operating expenses for this site are earned using the Amazon Associate program and Google Adsense.