Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 9323481
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 19, 20262026-06-19T04:21:19+00:00 2026-06-19T04:21:19+00:00

I am new in OOP with PHP and I’m trying to do something like

  • 0

I am new in OOP with PHP and I’m trying to do something like this:
Class entry form is inside it’s own file.
index.php creates an object from class entry form and stores it in session.
page1.php – I want to be able to call this object back and run some methods on it to modify it’s values. Except this is not working…

So the work flow is as follows
index->page1

I’m trying to grasp the concept of object orriented programming. And i’m starting to get it.
Is what I’m trying to do wrong? is this possible?

//page1.php

    include('entry.class.php');
    session_start();

    print_r($_SESSION['entry']);
    $entry = unserialize($_SESSION['Entry']);
    $entry->set_category('Asian');
    $entry->set_upload('http://paypal.com');

    print_r($entry);

//index.php
    session_start();
    include('entry.class.php');

    $entry = new entryForm();
    $entry->set_category('Blondes');
    $entry->set_upload('http://google.com');


    $_SESSION['entry'] = serialize($entry);

    print_r($entry);
    print_r($_SESSION['entry']);


//class entryform   


    class entryForm{


                            var $category;
                            var $upload;

                            function set_category($new_category)
                            {
                                    $this->category = $new_category;
                            }

                            function get_category()
                            {
                                    return $this->category;
                            }

                            function set_upload($new_upload)
                            {
                                    $this->upload = $new_upload;
                            }

                            function get_upload()
                            {
                                    return $this->upload;
                            }

                    }
  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-19T04:21:21+00:00Added an answer on June 19, 2026 at 4:21 am

    in your unserialize you wrote the ‘Entry’ Uppercase. while in the serialize you wrote ‘entry’, lowercase

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I'm new to PHP oop stuff. I'm trying to create class database and call
I made an PHP OOP Cart Class like this print_r($_SESSION[cart]); the result is: Array
I am new to PHP OOP. Below is my VERY FIRST class file. I
I think this is mostly because I'm new to PHP OOP, but I have
I'm trying to learn how to use oop in php. I'm also fairly new
I'm new to OOP in PHP, is that to seems correct ? class whatever
This is my second post today because I'm very new at OOP in PHP,
I am pretty new to OOP with PHP. OK first of all this produces
I am very new to OOP styled PHP, and I am trying to implement
When using OOP in PHP I've seen a lot of functions written like this:

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.