Advertisement

08.13.2008 at 02:09PM PDT, ID: 23646313 | Points: 500
[x]
Attachment Details

Can't Access $_POST variables

Asked by IT79637 in PHP Scripting Language, Hypertext Markup Language (HTML)

Tags: ,

Hi Experts,

This is a major rush job for me.  Points=500.

I'm navigating from 1 web page to a 2nd web page and do not have access to $_POST variables in the 2nd web page.  There is an intermediate page between the first two pages that contain frameset and two frames.  Explained below.

I want to pass three data values on the first page to the second web page.  The first is from a hidden field and the 2nd and 3rd are from two drop down boxes.  See "WEB PAGE 1" below.

The intermediate second web page is setup with the usual stuff as follows:

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta .... " />
<title>Regular Voucher Entry</title>
<title>Regular Voucher Entry</title>
<link href="images/ss.css"  rel="stylesheet" type="text/css" />
<link href="images/ss.css1" rel="stylesheet" type="text/css" />
<link href="images/ss.css2" rel="stylesheet" type="text/css" />
<style type="text/css">
div {
      display:inline;
      white-space:nowrap;
}
...... more in line style sheet code...
</styLe>
<<-- NEXT A BUNCH OF JAVASCRIPT FOR AN AJAX FUNCTION -->>
<script type="text/javascript" language="JavaScript1.2" src="C:/wamp/www/resume2/scripts/menu.js"></script>
<script type="text/javascript" src="./scripts/jquery-1.2.1.js"></script>
<script type="text/javascript">
$(document).ready(function() {

<<-- DELETED JAVASCIPT -->>

});
</script>

</head>
<?php
session_start();
?>
  <frameset rows="100%,*" >
    <frame name="MAIN"     src="vchrAdd.php" />
    <frame name="HIDDEN" src="ServerControl.html" />
  </frameset>
</html>

However note I have a frameset and two frames.  The first frame  displays the page content.   The second frame is hidden and is used to maintain the handle to a persistent automation server written in Delphi for the life of the browser session.

I assume, IE6 sees the first frame and executes program vchrAdd.php.

The first few lines of vchrAdd.php are:

<?php
session_start();
$id = $_POST["id"] ;
 echo "$id:", $id, "<br>";


if (isset($_POST["nextVchrID"])) {
    $vchrID = $_POST["$nextVchrID"];
} else {
    $vchrID = "NEXT";
}

Then variable I want to access is $id which came from the hidden field on the first web page.  It is always null.  It use to work before I added Framesets and Frames.  I conclude the frameset and frames are the culprit.

Is that correct?

What kind of change do I need to do so I can reference my $_POST variables in program vchrAdd.php or have I royally messed it up?

Thanks much!!!




Start Free Trial
1:
2:
3:
4:
5:
6:
7:
8:
9:
10:
11:
12:
13:
14:
15:
16:
17:
18:
19:
20:
21:
22:
23:
24:
25:
26:
27:
28:
29:
30:
31:
32:
33:
34:
35:
36:
37:
38:
39:
40:
41:
42:
43:
44:
45:
46:
47:
48:
49:
50:
51:
52:
53:
54:
55:
56:
57:
58:
59:
60:
61:
62:
63:
64:
65:
66:
67:
68:
69:
70:
71:
72:
73:
74:
75:
76:
77:
78:
79:
80:
81:
82:
83:
84:
85:
86:
87:
88:
89:
90:
91:
92:
93:
94:
95:
96:
97:
98:
99:
100:
101:
102:
103:
104:
105:
106:
107:
108:
109:
110:
111:
112:
113:
114:
115:
116:
117:
118:
119:
120:
121:
122:
123:
124:
125:
126:
127:
128:
129:
130:
131:
132:
133:
134:
135:
136:
137:
138:
139:
140:
141:
142:
143:
144:
145:
146:
147:
148:
149:
150:
151:
152:
153:
154:
155:
156:
157:
158:
159:
160:
161:
162:
163:
164:
165:
166:
167:
168:
169:
170:
171:
172:
173:
174:
175:
176:
177:
178:
179:
180:
181:
182:
183:
184:
185:
186:
187:
188:
189:
190:
191:
WEB PAGE 1
----------
<?php
session_start();
?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1."0" Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
<title>Select Vendor</title>
<link href="images/ss1.css" rel="stylesheet" type="text/css" />
<style type="text/css">
body {
	width:700px;
}
</style>
<link href="images/ss.css" rel="stylesheet" type="text/css" />
</head>
 
<body>
 
