<title>Contents</title>

I am trying to fetch the title contents of some sample pages i have on my site. I have the following that bring thumnails up

<?
for($i=1;$i<51;$i++) {
?>
<p>
<?=$s?>====<?=$e?>====<?=$e?>
<img src="../downloads/templates/<?=$i?>/thumbshot.jpg" alt="" /></p>
<?
}
?>

I have added the following but it does return the correct values

[code]

$urloftag = fopen("…/downloads/templates/$i/index.html", “r”);
$start = “<title”;
$end = “”;
$s = strpos($start,$start);
$e = strpos($end,$end);
$pos = strlen($s,$e)

?>

[b]<?=$s?>====<?=$e?>[/b]

<? [b]fclose($urloftag);[/b] } ?>[/code]

Does anybody have any suggestion on where I am going wrong.
Any input will be much appreciated

What does this code do?

$s = strpos($start,$start); $e = strpos($end,$end);

Thanks or your reply

I am just playing about with some things and that code doesn’t do anything

I now have

for($i=1;$i<51;$i++) {
    $handle = @fopen("http://mydomain.co.uk/downloads/templates/$i/", "r");
	  $fptext = fread($handle,300);
	  $fptext = str_replace("<","",$fptext);
	  $fptext = str_replace(">","",$fptext);
	  $startnum = strpos($fptext,"title") + 5;
	  $endnum = strpos($fptext,"/title") - $startnum;
	  $hreftitle = substr($fptext,$startnum,$endnum);

It works but for some reason on 2 results it throws up the full html tag

All sorted, heres what I have

<?
for($i=1;$i<51;$i++) {
    $handle = @fopen("http://www.mydomain.co.uk/downloads/templates/$i/", "r");
	  $fptext = fread($handle,1024);
	  $startnum = strpos($fptext,"<title>") + 7;
	  $endnum = strpos($fptext,"</title>") - $startnum;
	  $hreftitle = substr($fptext,$startnum,$endnum);
?>
<p style="background-color:#330099; color:#FFFF00; font-weight:bold; width:200px"><?=$i?>=<?=$hreftitle?></p>
<?
fclose($handle);
}
?>

The 2 errors in the preview script were the title tags where capitals

Sponsor our Newsletter | Privacy Policy | Terms of Service