my actual link is
but when i use PHP_SELF it is refreshing and the url turn as
please reply

Recommended Answers

All 4 Replies

This is because all GET variables are lost. The page reloads, so the url is set to the default. If you want to pass GET variables to POST, insert them in hidden fields into the form, then grab them again using POST. Here is a sample:

$get = $_GET['variable'];
<input type="hidden" value="$get" name="get">
     $postedGet = $_POST['get'];

Or simply adding the id again:

<form action='<?php $_SERVER['PHP_SELF'];?>?id=<?php $_GET['id'];?>' method='POST'>

Maybe not pretty, but I hope it gives some clues to what I'm suggesting.

Or maybe put the $_GET variable into a session and fetch it after page reloads.

thanks for your replies
the below code is working for me

<form method="post" name="form2" action="<? echo $_SERVER["REQUEST_URI"]; ?>"
Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.