POST variables not getting set
Posted: Tue Jun 27, 2006 6:14 pm
feyd | Please use
feyd | Please use
Code: Select all
,Code: Select all
and [syntax="..."] tags where appropriate when posting code. Your post has been edited to reflect how we'd like it posted. Please read: [url=http://forums.devnetwork.net/viewtopic.php?t=21171]Posting Code in the Forums[/url] to learn how to do it too.[/color]
Wassup all,
I am writing a simple reporting system that updates a status and records the date it was updated. The problem i'm running into is that my POST variables are not being set. I cannot figure out why. The page is in an iframe and it submits the form data to itself. However, I have tried testing it outside of iframes and submitting to separate pages but still get the same problem. PLEASE HELP!! Here is the necessary code from my update page.Code: Select all
$editFormAction = $_SERVER['PHP_SELF'];
if (isset($_SERVER['QUERY_STRING'])) {
$editFormAction .= "?" . htmlentities($_SERVER['QUERY_STRING']);
}
if ((isset($_POST["MM_update"])) && ($_POST["MM_update"] == "status")) {
mysql_select_db($database_DB_bonghead, $DB_bonghead);
for ($x=0;x<$_POST['row_count'];$x++) {
$updateSQL = sprintf("UPDATE cases SET status=%s, date_updated=%s WHERE idnum=%s",
GetSQLValueString($_POST['status[$x]'], "text"),
GetSQLValueString($_POST['date_updated[$x]'], "date"),
GetSQLValueString($_POST['idnum[$x]'], "int"));
$Result1 = mysql_query($updateSQL, $DB_bonghead) or die(mysql_error());
}
$updateGoTo = "show_cases.php";
if (isset($_SERVER['QUERY_STRING'])) {
$updateGoTo .= (strpos($updateGoTo, '?')) ? "&" : "?";
$updateGoTo .= $_SERVER['QUERY_STRING'];
}
header(sprintf("Location: %s", $updateGoTo));
}
<table width="100%" border="0" cellspacing="0" cellpadding="0">
<form action="<?php echo $editFormAction; ?>" method="POST" enctype="multipart/form-data" name="status" target="_self">
<tr>
<td><table width="100%" border="0" cellspacing="0" cellpadding="0">
<tr>
<th scope="col">Client Name</th>
<th scope="col">Case Type </th>
<th scope="col">Case Status </th>
</tr>
<?php $i=0; ?>
<?php do { ?>
<tr>
<td><div align="center">
<input type="hidden" name="idnum[<?php echo $i; ?>]" value="<?php echo $row_cases['idnum']; ?>" />
<input type="hidden" name="date_updated[<?php echo $i; ?>]" value="<?php date(Y,m,d); ?>" />
<?php echo $row_cases['client_fname']; ?> <?php echo $row_cases['client_lname']; ?></div></td>
<td><div align="center"><?php echo $row_cases['type']; ?></div></td>
<td><div align="center">
<select name="status[<?php echo $i; ?>]">
<option value="Waiting for Profile" <?php if (!(strcmp("Waiting for Profile", $row_cases['status']))) {echo "selected=\"selected\"";} ?>>Waiting for Profile</option>
<option value="Reviewing profile" <?php if (!(strcmp("Reviewing profile", $row_cases['status']))) {echo "selected=\"selected\"";} ?>>Reviewing profile</option>
<option value="Profile signed" <?php if (!(strcmp("Profile signed", $row_cases['status']))) {echo "selected=\"selected\"";} ?>>Profile signed</option>
<option value="Signed profile sent in" <?php if (!(strcmp("Signed profile sent in", $row_cases['status']))) {echo "selected=\"selected\"";} ?>>Signed profile sent in</option>
<option value="Being revised" <?php if (!(strcmp("Being revised", $row_cases['status']))) {echo "selected=\"selected\"";} ?>>Being revised</option>
<option value="Waiting to close" <?php if (!(strcmp("Waiting to close", $row_cases['status']))) {echo "selected=\"selected\"";} ?>>Waiting to close</option>
<option value="Closed" <?php if (!(strcmp("Closed", $row_cases['status']))) {echo "selected=\"selected\"";} ?>>Closed</option>
</select>
</div></td>
</tr>
<?php $i++; ?>
<?php } while ($row_cases = mysql_fetch_assoc($cases)); ?>
</table></td>
</tr>
<tr>
<td><div align="center">
<input name="submit" type="submit" id="submit" value="Update" />
<input type="reset" name="Reset" value="Reset" />
</div></td>
</tr>
<input type="hidden" name="MM_update" value="status" />
<input type="hidden" name="row_count" value="<?php echo $totalRows_cases; ?>" />
</form>
</table>
</body>
</html>
<?php
mysql_free_result($id);
mysql_free_result($cases);
?>feyd | Please use
Code: Select all
,Code: Select all
and [syntax="..."] tags where appropriate when posting code. Your post has been edited to reflect how we'd like it posted. Please read: [url=http://forums.devnetwork.net/viewtopic.php?t=21171]Posting Code in the Forums[/url] to learn how to do it too.[/color]