Jump to content

Framed Web Form testing arrays


chuy08

Recommended Posts

I have constructed a framed web form.  The frames are equally divided into two rows taking up 50% of the screen space each.  The top frame is supposed to be static and the bottom frame is where results should be returned when web form is submitted. 

Currently when I land on this framed web form within a browser I am getting a blank screen.  What I would like to have is a message below that prompts the user to fill in above to get results.  My problem is the test that I am using to evaluate if the POST array has been initialized or not.  I have constructed an if/else statement that is supposed to test for this, example below:

if (is_array($pricing))
    {
        $pricing = $_POST['pricing'];
        print_r($_POST);  //just for testing purposes only
    } else {
        echo "Please fill out form above to get results below<BR>";
      }

When I land on the page for the first time the Please fill out form above... condition is met and printed.  Once I begin to fill in my webform and select the submit button I can't seem to get my test to ever evaluate to true.  Adding my $pricing = $_POST and print_r command to the false section of the if/else statement does what it's supposed to do, but why is the test not responding accordingly.  Any help appreciated.
   
Link to comment
Share on other sites

Ok--without seeing the code, I can only offer generalities.  But it would be REALLY helpful if I could see the HTML code and some more PHP code.

1) check the CASE of your variables and form fields.  They HAVE to be the same.  If the Form field is [b]<input type="Pricing">[/b] then you have to obtain the variable like this:  [b]$pricing = $_POST['Pricing'];[/b]
Link to comment
Share on other sites

try[code]print_r($_POST);  //just for testing purposes only
if (isset($_POST['pricing']) // < == change this line
    {
        $pricing = $_POST['pricing'];
       
    } else {
        echo "Please fill out form above to get results below<BR>";
      }[/code]
Link to comment
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.