#1
  1. No Profile Picture
    Junior Member
    Devshed Newbie (0 - 499 posts)

    Join Date
    Nov 2000
    Posts
    0
    Rep Power
    0
    I am making a script to display the contents of 5 text files in a table. Here is my code for it:

    <?
    $modelurls = file("modelurls.dat");
    $imgurls = file("imgurls.dat");
    $titles = file("titles.dat");
    $names = file("names.dat");
    $descs = file("descs.dat");

    for($a = 0; $a < count($models); $a++){
    echo "<TABLE BORDER="0" WIDTH="100%"><TR><TD WIDTH="22%" ROWSPAN="2" BGCOLOR="#000000"><A HREF =" ";
    echo $modelurls[$a];
    echo ""><IMG SRC=" ";
    echo $imgurls[$a];
    echo ""></A></TD><TD WIDTH="75%" BGCOLOR="#00EE00"><FONT COLOR="#000000"><B>";
    echo $titles[$a];
    echo " - ";
    echo $names[$a];
    echo "</B></FONT></TD></TR><TR><TD WIDTH="75%" BGCOLOR="#000000"><B>";
    echo $descs[$a];
    echo "</B></TD></TR></TABLE><BR>n";
    }
    ?>

    For some reason, this isnt working. I am not getting any parse errors at all, it just doesnt display anything. Can anyone tell me why it doesnt do anything?

    Thanks

    Jamie
  2. #2
  3. .Net Developer
    Devshed Novice (500 - 999 posts)

    Join Date
    Feb 2000
    Location
    London
    Posts
    987
    Rep Power
    15

    <<
    <?
    $modelurls = file("modelurls.dat");
    $imgurls = file("imgurls.dat");
    $titles = file("titles.dat");
    $names = file("names.dat");
    $descs = file("descs.dat");

    for($a = 0; $a < count($models); $a++){
    >>


    you haven't declare any variable '$models'.right now $models is holding no value.that is why your for loop is not working.Atleast you should try to loop with $modelurls.So it may be something like:

    for($a = 0; $a < count($modelurls); $a++){

    ....





    ------------------
    SR -
    webshiju.com
    www.jobxyz.com-IT Career Portal
    ezipindia.com--WebStudio


    "The fear of the LORD is the beginning of knowledge..."
  4. #3
  5. No Profile Picture
    Junior Member
    Devshed Newbie (0 - 499 posts)

    Join Date
    Nov 2000
    Posts
    0
    Rep Power
    0
    Ah, its always the simple things that let me down, like typing properly...

    Thanks man

    Jamie

IMN logo majestic logo threadwatch logo seochat tools logo