Using "include"

PHP programming forum. Ask questions or help people concerning PHP code. Don't understand a function? Need help implementing a class? Don't understand a class? Here is where to ask. Remember to do your homework!

Moderator: General Moderators

digdigdig
Forum Newbie
Posts: 20
Joined: Thu Jun 23, 2011 11:10 am
Location: South Florida

Re: Using "include"

Post by digdigdig »

Caught that too! Thanks.

One last thing. When the information renders in the table on the page the website address (www.example.com) does not appear as a hyperlink. Is there any formatting that would make this a link instead of just text?

Again, Thanks.
phphelpme
Forum Contributor
Posts: 261
Joined: Sun Nov 21, 2010 3:32 pm

Re: Using "include"

Post by phphelpme »

Yeah sure,

Code: Select all

echo "<a href=\"http://".$row['Website']."\">".$row['Website']."</a>";
Notice I have placed the http:// in the echo statement so if you already place the http:// reference in your links that are saved to your database then remove the http:// from the above code and everything should work just fine.

If you want them to open up in a new window then use the target="_blank" attribute:

Code: Select all

echo "<a href=\"http://".$row['Website']."\" target=\"_blank\">".$row['Website']."</a>";
Best wishes
digdigdig
Forum Newbie
Posts: 20
Joined: Thu Jun 23, 2011 11:10 am
Location: South Florida

Re: Using "include"

Post by digdigdig »

Yeah! Very exciting when everything works!!
Post Reply