473,386 Members | 1,803 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,386 software developers and data experts.

Parameter passing to php. can anyone help me debugging the code

Hi,

I want to pass the parameter of employee_id to a page. My code is working fine and passing parameter to page but the problem is rather then the current parameter. It passed the parameter which was selected in previous submit. Below is the code.

Expand|Select|Wrap|Line Numbers
  1. <form action='manager_employee_select.php?proc_employee_id=<?php echo $_POST['proc_employee_id']; ?>' method="POST">
  2. <table>
  3. <tr> My team members timesheet</tr>
  4.  
  5. <tr>Select a team member from the list to continue</tr>
  6. <tr>
  7.  
  8.         <?php
  9.            $conn = pg_connect("host=localhost port=5432 dbname=aim user=postgres password=holiday");
  10.          $result = "select employee_id,first_name || '' || last_name as name from employee where reporting_manager_id = '1113'";
  11.              $result =  pg_query($conn, $result) or die(pg_last_error());
  12.  
  13.  
  14.         ?>
  15.  
  16.         <?php echo "<td name = \"employees\"  >
  17.         <select name=\"proc_employee_id\" id=\"dropdown\" >"; ?>
  18.         <option value=""></option>5
  19.         <?php
  20.  
  21.           while($emps = pg_fetch_assoc($result))
  22.         {
  23.           $val = $emps["employee_id"];
  24.           $caption = $emps["name"]; ?>
  25.         <option value="<?php echo $val ?>"><?php echo $caption ?></option>
  26.         <?php }  ?></select>
  27.             </td>
  28. </tr>
  29. </table>
  30. <input name="submit" value="Continue" type="submit">
  31. </form>
  32.  
Many Thanks in advance
Oct 13 '09 #1
1 2229
zorgi
431 Expert 256MB
The only place I can see that you store anything from the previous page is this:

Expand|Select|Wrap|Line Numbers
  1. <form action='manager_employee_select.php?proc_employee_id=<?php echo $_POST['proc_employee_id']; ?>' method="POST">
  2.  
Every next submit in its url has
Expand|Select|Wrap|Line Numbers
  1. proc_employee_id=<?php echo $_POST['proc_employee_id'] 
  2.  
Oct 13 '09 #2

Sign in to post your reply or Sign up for a free account.

Similar topics

1
by: Radx | last post by:
Hello All I am having a very hard timt exporting crystal report to PDF document in my ASPX page. I am able to generate the PDF document , but the i am not able to pass the parameter to the...
2
by: Nautilus | last post by:
Taken from a couple very similar samples on the net, I'm having trouble passing a parameter to a PHP file. Here's all the JS code ... it creates an image object and modifies it's src to make a...
4
by: Ron Rohrssen | last post by:
I want to show a dialog and when the form (dialog) is closed, return to the calling form. The calling form should then be able to pass the child form to another object with the form as a...
5
by: jlea | last post by:
I'm trying to pass a filename, obtained with using the fileName property from the OpenFileDialog, as a application parameter in Process.StartInfo.Arguments and run a MFC/C++ application using the...
5
by: MS | last post by:
Here's my simple stored procedure: ALTER PROCEDURE GetMemberIDByEmail @Email EmailAddress, @ID int OUTPUT AS SELECT @ID = ID FROM tbl_Member WHERE Email=@Email RETURN
0
by: Radx | last post by:
Hello All I am having a very hard timt exporting crystal report to PDF document in my ASPX page. I am able to generate the PDF document , but the i am not able to pass the parameter to the...
3
by: JohnnyGr | last post by:
I have heard theres a new way to start threads with parameters in framework 2.0, does anyone know how to do that? this is what i need to do... Start a thread that executes some stuff, in this...
3
by: Ross McLean | last post by:
Hi all, I've been teaching myself C# for a new project at work. I have a bit of a background in c++ and java but never been what you could call a guru. I'm having some strange things happening...
16
by: Theo R. | last post by:
Hi all, Does the C99 Standard explicitly mention the need for a stack for passing arguments or Is this platform specific? As an example, the ARM9 processor recommends Core Registers R0-R3 be...
0
by: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.