Re: everything printed suddenly has blue text, as if were a link

From: Date: Thu, 26 Apr 2007 11:31:14 +0000
Subject: Re: everything printed suddenly has blue text, as if were a link
References: 1  Groups: php.general 
Request: Send a blank email to php-general+get-253843@lists.php.net to get a copy of this message
Thufir wrote:
When I print out my list of apartments, everything after <http://vancouver.craigslist.org/apa/318594679.html>, which is grabbed via <http://code.google.com/p/feed-on-feeds/> is suddenly blue. So, the first few are fine, have black text, after that it's all blue. Do I put some html in the loop to make sure that the color is blue? seems kinda silly. [root@localhost ~]# [root@localhost ~]# cat /var/www/html/apartments.php -n
     1  <html>
     2  <head><title>apartments</title></head>
     3  <body>
     4  <?php
     5          $user="feeds";
     6          $host="localhost";
     7          $password="password";
     8          $database = "feeds";
     9              10          $connection = mysql_connect($host,$user,$password)
    11                  or die ("couldn't connect to server");
    12          $db = mysql_select_db($database,$connection)
    13                  or die ("Couldn't select database");
    14              15          $query = "SELECT id, link, title, content FROM px_items WHERE
feed_id=1 ORDER BY id DESC";
    16          $result = mysql_query($query)
    17          or die ("Couldn't execute query.");
    18
    19
    20          $count =1;
    21
    22          while ($row = mysql_fetch_array($result))     23          {
    24                  extract ($row);
    25
    26                  echo "<big><big><b>";
    27                  echo $id;
    28                  echo "</b></big></big>";
    29
    30                  echo "<br>";
    31                  echo $title;
    32
    33                  echo "<br>";
    34                  echo $content;
    35                  echo "<br>";
    36
    37                  echo "<a href=\"";
    38                  echo $link;
    39                  echo "\">";
    40                  echo $link;
    41                  echo "</a>";
    42
    43                  echo "<br><br>";
    44
    45          }//while
    46  ?>
    47  </body>
    48  </html> [root@localhost ~]# [root@localhost ~]# date
Wed Apr 25 19:23:20 BST 2007 [root@localhost ~]# thanks, Thufir
sorry i may not have the answer but i couldn't help but notice you are over using the double quote: ". try using ' when echoing html.

« previous php.general (#253843) next »