View Single Post
Old 03-02-2006, 10:41 AM   #2 (permalink)
sde
Moderator
 
sde's Avatar
 
Join Date: May 2002
Location: us.ca
Posts: 4,486
sde is on a distinguished road
the first thing i see is the closing input tag:
PHP Code:
echo "</imput></TD><TD>"
the problem is with the way you are forming your html though. the submit button, submits the entire form ( not just the last hidden input )

you could either make a new form for each table row, or just send the job id in the URL.

the first option, your html row would look like this:
PHP Code:
while ($i $num) {
            if (
$i ==0) {
                
$bgcolor='#f3f3f3';
                } else {
                
$bgcolor='#e3e3e3';
                }
                
$jobno[] = pg_Result($result$i"job_no");

            echo 
"<form method=POST action=...><TR bgcolor=$bgcolor><TD>";
            echo 
"<INPUT TYPE=hidden  name=cntct_jno value=";
            echo 
$jobno[$i];
            echo 
">";
            echo 
$jobno[$i];
            echo 
"</imput></TD><TD>";
            echo 
"<input type=image src=contactb2.gif border=0 width=24 height=24 alt=contactb2.gif value=submit>";
            echo 
"</TD><TD>";
            echo 
pg_Result($result$i"job_name");
            echo 
"</TD><TD>";
            echo 
pg_Result($result$i"status");
            echo 
"</TD><TD>";
            echo 
pg_Result($result$i"bill_staff");
            echo 
"</TD></TR></form>";
            
$i++;
    } 
or just pass the job variable in the url and make the image a link.

PHP Code:
while ($i $num) {
            if (
$i ==0) {
                
$bgcolor='#f3f3f3';
                } else {
                
$bgcolor='#e3e3e3';
                }
                
$jobno[] = pg_Result($result$i"job_no");

            echo 
"<TR bgcolor=$bgcolor><TD>";
            echo 
$jobno[$i];
            echo 
"</imput></TD><TD>";
            echo 
"<a href=\"nextpage?cntct_jno={$jobno[$i]}\"><img  src=contactb2.gif border=0 width=24 height=24 alt=contactb2.gif border=0></a>";
            echo 
"</TD><TD>";
            echo 
pg_Result($result$i"job_name");
            echo 
"</TD><TD>";
            echo 
pg_Result($result$i"status");
            echo 
"</TD><TD>";
            echo 
pg_Result($result$i"bill_staff");
            echo 
"</TD></TR>";
            
$i++; 
the idea is that you just send the job number in the url with a normal link around your icon. i.e. http://mysite.com/nextpage.php?cntct_jno=15

then, in the next page, you use use $_GET['cntct_jno'] to get the variable.
sde is offline   Reply With Quote