Page 1 of 1
Easy question: Php link
Posted: Thu Jan 12, 2012 4:36 pm
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.
Re: Easy question: Php link
Posted: Thu Jan 12, 2012 4:42 pm
by pickle
Post code please <a href"htp:....">test</a> is not valid html. You need an equals sign in there.
Re: Easy question: Php link
Posted: Thu Jan 12, 2012 4:45 pm
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.
Re: Easy question: Php link
Posted: Thu Jan 12, 2012 4:47 pm
by pickle
Missing the equals sign
Re: Easy question: Php link
Posted: Thu Jan 12, 2012 4:51 pm
by jonas89
Oh. Dang, thats to easy. Thanks it worked. I guess I've been cooking to long. Your a champion
