SitePoint Sponsor

User Tag List

Results 1 to 5 of 5
  1. #1
    SitePoint Member
    Join Date
    Jun 2003
    Location
    houston
    Posts
    5
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Reading Object or Variable values throughout the flow of a program

    I have a question that may be elementry to some. I just can't seem to be able to figure it out without some complex solution. I want to be able to create an instance of an object, lets say a user profile object. In one page (a php file) I want to be able to set some properties in this object. Now, if I were to switch to another page via hyperlink or form submit, I want to be able to read the property values of the object that I set from the other page. How can I do this without first serializing this data and saving it off somewhere and reloading it with each page?


    Any help would be greatly appreciated.


    John

  2. #2
    SitePoint Member
    Join Date
    May 2005
    Posts
    13
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    You cant access the same data in the class on another page without "saving" it somewhere. Maybe you could have your data in some hidden form fields and read them into the class on the forms target page?

  3. #3
    get into it! bigduke's Avatar
    Join Date
    May 2004
    Location
    Australia
    Posts
    847
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    stick the object in the session

  4. #4
    SitePoint Member
    Join Date
    Jun 2003
    Location
    houston
    Posts
    5
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Re design the PHP engine

    OK, That is what I was thinking. Even saving the object properties in the session would require serializing the data and always making a consious effort to store and retrieve it. PHP and WEB programming in general would be 100 times better if this simple functionality were available, like in regular programming languages.


    Thanks for listening to me vent a little

    John

  5. #5
    SitePoint Member
    Join Date
    Jun 2003
    Location
    houston
    Posts
    5
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    My last reply is a reasult of my frustration with web programming. I spend only 20% of my time writing an application and about 80% figuring out how I am going to save, store, or transfer information between pages. This is a huge waste of time.


    John


Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •