rscott7706 Posted July 9, 2008 Share Posted July 9, 2008 Pardon me if this has been answered, I searched on several key words and did not find an answer. I am setting up a database that a non-profit can post their own news articles. Here is the structure: Type Collation id int(3) event varchar(255) link varchar(255) date_added timestamp delete_date date I want to have the "link" field contain the page link (ie http:/www.somewhere.com) the user will be directed to. But, I would like a generic title to appear (instead of the address itself) - like "Go to this Link". In other words, the PHP coding would make the words "Go to this Link" appear on the web page, but link to the link contained in the database link field. I hope I explained that well, and someone can help. Thanks in advance!! Ron Quote Link to comment Share on other sites More sharing options...
thatsgreat2345 Posted July 9, 2008 Share Posted July 9, 2008 printf('<a href="%s">Go to this link</a>',$link_variable); Quote Link to comment Share on other sites More sharing options...
rscott7706 Posted July 9, 2008 Author Share Posted July 9, 2008 OK, would link_variable in printf('<a href="%s">Go to this link</a>',$link_variable); just be "link" referring to the field link in the database? Or am I confused on it's intention? Ron Quote Link to comment Share on other sites More sharing options...
thatsgreat2345 Posted July 10, 2008 Share Posted July 10, 2008 Yes , you would get what ever link is in the database. It seems as if you want to just make a regular link to a site. So yes the $link_variable refers to the link in the database. In the statement you posted you closed the a tag with [/url] which that is BBCODE for forums and is not HTML syntax. Quote Link to comment Share on other sites More sharing options...
rscott7706 Posted July 10, 2008 Author Share Posted July 10, 2008 Thanks thatsgreat2345!! Quote Link to comment 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.