Getting repeated id in url

hi all

i want to fetch “ord” from


http://localhost/repair_mobile_form/?ord=403

in php i have code


<?
$order_id=$_REQUEST['ord'];
if(isset($_REQUEST['submit']))
{
echo "<script language='javascript'>";
echo "var url = window.location.href.toString()";
echo "\
";
echo "var id = url.match(/\\?ord=(\\d+)/)";
echo "\
";
echo "window.location='http://localhost/repair_mobile_review/' + id";
echo "</script>";
}
?>

but this code redirects the url to


http://localhost/repair_mobile_review/?ord=403,403

why am i getting two repeating id’s in url

vineet

Use id[1] instead of id in the penultimate line, to get just the part matched by the parenthesised expression. The variable id is an array.

thanks Autistic

it worked as needed

vineet