473,405 Members | 2,421 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,405 software developers and data experts.

Retrieve POSTed .NET control values in .PHP page

6
I have values in a .ASPX page that I would like to pass and retrieve in a .PHP page. I am using $_POST[controlname], but it is not retrieving any of the values. What am I doing wrong?

BTW - The values I want to retrieve from the .ASPX are .NET controls. I have even written the values into conventional hidden controls (input type="hidden") but still no values are being retrieved in the .PHP page. All values are contained within a <form method=post> in the .ASPX file.
Jan 18 '07 #1
7 2972
ronverdonk
4,258 Expert 4TB
At least show the code involved in this. Or do we have to guess?

When posting code, enclose it within code or php tags!! See the Posting Guidelines at the top of this forum before you continue.

Ronald :cool:
Jan 18 '07 #2
Mahill
6
At least show the code involved in this. Or do we have to guess?

When posting code, enclose it within code or php tags!! See the Posting Guidelines at the top of this forum before you continue.

Ronald :cool:
Expand|Select|Wrap|Line Numbers
  1. <?php
  2. include '../includes/pdf/class.ezpdf.php';
  3.  
  4. $c_fullName=(empty($_POST['hidFullName'])) ? "" : stripslashes($_POST[hidFullName]);
  5. $c_ownPerct=(empty($_POST['hidOwner_T'])) ? "" : $_POST[hidOwner_T];
  6. $c_SSN=(empty($_POST['hidSSN_T'])) ? "" : $_POST[hidSSN_T];
  7. $c_address=(empty($_POST['hidAddress'])) ? "" : stripslashes($_POST[hidAddress]);
  8. $c_city=(empty($_POST['hidCity'])) ? "" : stripslashes($_POST[hidCity]);
  9. $c_state=(empty($_POST['hidState'])) ? "" : $_POST[hidState];
  10. //$c_county=(empty($_POST['county'])) ? "" : stripslashes($_POST[county]);
  11. $c_county="Dallas";
  12. $c_zipCode=(empty($_POST['hidZipCode'])) ? "" : $_POST[hidZipCode];
  13. $c_homePhone=(empty($_POST['hidPhone'])) ? "" : $_POST[hidPhone];
  14. $c_altPhone=(empty($_POST['hidAltPhone'])) ? "" : $_POST[hidAltPhone];
  15. //$c_phoneExt=(empty($_POST['phoneExt'])) ? "" : $_POST[phoneExt];
  16. $c_phoneExt="";
  17. //$c_faxPhone=(empty($_POST['hidPhoneWork_C'])) ? "" : $_POST[hidPhoneWork_C];
  18. $c_faxPhone="";
  19. $c_email=(empty($_POST['hidEmail'])) ? "" : $_POST[hidEmail];
  20. $c_ptrFullName=(empty($_POST['hidPartner'])) ? "" : stripslashes($_POST[hidPartner]);
  21. $c_ptrOwnPerct=(empty($_POST['hidOwner_2'])) ? "" : $_POST[hidOwner_2];
  22. $c_ptrSSN=(empty($_POST['hidSSN_S'])) ? "" : $_POST[hidSSN_S];
  23. $c_ptrAddress=(empty($_POST['hidPartnerAddress'])) ? "" : stripslashes($_POST[hidPartnerAddress]);
  24. $c_rbSpouse=(empty($_POST['hidSpouse'])) ? "0" : $_POST[hidSpouse];
  25. $c_comments="";
  26. $c_entityName=(empty($_POST['hidPartnershipName'])) ? "" : stripslashes($_POST[hidPartnershipName]);
  27. $c_entityStartDate=(empty($_POST['hidFormation'])) ? "" : date("m/d/Y",strtotime($_POST[hidFormation]));
  28. $c_chkEquities=(empty($_POST['hidEquities'])) ? 0 : 1;
  29. $c_chkOptions=(empty($_POST['hidOptions'])) ? 0 : 1;
  30. $c_chkCurrencies=(empty($_POST['hidCurrencies'])) ? 0 : 1;
  31. $c_chkCommodities=(empty($_POST['hidCommodities'])) ? 0 : 1;
  32. $c_rbDisposition=(empty($_POST['hidDisposition'])) ? "0" : $_POST[hidDisposition];
  33. $c_EIN="";
  34. $c_completed=0;
  35.  
This code works perfectly when the values are being passed from a .PHP page to this page.
Jan 18 '07 #3
ronverdonk
4,258 Expert 4TB
And where is the code containing the <FORM> ?

