Jump to content

problem with url link


scmeeker

Recommended Posts

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>";

Link to comment
https://forums.phpfreaks.com/topic/212802-problem-with-url-link/
Share on other sites

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>";

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.