scmeeker Posted September 7, 2010 Share Posted September 7, 2010 I'm having a problem with including a list of clickable links. They keep including my website address before the web address instead of the the web address alone. Here is the code I'm using for it. The $item_url is the web address from the database. $content .="<table width=\"700\" height=\"50\" border=\"0\"><tr><td width=\"500\" class=\"titles\"><a href=$item_url target=\"_blank\">$item_title</a></td></tr><tr> <td width=\"400\" class=blackfont>Location: {$item_city}, {$item_state}</td></tr><tr><td class=blackfont>Country: {$item_country}</td></tr><br /> </table>"; Quote Link to comment https://forums.phpfreaks.com/topic/212802-problem-with-url-link/ Share on other sites More sharing options...
objnoob Posted September 7, 2010 Share Posted September 7, 2010 Where is the code that sets $item_url. This may or may not be the cause of your error depending on whether or not $item_url contains any spaces, however, if you use double quotes to enclose your HTML tag attribute values, is a good practice to follow suite. $content .="<table width=\"700\" height=\"50\" border=\"0\"><tr><td width=\"500\" class=\"titles\"><a href=\"$item_url\" target=\"_blank\">$item_title</a></td></tr><tr> <td width=\"400\" class=blackfont>Location: {$item_city}, {$item_state}</td></tr><tr><td class=blackfont>Country: {$item_country}</td></tr><br /></table>"; Quote Link to comment https://forums.phpfreaks.com/topic/212802-problem-with-url-link/#findComment-1108448 Share on other sites More sharing options...
scmeeker Posted September 7, 2010 Author Share Posted September 7, 2010 I found the problem. I needed to include http:// before the $item_url and now its working perfect. Thanks! Quote Link to comment https://forums.phpfreaks.com/topic/212802-problem-with-url-link/#findComment-1108454 Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.