Maybe you can specify your question with code samples. The first thing I think of is: does you form action contain Get-parameters? Or does it perform a Post? In that case use should question your form with $__POST[variable]. With $__REQUEST[variable] you can look for both Post an Get variables.
((isset(submit)) && (isset(submit)=="Upload file"))
// code here
$qur="select name,lastname from table where id='$result'";
html table tag opened
displaying the output in browser -->first time correctly
------code goes here-------
echo "<form action='page2.php' method='post' enctype='multipart/form-data'>";
echo "<input type='hidden' name='id' value='$pid'>";
echo "<input type='hidden' name='pe' value='$pp'>";
echo "<input type='hidden' name='result' value='$result'>";
echo "<td><input type='file' name='uploaded_file'></td>";
echo "<td><input type='submit' name='Submit' value='Upload file'></td>";
1.first time - displaying the output in the browser correctly from select query(getting the value from gets method -from select query WHERE $id='value').
2.Now - i am clicking submit button
3.displaying the output in the browser incorrectly from select query(NOW get method value become ZERO -displaying all values -from select query WHERE $id='').
i tries the same thing.its working.One more doubt, my exit() function showing error message in new browser window. So only, i am using header(), but this function redirect to PAGE2.PHP(home page) without showing any error message. If any error message means, i wants to stop execution of the script using exit("error message"). but "error message" should display in the same browser window
I don't understand you completely. Do you want the execution to stop if an error message contains any text? Or do you want sonething else? Your script is writing a header - that makes the browser to redirect in this case - and after that your PHP-script-executions is ordered to stop (by calling exit) while writing a message. Both the header and the messages are sent to the visiting client, that is first redirect and after is writing the message.
If you only wants to display the errormessage you should redirect. If you only wants to redirect don't write any message.