1)I am using _REQUEST[] which includes _GET and _POST. In the IF statement i use the functions accept and reject repsectively in order to update my database. I think it works fine.

2)The email is the primary key, but in which way can i keep it as a hidden value so as every time i push a button only one action is performed and not all of them.

3)Using id in the form what name should i give?

[CODE]echo "<form id =".$i."> some code here... <form>"; [/CODE]

I am new to php and web devopment so excuse me for my unawareness...

Hi there i m having some problems in creating and handling multiple buttons. The idea is that i have two buttons "Accept" and "Reject" and i want to give them differnt names using the variable $i from the for loop. Below i give you the code which shows what i am trying to do. The code has wrong syntax on purpose, in order to depict what i am trying to do!!

for ($i = 0; $i < count_req($getuser[0]['email']); $i++){
echo $req_array[$i]['s_fname']." ".$req_array[$i]['s_lname'];
echo "<form><input type='submit$i' name='accept' value='Accept'>
<input type='submit' name='reject$i' value='Reject'><br></form>";

            echo "Request".count($_REQUEST);
            if($_REQUEST['accept$i'] == 'Accept')
                echo "Accept";
            else if($_REQUEST['reject$i'] == 'Reject')
                echo "Reject";


I just put $i to the name of the button and in the if statement. I want each button to have it's own name, otherwise all the accept and reject buttons work simultaneously. I'm open to any suggestion. Thanks in advance....

Hello i am having a problem in removing all headers from a Part in java mail.The code i use :
Enumeration headers = part.getAllHeaders();
while (headers.hasMoreElements()) {
Header h = (Header) headers.nextElement();
System.out.println(h.getName() + ": " + h.getValue());
The System.out.println gives me right names an values!!But when i use part.removeHeader(h.getName()); nothing seems to be removed!!Has anybody any idea where is the problem or suggest me a new way to remove the Headers??

I found the problem!This is how you turn a MimeMessage to a String :

int size;
InputStream temp1 = null;
String temp = new String();
byte[] b;
String value;

        b=new byte[size];
        value=new String(b);


The value is the String you put in MD5(value) !!!!

I want to compute md5 hash from a MimeMessage type.I use the following code to do this:

private static String convertToHex(byte[] data) {
StringBuilder buf = new StringBuilder();
for (int i = 0; i < data.length; i++) {
int halfbyte = (data[i] >>> 4) & 0x0F;
int two_halfs = 0;
do {
if ((0 <= halfbyte) && (halfbyte <= 9))
buf.append((char) ('0' + halfbyte));
buf.append((char) ('a' + (halfbyte - 10)));
halfbyte = data[i] & 0x0F;
} while(two_halfs++ < 1);
return buf.toString();

   private static  String MD5(String text)    {
    MessageDigest md;
    md = MessageDigest.getInstance("MD5");
    byte[] md5hash = new byte[32];
    md.update(text.getBytes("iso-8859-1"), 0, text.length());
    md5hash = md.digest();
    return convertToHex(md5hash);


The code works perfectly!The problem is with the MimeMessage!I have to turn the MimeMessage into a String and then use md5 code!When the MimeMessage is [B]Multipart[/B] ,every time i close the programm the next gives me a different md5 hash!!!The code i use to turn tha MimeMessage into a String is the following :

[CODE]//This iis an example code
MimeMessage message;
String temp;

//i use it like this message.getInputStream() and then i turn InputStream to a String

//Input stream to a string
public static String parseISToString(java.io.InputStream is){
java.io.DataInputStream din = new java.io.DataInputStream(is);
StringBuilder sb = new StringBuilder();
String line = null;
while((line=din.readLine()) != null){
}catch(Exception ex){
}catch(Exception ex){}
return sb.toString();

If MimeMessage is [B]not[/B] Multipart it works just fine!!Has anybody an idea why this happenning to Multipart MimeMessage??