homepage Welcome to WebmasterWorld Guest from 23.22.173.58
register, free tools, login, search, pro membership, help, library, announcements, recent posts, open posts,
Become a Pro Member

Home / Forums Index / Code, Content, and Presentation / PHP Server Side Scripting
Forum Library, Charter, Moderators: coopster & jatar k

PHP Server Side Scripting Forum

    
Add Link to Echo Result
php database query
actolearn



 
Msg#: 4615435 posted 7:51 pm on Oct 8, 2013 (gmt 0)

Example 1 below works:
echo "<p><h2>".$results['title']."</h2>".$results['shortdesc']."</p>";

I need to make the title linkable to the page url. I'm probably putting the ' and " in the wrong places for the link part.

Example 2 I've added the url code but does not work:
echo "<p><h2><a href=http://www.example.com/".$results['url'].".$results['title']."</a>"</h2>".$results['shortdesc']."</p>";

Any help would be appreciated. Thx.

 

actolearn



 
Msg#: 4615435 posted 9:46 pm on Oct 8, 2013 (gmt 0)

A got a response from another forum so I'll just add that below since it worked.

echo '<h2><a href="http://www.example.com/' . $results['url'] . '">' . $results['title'] . '</a></h2><p>' . $results['shortdesc'] . '</p>';

Global Options:
 top home search open messages active posts  
 

Home / Forums Index / Code, Content, and Presentation / PHP Server Side Scripting
rss feed

All trademarks and copyrights held by respective owners. Member comments are owned by the poster.
Home ¦ Free Tools ¦ Terms of Service ¦ Privacy Policy ¦ Report Problem ¦ About ¦ Library ¦ Newsletter
WebmasterWorld is a Developer Shed Community owned by Jim Boykin.
© Webmaster World 1996-2014 all rights reserved