Undefined offset: 1

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

    Undefined offset: 1

    Hi All,

    I am moving some php code from a Linux machine to a Windows 2000 machine
    with the code belowe I get the following error :

    Notice: Undefined offset: 1 in c:\inetpub\wwwr oot\test.php on line 5

    1) reset($kolom1);
    2) while(list($cat ,$lnk) = each($kolom1)){
    3) kop($cat);
    4) while(list($nam e,$href) = each($lnk)){
    5) list( $name, $status) = split( '[,]',$name);
    6) links($name,$hr ef,'n',$status) ;
    7) }
    8) footer();
    9) }


    On the Linux server there is no problem but now on the Windows 2000 server
    there is.
    Anybody got a clue what could be wrong here??

    Thanks!


  • Jason

    #2
    Re: Undefined offset: 1

    "Steven" <news@emailme.n u> wrote in message news:3f6479e1$1 @news.nb.nu...[color=blue]
    > Hi All,
    >
    > I am moving some php code from a Linux machine to a Windows 2000 machine
    > with the code belowe I get the following error :
    >
    > Notice: Undefined offset: 1 in c:\inetpub\wwwr oot\test.php on line 5
    >
    > 1) reset($kolom1);
    > 2) while(list($cat ,$lnk) = each($kolom1)){
    > 3) kop($cat);
    > 4) while(list($nam e,$href) = each($lnk)){
    > 5) list( $name, $status) = split( '[,]',$name);
    > 6) links($name,$hr ef,'n',$status) ;
    > 7) }
    > 8) footer();
    > 9) }
    >
    >
    > On the Linux server there is no problem but now on the Windows 2000 server
    > there is.
    > Anybody got a clue what could be wrong here??
    >
    > Thanks!
    >
    >
    >[/color]

    The split is failing. I don't know if this is the problem, but try changing
    line 5 to

    list( $name, $status) = split( ',',$name);



    Comment

    • Jason

      #3
      Re: Undefined offset: 1

      "Jason" <jsumner1@cfl.r r.com> wrote in message
      news:yZ_8b.1926 1$kX.7484@twist er.tampabay.rr. com...[color=blue]
      > "Steven" <news@emailme.n u> wrote in message news:3f6479e1$1 @news.nb.nu...[color=green]
      > > Hi All,
      > >
      > > I am moving some php code from a Linux machine to a Windows 2000 machine
      > > with the code belowe I get the following error :
      > >
      > > Notice: Undefined offset: 1 in c:\inetpub\wwwr oot\test.php on line 5
      > >
      > > 1) reset($kolom1);
      > > 2) while(list($cat ,$lnk) = each($kolom1)){
      > > 3) kop($cat);
      > > 4) while(list($nam e,$href) = each($lnk)){
      > > 5) list( $name, $status) = split( '[,]',$name);
      > > 6) links($name,$hr ef,'n',$status) ;
      > > 7) }
      > > 8) footer();
      > > 9) }
      > >
      > >
      > > On the Linux server there is no problem but now on the Windows 2000[/color][/color]
      server[color=blue][color=green]
      > > there is.
      > > Anybody got a clue what could be wrong here??
      > >
      > > Thanks!
      > >
      > >
      > >[/color]
      >
      > The split is failing. I don't know if this is the problem, but try[/color]
      changing[color=blue]
      > line 5 to
      >
      > list( $name, $status) = split( ',',$name);
      >
      >
      >
      >[/color]

      Let me be more specific...the split isn't exactly failing, but it's not
      giving the list() 2 elements to work with.


      Comment

      Working...