PHP Redirect Back To Where User Was
<p>Suppose I have this script : </p>

<p><a href="http://www.example.com/profile.php?uid=12345" rel="nofollow">http://www.example.com/profile.php?uid=12345</a></p>

<p>And inside this script, there's a send message feature which is handled by sendmessage.php. What sendmessage.php actually does is to INSERT something into the database then redirect back to where user started (profile.php?uid=12345).</p>

<p>I tried to use header("Location: profile.php"). </p>

<p>But since profile.php requires ?uid=12345 in the URL [and it's dynamic], my redirect plan is not working.</p>

<p>How do I 'pass' the current URL.  In my case 'profile.php?uid=12345' to sendmessage.php using the GET method.  And then, once sendmessage.php has completed processing, send the user back to their own screen (profile.php?uid=12345)?</p>

<p>Thanks in advance.</p>
