Wrox Programmer Forums
Go Back   Wrox Programmer Forums > PHP/MySQL > Beginning PHP
|
Beginning PHP Beginning-level PHP discussions. More advanced coders should post to the Pro PHP forum.
Welcome to the p2p.wrox.com Forums.

You are currently viewing the Beginning PHP section of the Wrox Programmer to Programmer discussions. This is a community of software programmers and website developers including Wrox book authors and readers. New member registration was closed in 2019. New posts were shut off and the site was archived into this static format as of October 1, 2020. If you require technical support for a Wrox book please contact http://hub.wiley.com
 
Old July 22nd, 2004, 09:00 AM
WIx WIx is offline
Registered User
 
Join Date: Jul 2004
Posts: 4
Thanks: 0
Thanked 0 Times in 0 Posts
Default PHP problem with forms

Hey, I am having a little problem with forms and php on a webpage I am working on. The page is suppose to update people's agendas, I have a dropdown menu that contains the person's department name and agenda dates, with a button next to the dropdown menu. The person selects the contents from the dropdown menu and presses the submit button and then the corresponding information appears in three text boxes below. Simple, you edit the information in the text boxes and press a second submit button at the bottom of the page. This is where the problem occures. After I press the button at the bottom of the page the three text boxes go blank and all the variables seem to go blank (I print some variables at the top of the page. They appear after I press the first button but disappear after I press the second button. So, I assume that they are being cleared.)

All the form tags and button tags have unique names and I have been messing with the forms tags but no matter what I do the second button will not function properly.

Many thanks for any help.

 
Old August 5th, 2004, 08:51 AM
Authorized User
 
Join Date: Jul 2004
Posts: 10
Thanks: 0
Thanked 0 Times in 0 Posts
Default

Once you submit a form, you're going to have to make the data in that form persist for processing the next form submit.
The easiest way to do that is have hidden form fields in the second form.

So say, in your first form you had a listbox named "department", you want the data to persist, so in your second form you put a hidden form value to be taken to the next page:

<input type="hidden" name="department" value="<?php echo($department); ?>">

Also be sure to include the same hidden value in the third form!





Similar Threads
Thread Thread Starter Forum Replies Last Post
manipulating forms with php and javascript Hylsan Beginning PHP 0 April 20th, 2007 09:11 AM
using forms in php macrocosm Beginning PHP 6 June 21st, 2006 03:08 AM
PHP & Forms: stopping spam and multiple posts stephen_c_ Beginning PHP 1 July 28th, 2005 02:36 PM
Displaying Multiple forms on same php page wokoci PHP How-To 0 August 17th, 2004 06:53 AM





Powered by vBulletin®
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.
Copyright (c) 2020 John Wiley & Sons, Inc.