Eğer soruyu yanlış anlamadıysam 7nci soru şu şekilde olamalı
<?php
$topla = 0;
for($i=1; $i<=1000; $i++){
if ($i % 5 == 0 ){
$topla +=$i;
}else if($i % 7 == 0){
$topla +=$i;
}
}
echo "Toplam : <strong>$topla</strong>";
?>
evet doğru anlamışsınız çalışır örneğiniz.