Jump to content

[SOLVED] Using varibles creating unesscary space.


Lee-Bartlett

Recommended Posts

My varibles are creating a space in the url and ofc that breaks the url, how do i solve this?

 

My db also has no spaces in the collums name to

 

This is my code.

 

<?php
$link = mysql_connect('localhost','root', 'prodr192664');
if($link && mysql_select_db('nexodom_test'))
  {
  $sql = "select * from tblbasicform limit 1";
  $res = mysql_query($sql);
  $row = mysql_fetch_array($res);

  $addr =
  'http://maps.google.com/staticmap?center='.$row[longitude].','.$row[latitude].'&zoom=12&size=400x400&key=ABQIAAAAgnVrcDn5i-V_BsqvXy3j8RRle8Rt1EK93-n5qGMjk9aCuGqlpBQ2sCqItCc79KzQksp90dVmLGk45w';

header("Expires: Thu, 01 Jan 1970 00:00:01 GMT");
header("Location: $addr");

//echo "We will call this URL: <b>$addr</b>";
//exit();
  }

echo 'Cannot connect to database';
?>

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.