PHP Configuration Problems

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

    PHP Configuration Problems

    Hi

    I have been successfully running db driven websites on my ISPs webserver
    using PHP Version 4.2.3.for a while now.

    I am now experimenting with running mysql/php on my lap-top so I can access
    these sites without being connected to the internet.

    I have downloaded the latest binaries for MySQL and PHP and they are running
    on the laptop with IIS5.1.

    However, when I use the code that was running correctly on my ISPs webserver
    on the LOCALHOST...

    $logged_on_memb er_id=$_SESSION['s_member_id'];
    $logged_on_memb er_name=$_SESSI ON['s_member_name'];

    Throws up the following error messages...

    Notice: Undefined index: s_member_id in membervariables .php on line 2
    Notice: Undefined index: s_member_name in membervariables .php on line 3

    What have I done differently/incorrectly/badly???

    TIA

    Mark





  • Tomislav Petrovic

    #2
    Re: PHP Configuration Problems

    If this is bad or not is a matter of taste....
    I usually try to avoid warnings and notices in my code
    which sometimes can result in few lines of code more
    but at least I know exactly what is going on.

    What is different is that your localhost is set to display
    notices and warnings while your ISP is not...

    Check your php.ini directive error_reporting .

    Tomy.

    Mark wrote:[color=blue]
    > Hi
    >
    > I have been successfully running db driven websites on my ISPs
    > webserver using PHP Version 4.2.3.for a while now.
    >
    > I am now experimenting with running mysql/php on my lap-top so I can
    > access these sites without being connected to the internet.
    >
    > I have downloaded the latest binaries for MySQL and PHP and they are
    > running on the laptop with IIS5.1.
    >
    > However, when I use the code that was running correctly on my ISPs
    > webserver on the LOCALHOST...
    >
    > $logged_on_memb er_id=$_SESSION['s_member_id'];
    > $logged_on_memb er_name=$_SESSI ON['s_member_name'];
    >
    > Throws up the following error messages...
    >
    > Notice: Undefined index: s_member_id in membervariables .php on line 2
    > Notice: Undefined index: s_member_name in membervariables .php on line
    > 3
    >
    > What have I done differently/incorrectly/badly???
    >
    > TIA
    >
    > Mark[/color]


    Comment

    • Mark

      #3
      Re: PHP Configuration Problems

      Thanks for your reply Tomy

      This solved many of my problems.

      I also had to set register_global s to ON to get the site working properly.

      I hadn't realised my code was so sloppy

      Thanks again

      Mark


      "Tomislav Petrovic" <t.petrovic@ine t.hr> wrote in message
      news:bpfbn6$msn $1@brown.net4u. hr...[color=blue]
      > If this is bad or not is a matter of taste....
      > I usually try to avoid warnings and notices in my code
      > which sometimes can result in few lines of code more
      > but at least I know exactly what is going on.
      >
      > What is different is that your localhost is set to display
      > notices and warnings while your ISP is not...
      >
      > Check your php.ini directive error_reporting .
      >
      > Tomy.
      >
      > Mark wrote:[color=green]
      > > Hi
      > >
      > > I have been successfully running db driven websites on my ISPs
      > > webserver using PHP Version 4.2.3.for a while now.
      > >
      > > I am now experimenting with running mysql/php on my lap-top so I can
      > > access these sites without being connected to the internet.
      > >
      > > I have downloaded the latest binaries for MySQL and PHP and they are
      > > running on the laptop with IIS5.1.
      > >
      > > However, when I use the code that was running correctly on my ISPs
      > > webserver on the LOCALHOST...
      > >
      > > $logged_on_memb er_id=$_SESSION['s_member_id'];
      > > $logged_on_memb er_name=$_SESSI ON['s_member_name'];
      > >
      > > Throws up the following error messages...
      > >
      > > Notice: Undefined index: s_member_id in membervariables .php on line 2
      > > Notice: Undefined index: s_member_name in membervariables .php on line
      > > 3
      > >
      > > What have I done differently/incorrectly/badly???
      > >
      > > TIA
      > >
      > > Mark[/color]
      >
      >[/color]


      Comment

      • Tomislav Petrovic

        #4
        Re: PHP Configuration Problems

        Mark wrote:[color=blue]
        > Thanks for your reply Tomy
        > This solved many of my problems.[/color]
        No problem.
        [color=blue]
        > I also had to set register_global s to ON to get the site working
        > properly.[/color]
        I'd advice against it since it defaults to OFF in new PHP versions
        and ISPs shall probably tend to leave it that way in future.

        Moreover global variables are a BIG NO NO in any structured programing
        language :). Yes, maybe, also a matter of taste :).

        Tomy.


        Comment

        Working...