in reply to Re: CGI DBI refining results
in thread CGI DBI refining results

for the above code example i have selected from the database employees. So with the drop down menu i want to select the employee i want more information about. When submitted instead of directing to a new script i want to print the information to the same page. Therefore, would i need to add to the url the name of the employye so GET/POST can act onit to print info to same screen?

Replies are listed 'Best First'.
Re^3: CGI DBI refining results
by Delusional (Beadle) on Nov 28, 2005 at 11:31 UTC
    Consider using the hidden in the form. Then put all the information required in hidden elements (its not displayed in the page so only hide what you don't want seen/changed but want the script to receive). When its submitted you can read that. However, your sending the information in a select to your displayResults.pl file. Only the selected name will be sent, and only items within the specific form (you can have more then one form in an html page and each is individual), so if you want the entire select, you'll have to send each line as a hidden or group them all into one hidden and break them down in the script.
Re^3: CGI DBI refining results
by pajout (Curate) on Nov 28, 2005 at 11:40 UTC
    No, you have not add anything into url explicitly, selected employeeID will be sent automatically to server when submit occurs.
    You can add some if-then-else into your script, to recognize, if posted value of employeeID (value of selected option) is empty or not empty. When empty, you can print current version, when nonempty, you can print detail informations about selected employee.
    Now I see simplicity of your question. If you require only this, you can use <form method="GET">, which is better for debugging...