Help - Search - Members - Calendar
Full Version: RSS tutorial help
Codegrrl.com Forums > Script Help > Tutorial Help
forever
Hi I tried to do the RSS tutorial and I get this error

Parse error: parse error, unexpected T_STRING, expecting ',' or ';' in /home/webmedia/public_html/jecgardner/rss.php on line 19

Heres the rss.php page
CODE

<?php

header('Content-type: text/xml');

?>



<rss version="2.0">

<channel>

<title>The Title Of the RSS Feed.</title>

<description>Your description of the rss feed here.</description>

<link>YOURADDRESS/rss.php</link>

<link rel="alternate" type="application/xml" title="<?php echo "Title Of RSS Feed" href="http://www.newmedia.lincoln.ac.uk/jecgardner/rss.php" />?>



<?php



  mysql_connect ('localhost', 'xxxxxx', 'xxxxxx');

mysql_select_db ('hullweb_jgardner');



//build and issue query



$sql ="SELECT * FROM php_blog ORDER BY timestamp";

$result = @mysql_query($sql,$connection)or die(mysql_error());



//create list block of results

while ($row = mysql_fetch_array($result)) {

    $id = $row['id'];

    $title = $row['title'];

    $entry = $row['entry'];

        $entry=strip_tags($entry);

        $entry=ereg_replace(" "," ",$entry);

    $timestamp = $row['timestamp'];

        $timestamp = date("F j, Y");



?>



  <item mmTranslatedValueHiliteColor="HILITECOLOR=%22Dyn%20Untranslated%20Color%22">

  <title><? echo "$title"; ?></title>

  <description><? echo "$entry"; ?></description>

  <pubDate><? echo "$timestamp"; ?></pubDate>

  </item>



<?

  }

?>

</channel>

</rss>


I used codegrrl's tutorial too make my blog which I found very helpful!

Im also trying to do pagination on my blog so if you look at my home page and see an extra entry its coz I havent got the pagination working yet.. Would be cool if this site supplied a tutorial for pagination!

..Anyways. If anyone knows what the problem is with this RSS page please tell me!
Thanks
Kurisutaru
QUOTE(forever @ Jan 27 2007, 08:12 PM) *

Hi I tried to do the RSS tutorial and I get this error

Parse error: parse error, unexpected T_STRING, expecting ',' or ';' in /home/webmedia/public_html/jecgardner/rss.php on line 19


I used codegrrl's tutorial too make my blog which I found very helpful!

Im also trying to do pagination on my blog so if you look at my home page and see an extra entry its coz I havent got the pagination working yet.. Would be cool if this site supplied a tutorial for pagination!

..Anyways. If anyone knows what the problem is with this RSS page please tell me!
Thanks


Change
mysql_connect ('$dbhost', '$dbuser', '$dbpass');
mysql_select_db ('$dbname');

to

mysql_connect ($dbhost, $dbuser, $dbpass);
mysql_select_db ($dbname);


Please read the previous post about this. There are a lot of issues with this RSS feed.
forever
Yes I did read previous post's before asking for help and saw this and tried that.. That doesnt work. I get the same error..
Ive also tried the rss feed tutorial and get this error

XML Parsing Error: junk after document element
Location: http://www.newmedia.lincoln.ac.uk/jecgardner/feed.php
Line Number 2, Column 1:<b>Warning</b>: mysql_connect(): Unknown MySQL Server Host '$localhost' (0) in <b>/home/webmedia/public_html/jecgardner/feed.php</b> on line <b>37</b><br />
^
Vixx
This tutorial has been removed whilst we test it for accuracy.

Sorry. sad.gif
forever
sad.gif

Please can you do a page number tutorial

Ok ive done a search on this site and a few results have came up but nothing specific from codegrrl.
Vixx
What do you mean? A pagination tutorial?
forever
I used your blog tutorial and it works perfectly. I want like 5 entry's on the first page then a link saying go to previous.. you know like
<< 1, 2, ,3 >>

This is my site http://www.newmedia.lincoln.ac.uk/jecgardner/

This is the tutorial I used for the page numbers but it doesnt work yet.. Ill prolly try some others

http://www.phpfreaks.com/tutorials/73/0.php
This is a "lo-fi" version of our main content. To view the full version with more information, formatting and images, please click here.
Invision Power Board © 2001-2008 Invision Power Services, Inc.