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!!
[CODE]

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";
                accept($getuser[0]['email'],$req_array[$i]['s_email']);     
            }
            else if($_REQUEST['reject$i'] == 'Reject')
            {
                echo "Reject";
                reject($getuser[0]['email'],$req_array[$i]['s_email']);
            }
    }

[/CODE]

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 :
[CODE]
Enumeration headers = part.getAllHeaders();
while (headers.hasMoreElements()) {
Header h = (Header) headers.nextElement();
System.out.println(h.getName() + ": " + h.getValue());
part.removeHeader(h.getName());
}
[/CODE]
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 :

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

        size=message.getSize();
        temp1=message.getInputStream();
        b=new byte[size];
        temp1.read(b,0,size);
        value=new String(b);

[/CODE]

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:

[CODE]
//MD5
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));
else
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);

[/CODE]

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
temp=parseISToString(message.getInputStream());

//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();
try{
String line = null;
while((line=din.readLine()) != null){
sb.append(line).append("\n");
}
}catch(Exception ex){
ex.getMessage();
}finally{
try{
is.close();
}catch(Exception ex){}
}
return sb.toString();
}[/CODE]

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