Lee-Bartlett Posted October 24, 2008 Share Posted October 24, 2008 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'; ?> Link to comment https://forums.phpfreaks.com/topic/129975-solved-using-varibles-creating-unesscary-space/ Share on other sites More sharing options...
discomatt Posted October 24, 2008 Share Posted October 24, 2008 $link = mysql_connect('localhost','root', 'prodr192664'); Slick. might wanna change that. Try urlencode() Link to comment https://forums.phpfreaks.com/topic/129975-solved-using-varibles-creating-unesscary-space/#findComment-673845 Share on other sites More sharing options...
Lee-Bartlett Posted October 24, 2008 Author Share Posted October 24, 2008 nah it was fine, it was my db, it was text instead of varchar Link to comment https://forums.phpfreaks.com/topic/129975-solved-using-varibles-creating-unesscary-space/#findComment-673875 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.