When output file shows only text...what's the problem?

Collapse
This topic is closed.
X
X
 
  • Time
  • Show
Clear All
new posts
  • Richard

    When output file shows only text...what's the problem?

    In an attempt to try out some things with php, I have run into a new snag.
    The output file is pure text.
    Basically it's a simple photo gallery using <ul> links to show various
    thumbnails.
    In turn, the thumbnails show a bigger image.
    All on the same page.
    My only possible thinking is that it has something to do with the array
    notation.
    $image =array ( );
    $image[101]="name.jpg";
    Is it correct to say $image = array(999); ??
    As to define 999 items? as in javascript?


    Instead of using the normal 0 starting point, as I figure this is not
    necessary.
    It has worked up to a point, then all of a sudden I get the text output.



  • Senator Jay Billington Bulworth

    #2
    Re: When output file shows only text...what's the problem?

    "Richard" <Anonymous@127. 001> wrote in
    news:cudbsn02i3 9@news1.newsguy .com:
    [color=blue]
    > In an attempt to try out some things with php, I have run into a new
    > snag. The output file is pure text.
    > Basically it's a simple photo gallery using <ul> links to show various
    > thumbnails.
    > In turn, the thumbnails show a bigger image.
    > All on the same page.
    > My only possible thinking is that it has something to do with the
    > array notation.
    > $image =array ( );
    > $image[101]="name.jpg";[/color]

    This should work, for example:

    <?php
    $image = array();
    $image[101] = "name.jpg";
    echo $image[101];
    ?>

    ...should output name.jpg.
    [color=blue]
    > Is it correct to say $image = array(999); ??
    > As to define 999 items? as in javascript?[/color]

    No, in PHP, this would define an array with only one element, the integer
    999.
    [color=blue]
    > Instead of using the normal 0 starting point, as I figure this is not
    > necessary.
    > It has worked up to a point, then all of a sudden I get the text
    > output.[/color]

    What exactly is the text output that you're getting?

    hth


    --
    Bulworth : PHP/MySQL/Unix | Email : str_rot13('f@fu ng.arg');
    --------------------------|---------------------------------
    <http://www.phplabs.com/> | PHP scripts, webmaster resources

    Comment

    • Richard

      #3
      Re: When output file shows only text...what's the problem?

      On Wed, 09 Feb 2005 16:17:28 GMT Senator Jay Billington Bulworth wrote:
      [color=blue]
      > "Richard" <Anonymous@127. 001> wrote in
      > news:cudbsn02i3 9@news1.newsguy .com:[/color]
      [color=blue][color=green]
      >> In an attempt to try out some things with php, I have run into a new
      >> snag. The output file is pure text.
      >> Basically it's a simple photo gallery using <ul> links to show various
      >> thumbnails.
      >> In turn, the thumbnails show a bigger image.
      >> All on the same page.
      >> My only possible thinking is that it has something to do with the
      >> array notation.
      >> $image =array ( );
      >> $image[101]="name.jpg";[/color][/color]
      [color=blue]
      > This should work, for example:[/color]
      [color=blue]
      > <?php
      > $image = array();
      > $image[101] = "name.jpg";
      > echo $image[101];[/color]

      It's a bit more involved than just placing an image on the page.

      [color=blue]
      > ..should output name.jpg.[/color]
      [color=blue][color=green]
      >> Is it correct to say $image = array(999); ??
      >> As to define 999 items? as in javascript?[/color][/color]
      [color=blue]
      > No, in PHP, this would define an array with only one element, the
      > integer
      > 999.[/color]

      Wasn't sure. Thanks.
      [color=blue][color=green]
      >> Instead of using the normal 0 starting point, as I figure this is not
      >> necessary.
      >> It has worked up to a point, then all of a sudden I get the text
      >> output.[/color][/color]
      [color=blue]
      > What exactly is the text output that you're getting?[/color]

      Precisely the same text as the input file.



      Comment

      Working...