appending php variables to a html url

Hi,
I have 2 php files located at
www.blossompark.net/firstpage.php
www.blossompark.net/secondpage.php
(code for both files below)
when the link on www.blossompark.net/firstpage.php is used it sends a predefined query string to www.blossompark.net/secondpage.php...
the secondpage.php file creates a variable "coordinates" from the query string.
I now want  to append that data (which is a set of google gps coordinates) to a html url on the same page. I'm having difficulty appending this data which should end up creating the following url;
http://maps.google.com/maps?q=53.290208540067006 -6.274996866083001

Ive tried  putting in on secondpage.php
<a href="http://maps.google.com/maps?q=<?php $_GET['q'] ?> " > Current Location < /a>
put it completely ignores the php
how can i reference the contents of the coordinates variable from within the html url?
thanks ...first time with php and html here...go easy!!!
<html>
	<head>
		<title>First Page</title>
	</head>
	<body>
		<a href="secondpage.php?q=53.290208540067006 -6.274996866083001" >send url from phone simulation
	</body>
</html>


<html>
	<head>
		<title>Second Page</title>
	</head>
	<body>
	<?php  
         print_r($_GET);
         $coordinates = $_GET['q'];
          echo " <br /> $coordinates ";
         ?>
          <br/>
          <a href="http://maps.google.com/maps?q= " >Current Location
	
</body>
</html>

Open in new window

blossomparkAsked:
Who is Participating?

[Product update] Infrastructure Analysis Tool is now available with Business Accounts.Learn More

x
I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

HackneyCabCommented:
Change the embedded PHP statement to this:

<?php echo $_GET['q'] ?>

Without the echo command, PHP doesn't do anything with the value of the $_GET['q'] variable.

Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
Mark BradyPrincipal Data EngineerCommented:
On line 18 you capture the information in the  $coordinates variable so you can use that in your link like this:


?>
<a href="http://maps.google.com/maps?q=<?php echo $coordinates;?>Current Location</a>

Like HackneyCab said, if you don't use "echo" before the variable you want to insert it will do nothing.
blossomparkAuthor Commented:
thanks HackneyCab!! works 100% !!
blossomparkAuthor Commented:
thanks Elvin66...sorry only noticed your reply after having responded to HackneyCab
Mark BradyPrincipal Data EngineerCommented:
No problem
It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today
PHP

From novice to tech pro — start learning today.