News script


Posted on 16th Feb 2014 07:03 pm by admin

Hi ...

I am not sure if this is the rite place to post this but if its not sorry

i am new here and need help with my cricket scores script now the code works well i just cant get the next or prev to work

so when i click next it stays on the same page with the same items this is my code

Code: <?php
$ShowBookmark = "False";
include 'Include/Header.php';
?>
<div class="hd2"><center><font face="Verdana" size="3"><b>Daily Cricket News</b></font></center></div>
<?php

extract($_REQUEST);

$feed = "http://content-www.cricinfo.com/rss/content/feeds/news/0.xml";
$fp = @fopen($feed,"r");
if(!$fp)
{
echo"Cannot Connect to read info<br/>";
echo"Try Again Later <br/>";
} else
{
while(!feof($fp)) $raw .= @fgets($fp, 4096);
fclose($fp);
if( eregi("<item>(.*)</item>", $raw, $rawitems ) ) {
$items = explode("<item>", $rawitems[0]);

$m4u_items_per_page = 5;
if ($m4u == "")$m4u = "1";
$countfile= count($items);
$countfile=$countfile-2;
$first=($m4u*$m4u_items_per_page)-$m4u_items_per_page;
$m4u_pages = ceil($countfile / $m4u_items_per_page);


$next_arrays=($first+($m4u_items_per_page-1));
if($next_arrays>$countfile)$next_arrays=$countfile;
for ($i=($first); $i <= $next_arrays; $i++) {
eregi("<title>(.*)</title>",$items[$i+1], $title );
eregi("<link>(.*)</link>",$items[$i+1], $url );
eregi("<description>(.*)</description>",$items[$i+1], $description);
eregi("<pubDate>(.*)</pubDate>",$items[$i+1], $pubDate);


$url[1] = str_replace("<![CDATA[", "", $url[1]);
$url[1] = str_replace("]]>", "", $url[1]);
$url[1] = str_replace("<![CDATA[", "", $url[1]);
$title[1] = str_replace("'", "", $title[1]);
$title[1] = str_replace("&amp;", "&", $title[1]);
$title[1] = str_replace("&lt;", "<", $title[1]);
$title[1] = str_replace("&gt;", ">", $title[1]);
$title[1] = str_replace("<![CDATA[", "", $title[1]);
$title[1] = str_replace("]]>", "", $title[1]);
$description[1] = str_replace("&amp;", "&", $description[1]);
$description[1] = str_replace("&lt;", "<", $description[1]);
$description[1] = str_replace("&gt;", ">", $description[1]);
$description[1] = str_replace("'", "'", $description[1]);
$description[1] = str_replace("<![CDATA[", "", $description[1]);
$description[1] = str_replace("]]>", "", $description[1]);


echo '<font face="Verdana" size="2"><u><b> '.$title[1].'</font></u></b>
';
echo '<font face="Verdana" size="2">'.$description[1].'</font>

';

}
}
}

if ($m4u_pages>1) {

echo "<hr/>";
echo "Page {$m4u} of {$m4u_pages}<br/>";
}
if ($m4u <= $m4u_pages and $m4u>1) $m4u_prew = '<a href="news.php?npage='.($m4u-1).'"><- prev<br/></a> ';
if ($m4u_pages > 1 and $m4u<$m4u_pages) $m4u_next = ' <a href="news.php?npage='.($m4u+1).'">next -></a>';
if ($m4u_pages>1) {
echo "<b>".$m4u_prew.$m4u_next."</b><br/>";
}
?>

<div class="menu">


</div>
<tr style="font-color:#85859c;"><td style="width:10px;"><img src="Images/Logos/Logo_Back.gif"></td><td>
<font face="Verdana" size="2"><b><a href="index.php?cmd=100">Back</b></font></a>

</td></tr>
</table>
<hr>

<?php include 'Include/Footer.php'; Log_Hit("CricketNews"); ?>

123 Like 25 Dislike
Previous php-forum Next php-forum
Other php-forum

$action = "insert"; //$action = $_GET['action'];
$action = "insert";
//$action = $_GET['action'];

why is this invalid type? I am

mysql timestamp manipulation
How could I use a timestamp (e.g 2009-10-30 13:20:35 ), and with php find out if it is:

from

Form validation with functions
Hi there

I am trying to make a very simple form validation function. I currently have the fol

Simpler method of getting variables from mysql
Hi Guys,

I'm trying to streamline my CMS's code and as I was writing a new page it occured to

whats wrong with my code please help!!!
this is the error


Warning: mysql_close(): supplied argument is not a valid MySQL-Link res

Help with Hyperlink
Hi,

What I am trying to do may be simple, I just can't get it to work. Ok...

I am usin

How to add functionality to a simple php calender?
Hello everyone,

I have just finished creating a simple php calander. Can someone point

Not "Just Another" MMORPG - text based.
Hello,

I've been learning MySQL and PHP for the last 2-3 years.
Though, I've had long paus

Multiple Do / While Statements?
I'm still very new to PHP, and running in to a problem when trying to execute a do/while loop inside

How to get variable value on next page
Hello friends
i am working on payentry page ..there i have this code.........

Sign up to write
Sign up now if you have flare of writing..
Login   |   Register
Follow Us
Indyaspeak @ Facebook Indyaspeak @ Twitter Indyaspeak @ Pinterest RSS



Play Free Quiz and Win Cash