<form action="vchrAddHeader.html" method="post" name="invoiceType"  id="invoiceType">
<input name="id" type="hidden" value="0"/>
<?php  include 'includes/header1.php';  ?>
<p>
<table width="280" height="30" border="0" align="center" cellpadding="0" cellspacing="0" class="border-top" >
  <tr>
    <td width="280" colspan="2" align="center" bgcolor="#D0B759" class="blck15b" >Invoice Type Selection</td>
  </tr>
</table>
<table width="280" border="0" align="center" class="border-middle">
  <tr>
    <td width="120" height="38" class="blck12b">&nbsp;Region:</td>
  <td width="189"><select name="company" size="1" id="company" tabindex="10">
    <option value="01" selected="selected">Corporate</option>
    <option value="02">US North East</option>
    <option value="03">US South East</option>
    <option value="04">US North West</option>
    <option value="05">US SouthWest</option>
    <option value="06">US Central</option>
    <option value="07">US South</option>
  </select></td>
  </tr>
  <tr>
    <td height="40" class="blck12b">&nbsp;Invoice Type:</td>
    <td><select name="invType" size="1"  id="invType" tabindex="20" >
      <option value="01" selected="selected">Purchase Order</option>
      <option value="02">Approval</option>
      <option value="03">Travel & Expense</option>
    </select>
  </tr>
</table>
<table width="280" height="34" border="0" align="center" class="border-bottom">
  <tr>
    <td width="292" height="28">
        <center>
          <input name="vchrcontinue" type="submit" class="font-filler-button" id="vchrcontinue" tabindex="30" value="Continue"/>
        </center>      </td>
</table>
<p>
</form>
</body>
</html>
 
 
INTERMEDIATE WEB PAGE 
---------------------
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
<title>Regular Voucher Entry</title>
<link href="images/ss.css"  rel="stylesheet" type="text/css" />
<link href="images/ss.css1" rel="stylesheet" type="text/css" />
<link href="images/ss.css2" rel="stylesheet" type="text/css" />
<style type="text/css">
div {
      display:inline;
      white-space:nowrap;
}
.page
{
width: 675px
}
div {
    display: inline;
    white-space: nowrap;
    text-align: right;
}
 
</style>
<script type="text/javascript" language="JavaScript1.2" src="C:/wamp/www/resume2/scripts/menu.js"></script>
<script type="text/javascript" src="./scripts/jquery-1.2.1.js"></script>
<script type="text/javascript">
$(document).ready(function() {
      var cursorval = 1;
      $("#main input.delrow:first").css({display: "none"});
 
      $("#addrow").click(function() {
            $.get("./newrow.php",{ cursor: cursorval }, function(data) {
                       $("#main").append(data);
            });
            cursorval += 1;
            $(document).ajaxSuccess(function(){
                  $("#main input.delrow:first").css({display: "inline"});
                  $("#addrow").appendTo("#main div:last");
 
                  $("#main input.delrow").bind("click", function() {
                        if($("#main input.delrow").length == 1) {
                              $("#main input.delrow:first").css({display: "none"});
                        }
                        if($("#main input.delrow").index($(this)[0]) != ($("#main input.delrow").length-1)) {
                              $(this).parents("tr").remove();
                        }
                        else {
                              $("#addrow").appendTo($("#main div").get(($("div").length)-2));
                              $("#main input.delrow:last").parents("tr").remove();
                        }
                  });
 
            });
 
      });
 
});
</script>
<script type="text/vbscript">
Dim mySrvObj
 
Sub cmdWorkInvoice_onclick
  msgbox "in vbs"
  Dim vCompany, vInvType, vDocID, vStatus, iResult
  LoadSvr()
  vCompany  = document.getElementByID("company1").value
  vInvType = document.getElementByID("invtype1").value
    msgbox(document.getElementByID("invtype1").value & "|" &  document.getElementByID("company1").value)
  iResult = mySrvObj.WorkInvoice(vCompany, vInvType, vDocID, vStaus)
 
 <<-- I DELETED A LOT OF VBScript CODE TO SAVE ROOM -->>
 
    if isobject(mySrvObj) then
      iResult = mySrvObj.GetVendorNameAddress(vSearchStr, vCount, vVendorNameAddr, vSatus)
      //document.getElementByID("status1").value = (vStatus)
      iStatus =CInt(vStatus)
      //MsgBox "iStatus:" & CStr(iStatus) & "||" & "vbs vStatus-vendr info"  & "|| vStatus:" & vStatus & "|| vndr Info:" & vVendorNameAddr
      Select Case iStatus
        Case 0            //Rem  Selected Vendor
          arrData = Split(vVendorNameAddr, "|")
          document.getElementByID("vndrSearch").value = ""
          document.getElementByID("vndrSearch").value = arrData(1)
          document.getElementByID("VendorNameAddress").value = x
        Case 1        //Rem Result Set > 20
          Exit Sub
        Case 2        //Cancel Vendor Lookup--Start over
          document.getElementByID("vndrSearch").value = ""
          document.getElementByID("VendorNameAddress").value =  ""
          Exit Sub
        Case  5            //Rem DAtabase error
          Exit Sub
        Case Else
          MsgBox "Unknown Error: VBS iStatus: " & CStr(sSatus) & "."
      End Select
    end if
