Jump to content


Passing Value from one script to another script

  • Please log in to reply
No replies to this topic

#1 pravonline

  • New Members
  • Pip
  • Newbie
  • 5 posts

Posted 22 May 2006 - 04:06 AM

Dear All,

I,m trying to pass some values from one program to another program ( i.e. PGMA to PGMB ), But the vaues are not coming in the PGMB, Can anyone suggest me what went wrong in the PGMA, Plase find the sample code for PGMA and PGMB.
<title>User Choices</title>

require_once 'DB.php'; // must be included in any script that uses PEAR::DB

$db_host    = "localhost";    // hostname of the database server
$db_user    = "root";           // database user's username
$db_pass    = "";        // database user's password, nothing by default
$db_name    = $_POST['dbname'];    // the name of the database to connect to
$db_type    = "mysql";          // the type of database server.
$tb_name    = $_POST['tbname'];    // the name of the database to connect to
//$tabelle    = $_POST['tbname'];
//$tabelle = $company_prefix.'tbname';       
// your data source name string. This contains the connection
// information for your database.
$dsn = "$db_type://$db_user:$db_pass@$db_host/$db_name";
// creates a database connection object or a database error
// object based on the success of the database connection.
$db = DB::connect($dsn, TRUE);

// if an error was encountered, the script exits with an error message
if (DB::isError($db)) {

<font color="red"><b>           Field          
      Type </b>

<font color="blue">
<form name="fmTime" id="select_period" " action="disp.php" method="post">

// SQL query that you wish to use to query the database
$sql = "show fields from $tb_name";
$result = MYSQL_QUERY($sql);
//$val = 0;
//*foreach ($row as $col=>$val)
//foreach ($dbnames as $col=>$val)



//PRINT $val;
     PRINT $dbnames1[$cnt];
     PRINT $dbnames2[$cnt];
     if (strpos($dbnames2[$cnt], 'varchar') !== false) {
    <SELECT NAME="parm[]" >
<input type="text" name="name1" /> <P>


 <SELECT NAME="parm[]">
<input type="text" name="name1" value="suresh" /> <P>

<p><input type="submit" /></p>


And PGMB is as follows:

print 'test';
$val1 = $_post['field'];
print $_post['parm'];
print $_post['parm[1]'];
print $_post['parm[2]'];
print $val1;
print $_post['name1'];

In PGMB, I'm trying to print the fileds like "field", "parm", "parm[1]", "parm[2]" and "name1" which should have the values from the PGMA, But surprisingly, no values are printing execpt "test", Can someone suggest me what needs to be corrected?
Thanks and Regards,

0 user(s) are reading this topic

0 members, 0 guests, 0 anonymous users