Ronald :cool:
Jan 18 '07 #4
Mahill
6
And where is the code containing the <FORM> ?

Ronald :cool:
Expand|Select|Wrap|Line Numbers
  1.     <form id="frmDefault" runat="server" method="post">
  2. ... other stuff
  3.     </form>
  4.  
The form code is in a .master file that is used by the .aspx file. Do I need to post that as well?

I guess generally I was asking if this was even a possibility. I really do not want to use querystrings, but if there is no other way, I have no choice.
Jan 18 '07 #5
ronverdonk
4,258 Expert 4TB
If you want to post data, you put it in a named <input> field in a form. Each form <input> field 's name and its content/value is, when that form is submitted, passed via the POST array to the script of which the name is specified in the action= attribute of the form definition. So:
Expand|Select|Wrap|Line Numbers
  1. <form method="post" action="check.php">
  2. <input type="text" name="abc" value="XYZ" />
  3. <input type="submit" name='submit' value="Send it" />
  4. </form>
will send the form to the check.php script passing the 2 fields in the $_POST array. The $_POST array, when printed, looks then like:
Expand|Select|Wrap|Line Numbers
  1. array ( ['abc'] => 'XYZ'  ['submit'] => 'Send it' )
In your PHP script, you handle the array as follows[php]<?php
$var1 = $_POST['abc'];
$var2 = $_POST['submit'];

Now $var1 contains the value 'XYZ'and
$var2 contains the value 'Send it'[/php]
Ronald :cool:
Jan 18 '07 #6
Mahill
6
If you want to post data, you put it in a named <input> field in a form. Each form <input> field 's name and its content/value is, when that form is submitted, passed via the POST array to the script of which the name is specified in the action= attribute of the form definition. So:
Expand|Select|Wrap|Line Numbers
  1. <form method="post" action="check.php">
  2. <input type="text" name="abc" value="XYZ" />
  3. <input type="submit" name='submit' value="Send it" />
  4. </form>
will send the form to the check.php script passing the 2 fields in the $_POST array. The $_POST array, when printed, looks then like:
Expand|Select|Wrap|Line Numbers
  1. array ( ['abc'] => 'XYZ'  ['submit'] => 'Send it' )
In your PHP script, you handle the array as follows[php]<?php
$var1 = $_POST['abc'];
$var2 = $_POST['submit'];

Now $var1 contains the value 'XYZ'and
$var2 contains the value 'Send it'[/php]
Ronald :cool:
I appreciate the response. Actually, my problem was simply that I was not submitting the .ASPX page, but merely hyperlinking to the .PHP so since nothing was submitted, no values were being read.
Jan 18 '07 #7
ronverdonk
4,258 Expert 4TB
Glad I could have helped you out!

Ronald :cool:
Jan 18 '07 #8

Sign in to post your reply or Sign up for a free account.

Similar topics

1
by: Eugfene | last post by:
I have the following function in a html file: function selectEdit(fileID, processCode, processID, fileName,fileDesc) { document.forms.recordID.value = fileID; document.forms.processor.value =...
5
by: Vanessa | last post by:
I have a question, is that any other way to retrieve data from another webpage besides using XML object? Because I am using XML object now but give me so much problems. If I used...
2
by: Softwaremaker | last post by:
Hi all, I have created a Windows Form control that runs on a web form. This control is a composite control comprising of other textboxes (public scope). This control inherits from the...
1
by: nic | last post by:
Hi, I have an aspx page where I dynamically generate a number of input controls. Upon submitting the form I need to re- create the controls in order to retrieve their values. I understand this,...
0
by: Andy Fish | last post by:
Hi, I have a web user control that has a textbox on it. In the form_load event of the owning form, I dynamically add the web user control to the page. The Load event of the control fires OK,...
1
by: Simon | last post by:
Hi everyone, I have a quick question that I hope someone can help me with: I've made a user control that contains a text box and some validation functionality. This control has a few extra...
2
by: epigram | last post by:
I'm responding to a button click event on an asp.net web form. I then need to retrieve the value from a TextBox control and I want to compare it against the control's previous value to see if it...
2
by: P K | last post by:
I am using server.transfer for a website being developed in vs.net 2005 And I need to get the posted values after server.transfer. For this I set the second parameter "true" in the transfer...
6
by: Daz | last post by:
Hi everyone. Firstly, I apologise if this i not what you would call a PHP problem. I get quite confused as to what lives in which realm, so if this shouldn't be posted here, please suggest where...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.