Unstoppable Domains

RSS Feed Formats

Spaceship Spaceship
Watch
Impact
10
Which one is better. Currently I am using php RSS feeds. Would xml be the better choice or what?

Thanks
Mayur
 
0
•••
The views expressed on this page by users and staff are their own, not those of NamePros.
.US domains.US domains
XML is the standard form of RSS feeds. Also that XML format is compatible with all major RSS readers.
 
0
•••
XML imho
 
0
•••
0
•••
I want to use XML but Im stuck with PHP cus my feed gets updated automatically off my news srcipt which runs off MySQL.
 
0
•••
0
•••
0
•••
Tx for the correction. I mistyped as I was pulling the info from PC mag.
The double post is totally acceptable, as I often need the extra reminder.:hehe:
 
0
•••
Grrilla said:
Tx for the correction. I mistyped as I was pulling the info from PC mag.
The double post is totally acceptable, as I often need the extra reminder.:hehe:

sorry about that
i intended to correct "thank" with "thanks" ....

:hehe: :hehe:
 
0
•••
Mayur said:
I want to use XML but Im stuck with PHP cus my feed gets updated automatically off my news srcipt which runs off MySQL.


your getting confused

xml and php are two entierley differnt things

xml is a way of storing information
php is a way of processessing instructions for a computer to undetstand
and php connects to mysql to retrive the information

both xml and mysql are data stores.

you can create xml documents with php exactly the same way you do with html.

theres nothing fancy you need to do to make a .xml document as long as it validates correctly its EASY. no really it is, give me a couple of hours and ill train a monkey to create them with its tongue.
 
0
•••
Here is my feed.
http://biggiesmalls.info/news/rss.php

Here is the code to it. If you can tell me how to make it in xml format then Ill send some NP$.

Code:
<?php
header ("Content-type: text/xml");

echo ("<?xml version=\"1.0\" encoding=\"UTF-8\"?>\n");
?>
<rss version='2.0'>
<channel>
<title>Biggie Smalls | The Notorious BIG</title>
<description>News for the infamous rapper, The Notorious BIG</description>
<link>http://biggiesmalls.info/news//rss.php</link>
<language>en-us</language>
<?php
$db_host = "localhost";
$db_name = "biggie_news"; //database name
$db_user = "biggie_news"; //database user
$db_pass = "*****"; //user password

$db_connection = @mysql_pconnect($db_host,$db_user,$db_pass) or die("Sorry, cannot connect to database.");
@mysql_select_db($db_name,$db_connection) or die(dbdown());
$result = mysql_query ("SELECT * FROM `news` ORDER BY `id` DESC LIMIT 0,10 ") or die (mysql_error());

while ($row = mysql_fetch_array ($result)) {
$desc = $row[3];
$desc = str_replace("\n","<br />",$desc);
echo (" <item>
<title>");
echo $row[1];
echo ("</title>
<description>");
echo $desc; //content you want the person to read
echo ("</description>
<link>http://yoursite.com/index.php?article=");
echo $row[0];
echo ("</link>
</item>\n\n");
}
mysql_free_result ($result);
?>
</channel>
</rss>
 
0
•••
its EASY.give me a couple of hours and ill train a monkey to create them with its tongue.
What about Grrillas? I guess I've been giving the code crunchers too much credit if that's all there is to it. :laugh:
 
0
•••
Mayur said:
Here is my feed.
http://biggiesmalls.info/news/rss.php

Here is the code to it. If you can tell me how to make it in xml format then Ill send some NP$.

Code:
<?php
header ("Content-type: text/xml");

echo ("<?xml version=\"1.0\" encoding=\"UTF-8\"?>\n");
?>
<rss version='2.0'>
<channel>
<title>Biggie Smalls | The Notorious BIG</title>
<description>News for the infamous rapper, The Notorious BIG</description>
<link>http://biggiesmalls.info/news//rss.php</link>
<language>en-us</language>
<?php
$db_host = "localhost";
$db_name = "biggie_news"; //database name
$db_user = "biggie_news"; //database user
$db_pass = "*****"; //user password

$db_connection = @mysql_pconnect($db_host,$db_user,$db_pass) or die("Sorry, cannot connect to database.");
@mysql_select_db($db_name,$db_connection) or die(dbdown());
$result = mysql_query ("SELECT * FROM `news` ORDER BY `id` DESC LIMIT 0,10 ") or die (mysql_error());

while ($row = mysql_fetch_array ($result)) {
$desc = $row[3];
$desc = str_replace("\n","<br />",$desc);
echo (" <item>
<title>");
echo $row[1];
echo ("</title>
<description>");
echo $desc; //content you want the person to read
echo ("</description>
<link>http://yoursite.com/index.php?article=");
echo $row[0];
echo ("</link>
</item>\n\n");
}
mysql_free_result ($result);
?>
</channel>
</rss>

that is an rss feed in xml format. youve done want you needed to do.

theres nothing more that needs to be done to it. ive addeded to my xml reader (thunderbird) and its working/validating fine.
 
0
•••
Ah nvm. You misunderstood me but w/e lol
 
0
•••
Mayur, just use .htacces and rename the rss.php to rss.xml ;)
 
0
•••
Yes thats what I wanted to do. Alrite lemme search google real quick cus im not good with htacess.
 
0
•••
Code:
RewriteEngine on
RewriteRule ^rss.xml rss.php

make a txt file rename it to .htaccess

upload in public_html dir and it should be working. unless your host hasnt got mod_rewrite installed
 
0
•••
Sweet. I am finnaly done with my news script. Now to work on a gallery script which shouldnt be hard at all :D
http://biggiesmalls.info
 
0
•••
Dynadot โ€” .com Registration $8.99Dynadot โ€” .com Registration $8.99
Appraise.net
Unstoppable Domains
Domain Recover
DomainEasy โ€” Zero Commission
  • The sidebar remains visible by scrolling at a speed relative to the pageโ€™s height.
Back