Jump to content

Recommended Posts

Hello I am trying to create a web form that inserts user data. So how it works is that  a user selects a department (departmentQ) from the drop down list and is routed to a second page that displays the people in the selected department in a drop down menu. On this second page users are required to select one of the displayed people and then assign them to specific task and insert it into the database. What I would like to know if there is a way that I can code the page to automatically re-execute the deaprtmentQ query without the user having to physically go back to selecting a department page. 

Any assistance would be greatly appreciated 

You can easily pass DepartmentQ through the second form as a hidden field.

<input type="hidden" name="dept" value="departmentQ">

then

if (second page was submitted test here){
write to database
}
if (isset($_POST['dept']){
//do your query here and redisplay the list of people in Department Q here
}

Pass the first form as $_GET so the department will be in the url.  Then when you post the second form leave the action tag empty and it will post back to the same department cause the url will still hold the department info.

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.