Passing variable via form
Posted: Wed Jul 27, 2005 3:56 pm
This is kind of confusing, but I'll try my best to explain. I allow a user to view thier posted housing ads at the same time (say they have two ads). At the bottom of each ad, there are two links that say "EDIT AD DELETE AD."
For example, if the user clicks on the "EDIT" link of the first ad, that PHP file (view_ads.php) sends a "file id" of 1 through the link to the edit.php file. Now, we are at the actual file where you make changes to your ad and then click submit. My problem, after I click "submit" button on my form (using PHP SELF to redirect back to a specific block of code still within the edit.php file), I lose the "file id" that I need.
How can I pass a variable within the "action" command of the form to the new block of code within that same file?
Thanks for any help, I can post my code if needed.
For example, if the user clicks on the "EDIT" link of the first ad, that PHP file (view_ads.php) sends a "file id" of 1 through the link to the edit.php file. Now, we are at the actual file where you make changes to your ad and then click submit. My problem, after I click "submit" button on my form (using PHP SELF to redirect back to a specific block of code still within the edit.php file), I lose the "file id" that I need.
How can I pass a variable within the "action" command of the form to the new block of code within that same file?
Thanks for any help, I can post my code if needed.