Change this
echo "<H2 class=bigbluetext> $RET </h2>";
to
echo "<H2 class=bigbluetext> $ret </h2>";


-----Original Message-----
From: web400-bounces@xxxxxxxxxxxx [mailto:web400-bounces@xxxxxxxxxxxx] On Behalf Of Tom Deskevich
Sent: Thursday, February 04, 2010 9:18 AM
To: 'Web Enabling the AS400 / iSeries'
Subject: [WEB400] Help trying to display a PHP variable within HTML tags

I want to display a PHP variable on the top of my page with my headings. I
have searched on the internet, and have not found a way to show the php
variable within my html tags. If I use text in the heading, it works. But
when using a variable, nothing shows. I have tried many variations. I know
there is something in the data area, because it works if I move it to my
main body of php code.

<html>
<head>
<link rel="stylesheet" href="styles.php" type="text/css">
<TITLE>Sheriff Consolidated Inquiry</TITLE>
</head>

<h1 class=bigbluetext font size="+2"> Sheriff System Consolidated Inquiry
</h1>
<?php
$ret = i5_data_area_read("smpxxlib/so01p", 1, 40);
echo "<H2 class=bigbluetext> $RET </h2>";
?>
<form method="post">
Name:

DOES NOT SHOW ANYTHING.

<html>
<head>
<link rel="stylesheet" href="styles.php" type="text/css">
<TITLE>Sheriff Consolidated Inquiry</TITLE>
</head>

<h1 class=bigbluetext font size="+2"> Sheriff System Consolidated Inquiry
</h1>
<?php
$ret = i5_data_area_read("smpxxlib/so01p", 1, 40);
echo "<H2 class=bigbluetext> I shot the sheriff.... </h2>";
?>
<form method="post">
Name:

WORKS.

ALSO.... Putting the code in my <PHP section works.......

Name:
<input tabIndex="1" size="30" name="ppname">
<INPUT TYPE="submit" VALUE=" Find ">
EXAMPLE: smith OR smith j OR smith john
<hr />
</html>
<?php
if(isset($_POST['ppname'])){
require_once('Connection.php');
try {
$conn = new Connection();
} catch (Exception $e) {
echo "Failure to connect";
echo $e->getMessage();
die();
}
$fdname=$_POST['ppname'];
$ret = i5_data_area_read("smpxxlib/so01p", 1, 40); <<<<=== Works here
!!!
echo "<H2 class=bigbluetext> $ret </h2>";
$desc = array (

TIA

Tom Deskevich



As an Amazon Associate we earn from qualifying purchases.

This thread ...

Follow-Ups:
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.