<?php
ob_start(); error_reporting(E_ALL); $i=$j=0;
echo "<body bgproperties='fixed' background='pics/anemos.bmp'>";

if (@mysql_connect('localhost', 'nik', 'macgyver'));
else @mysql_connect('localhost', 'root');
mysql_select_db('db_nik');

mysql_query("UPDATE visitor SET i=i+1");
$sql = mysql_query("SELECT i FROM visitor");
$i = mysql_fetch_array($sql);

$f = fopen("data.txt", "r");
$keimeno = fread($f, filesize("data.txt"));

if ($keimeno[$j]=='EOF') {mysql_query("UPDATE visitor SET i=0"); exit;}
?>

<center><table border='1' cellspacing='1' width='80%' id='AutoNumber1' bordercolor='Yellow' style='border-style: solid; border-width: 5' background='pics/brick.jpg'>
<tr>
<td align=left bordercolor='#ffcc00'> <font face='Com' size='4' color='LightBlue'>
<? while ($j<=$i[0]) echo $keimeno[$j++]; ?>
</td>
</tr>
</table>

<?
header("Refresh: 0; URL=http://localhost/test.php");
ob_end_flush();
?>

Everythings seems to work ok but i cannot seem to end the loop when the file ends why?

If u pls help!

    When you do a loop you should have the { } to signify which part of the code you plan on looping.

    <? while ($j<=$i[0]) {
    echo $keimeno[$j++];
    }
    ?>

    Try this.

    -JPS

      lol!!! xaxaxxa but its only one sentence. 1 sentence doesnt require brackets xaxaxa

      Yhanks anyway man!!

        Now that's funny, you can't get your script to work but yet you are laughing at the guy trying to help you out. Man, you'll get some good help like that.

          I was going to point out to you what the problem was... I scrolled down to see if anyone had posted it yet... saw you laughing at someone trying to help... decided you can get bent, and I'll keep the fix for your sloppy script to myself.

            My sentiments exacely codito, the solution to his problem is very simple but since he decided to act like an ass I decided not to help.

              Iam sorry about my act. i didnt mean to make fun of the guy but i was very tenced(excuse my lousy English) trying all day to make my damn script work that when i see that post it got me a nervous lauph because instead of helping me it didnt got me anywhere. I had no intension to be a smart ass ot to make fun of the friend eho tried to help me out!

              Iam really sorry about this....
              Please, accept my apologies 🙁

                Write a Reply...