odd problem calling object methods

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

    odd problem calling object methods

    Hi.

    I was wondering whether anyone else could see anything wrong with this code:

    <input name="name" type="text" id="name"
    value="<?php print @$_SESSION['elements']['name']->getValue();?>" >



    When my browser tries to display this page I get the page and form down to
    this line where I get this displayed

    <input name="name" type="text" id="name" value="

    and the rendering stops.

    It worked yesterday, then I suddenly got this problem and I don't know why.
    It also works on another win2000 pc.

    Also, if I change the above code to direct variable access like below, it
    works fine :

    <input name="name" type="text" id="name"
    value="<?php print @$_SESSION['elements']['name']->value;?>">

    Personally, I'm mystified.


  • Pedro

    #2
    Re: odd problem calling object methods

    Bill wrote:
    [edited][color=blue]
    > <?php print @$_SESSION['elements']['name']->getValue();? >
    > does not work, however
    >
    > <?php print @$_SESSION['elements']['name']->value;?>
    > works as expected
    >
    > Personally, I'm mystified.[/color]

    read
    PHP is a popular general-purpose scripting language that powers everything from your blog to the most popular websites in the world.



    Do you have the class to which $_SESSION['elements']['name'] belongs
    declared in the script with those print statements?


    --
    I have a spam filter working.
    To mail me include "urkxvq" (with or without the quotes)
    in the subject line, or your mail will be ruthlessly discarded.

    Comment

    • Bill

      #3
      Re: odd problem calling object methods


      "Pedro" <hexkid@hotpop. com> wrote in message
      news:bo9bbv$1b3 1on$1@ID-203069.news.uni-berlin.de...[color=blue]
      > Bill wrote:
      > [edited][color=green]
      > > <?php print @$_SESSION['elements']['name']->getValue();? >
      > > does not work, however
      > >
      > > <?php print @$_SESSION['elements']['name']->value;?>
      > > works as expected
      > >
      > > Personally, I'm mystified.[/color]
      >
      > read
      > http://www.php.net/manual/en/languag...ialization.php
      >
      >
      > Do you have the class to which $_SESSION['elements']['name'] belongs
      > declared in the script with those print statements?[/color]

      Absolutely. As I said: exactly the same script works fine on another win2000
      machine, and if I edit out the method call and replace it with the value
      itself -

      print @$_SESSION['elements']['name']->getValue()

      to

      print @$_SESSION['elements']['name']->value


      it works fine. Change it back and bang, it crashes again.


      Comment

      • Pedro

        #4
        Re: odd problem calling object methods

        Bill wrote:
        [...][color=blue]
        > it works fine. Change it back and bang, it crashes again.[/color]

        do you have anything in the logs?

        php.ini

        error_reporting = E_ALL
        log_errors = On
        error_log = /path/to/error.log


        --
        I have a spam filter working.
        To mail me include "urkxvq" (with or without the quotes)
        in the subject line, or your mail will be ruthlessly discarded.

        Comment

        • Bill

          #5
          Re: odd problem calling object methods


          "Pedro" <hexkid@hotpop. com> wrote in message
          news:bo9fg6$1c8 4rp$1@ID-203069.news.uni-berlin.de...[color=blue]
          > Bill wrote:
          > [...][color=green]
          > > it works fine. Change it back and bang, it crashes again.[/color]
          >
          > do you have anything in the logs?
          >
          > php.ini
          >
          > error_reporting = E_ALL
          > log_errors = On
          > error_log = /path/to/error.log[/color]

          I set up php.ini as above, replicated the problem, and nothing was written.
          :(



          Comment

          Working...