Page 1 of 1

Form Submission dropping variables.

Posted: Tue May 19, 2009 2:34 pm
by cpc
Hi All,

I have a simple form that I am using to verify information.

I am accessing the form via URL:

Code: Select all

http://www.domain.com/form.php?AccountN ... ccountName
And pulling those variables into my page using:

Code: Select all

Your Account Number is: <?php echo "$AccountNumber"; ?>
- Works as expected.

Inserting it into my form with this:

Code: Select all

<input name="AccountNumber" type="hidden" value="<?php echo "$AccountNumber"; ?>" />
Writing it to a data file with this:

Code: Select all

        $f  =   fopen("_data/recert.csv","a");
        fwrite($f,$_REQUEST["AccountNumber"].",".$_REQUEST["AccountName"].",".$_REQUEST["cert_FullName"]. "\n");
        fclose($f);
and getting this when the form is submitted.

Code: Select all

Notice: Undefined index: AccountNumber in ..\dev\index.php on line 6

Any Ideas?
Any help is greatly appreciated. : )

Thank you!

Re: Form Submission dropping variables.

Posted: Tue May 19, 2009 2:49 pm
by Darhazer
AccountName works like expected... but notice is for AccountNumber, maybe you have misspelled this field or you have not it in your form?

You can perform var_dump($_REQUEST) to see which fields you are receiving...

Re: Form Submission dropping variables.

Posted: Tue May 19, 2009 4:06 pm
by cpc
Thank you,

Both name and number work as expected in the body of the page.

This is a form that presents the information provided by the URL. The recipient of the form verifies and clicks submit.

It seems that the variables are being stripped when the form is submitted as they no longer appear in the URL. If the Variables are not present in the URL, I CAN submit the from. (Without the needed data of course.) Could this be a php config issue?

Thanks again.