At the moment i have a form with a number of checkboxes that enables a user to delete entries. These checkboxes are uniquely identified using the 'oid' number that Postgres generates using the following code:
<?php
$result = pg_Exec("select oid, * from exception");
$num = pg_NumRows($result);
for ($i=0; $i<$num; $i++) {
$row = pg_Fetch_Array($result, $i);
?>
<TR>
<TD><INPUT TYPE = 'checkbox'
name ="<?php echo $row['oid'] ; ?>"
VALUE='ON'></TD>
<TD><?php echo $row['exception_id'] ; ?></TD>
</TR>
<?php
}
?>
this information is then passed to another script that checks if the 'oid' is on and deletes it:
<?php
$result = pg_Exec("select oid, * from exception");
$num = pg_NumRows($result);
for ($i=0; $i < $num; $i++) {
$row = pg_Fetch_Array ($result, $i);
$oid = $row['oid'];
if (($$oid) && ($$oid == 'ON')) {
$result2 = pg_Exec("delete from exception where oid = '$oid' ");
}
}
?>
Although this works fine i would like to use the variable $exception_id string to uniquely identify each of the checkboxes,which is of the form "DE/1999/MJC/00029" and i am having trouble with the '/' in the string. I have tried urlencode and urldecode with no success
Any help would be most apprecaited.