[linuxadmin-l] Web access for .php file?

November 22, 2010

Satyam is close .. but if you want to protect one single file, you need to wrap the lines he/she provided with a directive :

<Files "rep.php">
 AuthType Basic
AuthName "Restricted Files"
AuthUserFile /etc/httpd/htpasswd
Require valid-user
</Files>



[php-l] How to assign appid to the corresponding radio button?

November 3rd, 2010

If he is using a radio button, then all possible values for each instance would have the same name - otherwise it will not function as a radio button, more like a checkbox.

One change I would make to the code is assuming the approved variable is stored in the table as well with approved = 1, pending = 0

<input type="radio" name="approve_<?php echo $row['totalid'];?>" value="1"
     <?php if ($row['approved'] == 1) echo " CHECKED ";?> >Approve
<input type="radio" name="approve_<?php echo $row['totalid'];?>" value="0"
     <?php if ($row['approved'] == 0) echo " CHECKED ";?>>Pending

This will make sure each company has a approve_ID variable