tags:

views:

19

answers:

1

would it be possible to pass the contents of var reason to action=report?

function redirectConfirm(url)
{

var msg = "Are you sure?";
var reason = prompt("Reason");

if (confirm(msg))
{
    location.href=url;
}
}

And link

<a onClick="javascript:redirectConfirm('thread.php?id=$id&action=report');">Report post</a>
A: 

You can pass it as query string:

location.href=url + '&reason='  + reason;

Later in PHP, you can get it through $_GET:

$_GET['reason'];
Sarfraz
smart! thanks alot!
jim
@jim: You are welcome...
Sarfraz
... but if it solved your problem, please mark the answwer as *Accepted*.
MvanGeest