Page 1 of 1

Passing Variables with URL using JavaScript in PHP

Posted: Fri Mar 19, 2010 6:09 pm
by devarishi
I want to append / pass two variables and their values along with a URL. I have this JavaScript in my PHP page:

Code: Select all

window.location = "rmvContacts.php?srNo=" +' . $srNo . ';
I want to pass $emailID as well but don't seem to put the things together properly.

Code: Select all

$srNo       =   trim($_REQUEST['srNo']);
$emailID    =   trim($_REQUEST['email']);
I tried this method also:

Code: Select all

$srNo .= '&email='.$emailID;
but it didn't work.

I it has to do with the proper use of commas or escape characters. But I am not getting it right.