End Sub
</script>
</head>
<?php
session_start();
?>
  <frameset rows="100%,*" >
    <frame name="MAIN"   src="vchrAdd.php" />
    <frame name="HIDDEN" src="ServerControl.html" />
  </frameset>
</html>
 
<<-- END INTERMEDIATE PAGE -->>
 
WEB PAGE 2
----------
 
The first few lines of vchrAdd.php are:
 
<?php
session_start();
$id = $_POST["id"] ;
 
if (isset($_POST["nextVchrID"])) {
    $vchrID = $_POST["$nextVchrID"];
} else {
    $vchrID = "NEXT";
}
[+][-]08.13.2008 at 02:25PM PDT, ID: 22225772

At Experts Exchange, members can ask their questions to thousands of technology professionals, also known as Experts. Experts compete and collaborate to answer those questions by leaving comments like this one.

Start your 7-day free trial to view this Expert Comment or ask the Experts your question.

 
[+][-]08.13.2008 at 02:28PM PDT, ID: 22225798

At Experts Exchange, members can ask their questions to thousands of technology professionals, also known as Experts. Experts compete and collaborate to answer those questions by leaving comments like this one.

Start your 7-day free trial to view this Expert Comment or ask the Experts your question.

 
[+][-]08.13.2008 at 02:30PM PDT, ID: 22225812

At Experts Exchange, members can ask their questions to thousands of technology professionals, also known as Experts. Experts compete and collaborate to answer those questions by leaving comments like this one.

Start your 7-day free trial to view this Expert Comment or ask the Experts your question.

 
[+][-]08.13.2008 at 07:40PM PDT, ID: 22227476

At Experts Exchange, members can ask their questions to thousands of technology professionals, also known as Experts. Experts compete and collaborate to answer those questions by leaving comments like this one.

Start your 7-day free trial to view this Expert Comment or ask the Experts your question.

 
[+][-]08.14.2008 at 12:04PM PDT, ID: 22233219

Often, when Experts are collaborating with members who have asked questions, they will request additional information about the problem. Askers respond with an author comment like this one.

Start your 7-day free trial to view this Author Comment or ask the Experts your question.

 
[+][-]08.14.2008 at 12:17PM PDT, ID: 22233360

At Experts Exchange, members can ask their questions to thousands of technology professionals, also known as Experts. Experts compete and collaborate to answer those questions by leaving comments like this one.

Start your 7-day free trial to view this Expert Comment or ask the Experts your question.

 
[+][-]08.14.2008 at 12:44PM PDT, ID: 22233608

At Experts Exchange, members can ask their questions to thousands of technology professionals, also known as Experts. Experts compete and collaborate to answer those questions by leaving comments like this one.

Start your 7-day free trial to view this Expert Comment or ask the Experts your question.

 
[+][-]08.14.2008 at 12:45PM PDT, ID: 22233617

At Experts Exchange, members can ask their questions to thousands of technology professionals, also known as Experts. Experts compete and collaborate to answer those questions by leaving comments like this one.

Start your 7-day free trial to view this Expert Comment or ask the Experts your question.

 
[+][-]08.14.2008 at 03:56PM PDT, ID: 22234977

Often, when Experts are collaborating with members who have asked questions, they will request additional information about the problem. Askers respond with an author comment like this one.

Start your 7-day free trial to view this Author Comment or ask the Experts your question.

 
[+][-]08.14.2008 at 04:48PM PDT, ID: 22235184

At Experts Exchange, members can ask their questions to thousands of technology professionals, also known as Experts. Experts compete and collaborate to answer those questions by leaving comments like this one.

Start your 7-day free trial to view this Expert Comment or ask the Experts your question.

 
[+][-]08.15.2008 at 09:05AM PDT, ID: 22239375

Often, when Experts are collaborating with members who have asked questions, they will request additional information about the problem. Askers respond with an author comment like this one.

Start your 7-day free trial to view this Author Comment or ask the Experts your question.

 
[+][-]08.15.2008 at 11:32AM PDT, ID: 22240562

At Experts Exchange, members can ask their questions to thousands of technology professionals, also known as Experts. Experts compete and collaborate to answer those questions by leaving comments like this one.

Start your 7-day free trial to view this Expert Comment or ask the Experts your question.

 
 
Loading Advertisement...
20080716-EE-VQP-32 / EE_QW_2_20070628