Easy question: Php link

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

Post Reply
jonas89
Forum Newbie
Posts: 5
Joined: Thu Jan 12, 2012 4:28 pm

Easy question: Php link

Post by jonas89 »

I use a local server to test my php. I tried to get links to work with a php document in the html section, but it simply won't become a link. The <a href"http...something">test</a> is in the source code, but it's not registering as a link, just plain text. PHP documents should be able to display that right, it's only html with php on top? I can't figure it, it's the last part of a rss application I made and would appreciate any feedback.
User avatar
pickle
Briney Mod
Posts: 6445
Joined: Mon Jan 19, 2004 6:11 pm
Location: 53.01N x 112.48W
Contact:

Re: Easy question: Php link

Post by pickle »

Post code please <a href"htp:....">test</a> is not valid html. You need an equals sign in there.
Real programmers don't comment their code. If it was hard to write, it should be hard to understand.
jonas89
Forum Newbie
Posts: 5
Joined: Thu Jan 12, 2012 4:28 pm

Re: Easy question: Php link

Post by jonas89 »

Code: Select all

<?php
  include('insideTelecom.php');
?>
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8" />
<title>Untitled Document</title>
</head>

<body>
  <?php
    foreach(fetch_news() as $article) {
	?>
       <a href"<?php echo $article['link']; ?>"><?php echo $article['title']; ?></a>
       <?php echo $article['pubDate']; ?>
    <?php
	};
  ?>
</body>
</html>

Sorry heres the actual code.
User avatar
pickle
Briney Mod
Posts: 6445
Joined: Mon Jan 19, 2004 6:11 pm
Location: 53.01N x 112.48W
Contact:

Re: Easy question: Php link

Post by pickle »

Missing the equals sign
Real programmers don't comment their code. If it was hard to write, it should be hard to understand.
jonas89
Forum Newbie
Posts: 5
Joined: Thu Jan 12, 2012 4:28 pm

Re: Easy question: Php link

Post by jonas89 »

Oh. Dang, thats to easy. Thanks it worked. I guess I've been cooking to long. Your a champion :)
Post Reply