Hello,
I have a script that I use inside a html page. I don't want the script to be part of the page....I just want to include it in the html but i don't know how to reference it:
I assume that I have to sane the php code as something.php and then reference it....but i am not sure how to....
here is the table:
<table class=design cellspacing=0 cellpadding=0 width=90%>
<tr><th colspan=2>Today's Projects</th></tr>
<tr><td>
<?php
$xmlfile = fopen("http://www.sonicfreelance.com/rss_sonic.php?t=0", "r");
if(!$xmlfile)die("script not functioning");
$readfile = fread($xmlfile ,40000);
$searchfile = eregi("<item>(.*)</item>", $readfile ,$arrayreg);
$filechunks = explode("<item>", $arrayreg[0]);
$count = count($filechunks);
for($i=1 ; $i<=$count-1 ;$i++)
{
$color = ($i%2==0)?'FFFFFF':'F7F7F7';
/**
* Place the $color variable wherever you need to
* to color the row. Not sure of the complete output,
* so I don't know where you want it to go.
*/
ereg("<title>(.*)</title>",$filechunks[$i], $title);
ereg("<link>(.*)</link>",$filechunks[$i], $links);
echo "<div style='background-color: #$color'>";
echo "<a href ='$links[1]'>$title[1]</a>";
echo "</div>";
}
?>
</td></tr>
</table>
here is the script that i want to pull out and just include:
<?php
$xmlfile = fopen("http://www.sonicfreelance.com/rss_sonic.php?t=0", "r");
if(!$xmlfile)die("script not functioning");
$readfile = fread($xmlfile ,40000);
$searchfile = eregi("<item>(.*)</item>", $readfile ,$arrayreg);
$filechunks = explode("<item>", $arrayreg[0]);
$count = count($filechunks);
for($i=1 ; $i<=$count-1 ;$i++)
{
$color = ($i%2==0)?'FFFFFF':'F7F7F7';
/**
* Place the $color variable wherever you need to
* to color the row. Not sure of the complete output,
* so I don't know where you want it to go.
*/
ereg("<title>(.*)</title>",$filechunks[$i], $title);
ereg("<link>(.*)</link>",$filechunks[$i], $links);
echo "<div style='background-color: #$color'>";
echo "<a href ='$links[1]'>$title[1]</a>";
echo "</div>";
}
?>
thanks,
Ned