Page 1 of 1

sending a query string to anther page

Posted: Wed Nov 12, 2008 1:29 am
by krraleigh
My problem is that when I use the following I am sending a string instead of an int
i.e.
header('Location: findPatient.php?success=1&record=$recordId');

when I echo record on the receiving page it returns: $recordId as a string
when I echo it on the page it is coded on it returns the correct response.

can you advise?

Kevin

Re: sending a query string to anther page

Posted: Wed Nov 12, 2008 1:47 am
by Ziq
If you use (') quotes PHP code inside string don't process

Code: Select all

header('Location: findPatient.php?success=1&record=$recordId');
You should use something like this

Code: Select all

header('Location: findPatient.php?success=1&record='.$recordId);