× 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.



Do you need to __set method of the i5_Program object?
For example:

$conn2 = new i5_Connection('127.0.0.1',USER_NAME, PASSWORD);
$conn2->connect();

$desc = new i5_Description();
$desc->I5_TYPE_CHAR('IfsFileName', '256', I5_INOUT);
$desc->I5_TYPE_CHAR('error', '256', I5_INOUT);

$prog = new i5_Program('IHMODSNW','NAMAD002R4', $desc, $conn2);
$prog->__set('IfsFileName', basename($file) );
$prog->__set('error', '');
$prog->call();
if(is_null($prog->LastErr)){
echo 'Error:'.$prog->__get("error").'<br>';
}

After the new i5_Program object is created the __set methods set the values for the parameters prior to the program call.


-----Original Message-----
From: web400-bounces@xxxxxxxxxxxx [mailto:web400-bounces@xxxxxxxxxxxx] On Behalf Of Tom Deskevich
Sent: Friday, October 09, 2009 10:25 AM
To: web400@xxxxxxxxxxxx
Subject: [WEB400] Attempting to pass html text box into PHP to call an RPG program

All I want to do is prompt for a search name on a web page, then take
whatever is keyed in and pass it to my RPG program, which will load my
information, which I will use to populate a page of names.

I cannot get the text box information "out".

I have researched. And to my frustration, the examples out there are "hello
world" and see how easy this is! I have hard coded all my variables and it
works great!

Here is my totally un-excellent code:

HTML to present the text box:
<html>
<head>
<link rel="stylesheet" href="styles.php" type="text/css">
<TITLE>Clerk of Courts Imaging</TITLE>
</head>
<h1 class=bigbluetext> Clerk of Courts Imaging Inquiry </h1>
<form method="post">

Primary Participant Name:
<input tabIndex="1" size="30" name="ppname">
<INPUT TYPE="submit" VALUE=" Find ">
EXAMPLE: Doe, John
<hr />
</html>

CONDITION CODE BELOW ON CLICK OF SUBMIT BUTTON.

<?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="HOW DO I GET PPNAME IN HERE??" ;
$desc = array (
array ("name"=>"caseno", "io"=>I5_INOUT, "type" => I5_TYPE_CHAR, "length"=>
"15"),
array ("name"=>"foname", "io"=>I5_INOUT, "type" => I5_TYPE_CHAR, "length"=>
"30"),
array ("name"=>"Vs", "io"=>I5_INOUT, "type" => I5_TYPE_CHAR, "length"=> "1")
);
try {
$prog = i5_program_prepare("ICSCCLIB/CCP565PHPC", $desc);
} catch (Exception $e) {
echo "Failure when preparing program";
echo $e->getMessage();
die();
}
$params = array ("caseno"=>" ","foname"=>$fdname,"vs"=>"P");
$retvals = array("caseno"=>"caseno","foname"=>" ","vs"=>"vs");
$ret = i5_program_call($prog, $params, $retvals) ;

Running this, I GET "Type of parameter 1 cannot be a null
Hard coding and forcing something in $FDNAME works fine.


THANKS!!!!!!!!!! I FEEL LIKE SUCH A NULL-SKULL!!!

Tom Deskevich
Infocon Corporation
Phone 814-472-6066
Fax 814-472-5019


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.