Code Comments

Programming Forum and web based access to our favorite programming groups.
For Programmers: Free Programming Magazines | New: Database administration forum
Registration is free! Edit your profileCalendarFind other membersFrequently Asked QuestionsSearch -> 
Post New Thread











Thread
Author

Help!!!
This is driving me absolutely nuts!!!  I have a page that has
some checkboxes that will cause a database update for the selected
items.  This page is a self referencing form page that never seems to
work.  I have no idea what I am doing wrong.  Here are the code portions
that I think are relevant.

This is the top of the page here:
<?php
while(isset($entry[0])) {
$redir =3D "set";
$tmp =3D $entry[0];
$update =3D "UPDATE accounts SET ctime=3DNOW() WHERE =
id_sys=3D'".$tmp."'";
$results =3D mysql_query($update, $Prod) or die(mysql_error());
array_shift($entry);
}
while(isset($all[0])) {
$redir =3D "set";
$tmp =3D $all[0];
$update =3D "UPDATE accounts SET ctime=3DNOW() WHERE =
id_sys=3D'".$tmp."'";
$results =3D mysql_query($update, $Prod) or die(mysql_error());
array_shift($entry);
}
if (isset($redir)) {
header('Location: link address');
}

$SBCUID =3D $_GET['SBCUID'];  < This is the point at which some queries
build the page content
<<... Lots of stuff clipped ...>>
<Here is the guts of what builds the check
boxes.  Everything displays properly>
<form method=3Dpost action=3D"user_details.php">
<?php while ($list2 =3D mysql_fetch_assoc($requests_accounts)) {
$all[] =3D $list2['id_sys']; ?>
<tr bgcolor=3D"#CCCCCC">
<td><div align=3D"center"><?php echo $list2['system']; ?> 
</div></td>
<td><div align=3D"center"><?php echo $list2['gid']; ?> 
</div></td>
<td><div align=3D"center"><?php echo $list2['shell']; ?> 
</div></td>
<td><div align=3D"center"><?php echo $list2['rtime']; ?> 
</div></td>
<td><div align=3D"center"><?php echo $list2['atime']; ?> 
</div></td>
<td><div align=3D"center"><input name=3D"entry[]" type=3Dcheckbox
value=3D<?php echo $list2['id_sys']; ?>></div></td>
</tr>
<?php  } ;?>
</table>
<div align=3D"center">
<input type=3Dsubmit value=3D"Update"><input name=3D"all[]" =
type=3Dsubmit
value=3D"Update All">
</div>
</form>

The initial load of the page displays everything properly.  The
problem is when I hit the "Update" or "Update All" buttons the page
reloads, but never actually makes it into the database update loops.  I
cannot figure out what I am doing wrong here.  I have used this kind of
code before and I am at a complete loss as to the problem.  Please help
so I can actually get past this and onto some realy work.  Thanks in
advance.

Scott Nipp
Phone:  (214) 858-1289
E-mail:  sn4265@sbc.com
Web:  http:\\ldsa.sbcld.sbc.com

Report this thread to moderator Post Follow-up to this message
Old Post
Scott V Nipp
05-19-05 01:55 AM


Sponsored Links




Last Thread Next Thread Next
Search this forum -> 
Post New Thread

PHP DB archive

Show a Printable Version Send to friend Email This Page to Someone! subscribe to this thread Receive updates to this thread
Computer Consultants
Programming Jobs
Visual Basic Controls
SQL Server Programming
Webservices
Java Security
Visual Studio
C# Programming
Visual J++
Software engineering
Open source Software
Perl Programming
PHP Programming
ASP Programming
ASP .NET Programming
Visual Basic Programming
Windows Scripting Host
Java Programming
Java Help
Java Beans
VBScript
Cobol
MAC Applications
Unix Programming
Forum Jump:
All times are GMT. The time now is 10:12 AM.

 
Free MCSE Braindumps | Real Estate Topics

Programming forum archive

Copyrights CodeComments.com 2004 - 2006

Powered by vBulletin Copyright 2000-2006 Jelsoft Enterprises Limited.