PHP-JSON

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

    PHP-JSON

    Hi all,

    Can anyone explain how to use JSON (JavaScript Object Notation) with
    php and post a sample, or any good site that has.

    Thanks

  • Aaron Askew

    #2
    Re: PHP-JSON

    Found this. Seems simple enough.



    -aaron

    Comment

    • Botan Guner

      #3
      Re: PHP-JSON

      I've found that sample too and i can convert my data into json format i
      just don't get how to send it and get new data with it.

      I'm trying to do something like;

      With one page, at first show the login page for example. After the
      user enters information like username and password, query the database
      and return a result that the information is valid and when it is valid
      show the user the main menu at the same page without refreshing the
      page.

      It can be done with json i think but my problem is how to pass the data
      to another page and get a new data without refreshing.

      Comment

      • Aaron Askew

        #4
        Re: PHP-JSON

        I'm not sure about doing this without refreshing. You could probably
        use frames and not reload the frame that holds your form (kind of like
        gmail uses). Of course, this would require a lot of javascripting.

        JSON is just a format in which to transfer data. It is written so that
        the eval() function in javascript can handle the data very easily. If
        you're querying a database (which is server side), I don't think that
        javascript (client side) will play a large role.

        Does this project require the page not be refreshed?

        Comment

        • Andy Hassall

          #5
          Re: PHP-JSON

          On 24 May 2005 01:18:38 -0700, "Botan Guner" <botan.guner@gm ail.com> wrote:
          [color=blue]
          >I've found that sample too and i can convert my data into json format i
          >just don't get how to send it and get new data with it.
          >
          >I'm trying to do something like;
          >
          >With one page, at first show the login page for example. After the
          >user enters information like username and password, query the database
          >and return a result that the information is valid and when it is valid
          >show the user the main menu at the same page without refreshing the
          >page.
          >
          >It can be done with json i think but my problem is how to pass the data
          >to another page and get a new data without refreshing.[/color]

          JSON is a format typically used in conjunction with XMLHTTPRequest Javascript
          objects, which let you retrieve data in Javascript in response to user actions,
          without a complete page refresh.

          Also search for "Ajax" which is the currently fashionable name for joining
          together the various techniques involved.

          --
          Andy Hassall / <andy@andyh.co. uk> / <http://www.andyh.co.uk >
          <http://www.andyhsoftwa re.co.uk/space> Space: disk usage analysis tool

          Comment

          • Botan Guner

            #6
            Re: PHP-JSON

            Thanx all, i've found what i was looking for. it was XMLHttpRequest not
            JSON... any way wrong question but true answer came.

            Comment

            Working...