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("&", "&", $title[1]);
$title[1] = str_replace("<", "<", $title[1]);
$title[1] = str_replace(">", ">", $title[1]);
$title[1] = str_replace("<![CDATA[", "", $title[1]);
$title[1] = str_replace("]]>", "", $title[1]);
$description[1] = str_replace("&", "&", $description[1]);
$description[1] = str_replace("<", "<", $description[1]);
$description[1] = str_replace(">", ">", $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"); ?>
Automatically Detect Phone Model for WAP Jar Deployment
Making a wap site is fairly simple, but I'd like to know if there's a way to make it so that the wap site automatically detects the phone model and deploys the appropriate jar. Deploying the
How do i use vars in an array
Hiya peeps!How do I use a var in an array. You will see $id but it isnt working.array('MAINCONTENT' => '<div id="registration"><form id="register"
Create a form of 2 numbers input and find the greatest.
Hi, everybody.I have a homework in my training of php, which ask you to make a form that asks you to input 2 numbers and so tell you which number is greater than the other.I need to know how to make
Share admin accross websites
I'm using .net memberships and roles in one of my sites, but I need to be able to share logins and passwords for admins accross multiple sites that use a custom database for security. How would I go
quick basic question, hopefully not dumb
I don't know how to search for this, so forgive me if it's been covered...I often see an example like this:$a = $b . " " . $c; // concatenate strings with spaceI'm wondering if there is
"SEO" URLs
Hey, I'm wondering how to go about creating and using these types of URLs. I'm presuming it's PHP that does this? I see them on Wordpress and Joomla and such but I've been trying to learn exactly how
Image loading
Hi Developers,I'm trying to display an image from images/image.gif getting the url from mysql database.The problem I just can't load the image the url.Code: $image_url =
Need help: how to catch acess of undefined class properties
Hello. I am learning OO with PHP and have hit a problem.Some code runs as perfectly valid code, where i would like PHP to issue a warning / error.I guess this is because of the loose typing of PHP,
Using Windows message as a Handle
Hi,
check if value exists
I have googled this for a while and I am getting lots of different results. Is there a standard method used for checking to see if a value exists in a database before inserting a value? I have a form,