sending a query string to anther page

PHP programming forum. Ask questions or help people concerning PHP code. Don't understand a function? Need help implementing a class? Don't understand a class? Here is where to ask. Remember to do your homework!

Moderator: General Moderators

Post Reply
krraleigh
Forum Commoner
Posts: 86
Joined: Tue Jul 17, 2007 2:52 pm

sending a query string to anther page

Post 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
User avatar
Ziq
Forum Contributor
Posts: 194
Joined: Mon Aug 25, 2008 12:43 am
Location: Russia, Voronezh

Re: sending a query string to anther page

Post 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);
Post Reply