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 8909421
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 15, 20262026-06-15T03:25:37+00:00 2026-06-15T03:25:37+00:00

Did My research on this,Couldn’t find what i was looking for. class headerStyle{ //

  • 0

Did My research on this,Couldn’t find what i was looking for.

class headerStyle{
 // now  creating our CONSTRUCTOR function
 function __construct($args=array()) {
     $this->fields = array('background','color','fontSize','backgroundUrl','imagePosition','Width','Height','backgroundSize','margin','padding','backgroundRepeat');
      foreach ($this->fields as $field) {
                $this->{"$field"} = $args["$field"];
                 }
         }
}


$style = new headerStyle(
       array(
         background =>"#DEDEDC",
         color=>"#F5F3F4",
         fontSize=>"24px",
         backgroundUrl=>"_images/bodyBg1.jpg",
         backgroundSize=>"50% 50%",
         padding=>"10px 0px 0px 0px",
         margin=>"0px 0px 0px 0px",
         width=>"100%",
         height=>"60px",
         imagePosition=>"top-left",
            )
);

instead of giving a value i need to pass a dynamic variable like background=>$_post[‘headerBg’];

  • 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-15T03:25:38+00:00Added an answer on June 15, 2026 at 3:25 am

    You’re almost there. The POST array in PHP can be accessed with $_POST['headerBg']; (notice it’s uppercase).

    class headerStyle{
     // now  creating our CONSTRUCTOR function
     function __construct($args=array()) {
         $this->fields = array('background','color','fontSize','backgroundUrl','imagePosition','Width','Height','backgroundSize','margin','padding','backgroundRepeat');
          foreach ($this->fields as $field) {
                    $this->{"$field"} = $args["$field"];
                     }
             }
    }
    
    
    $style = new headerStyle(
           array(
             background =>$_POST['headerBg'],
             color=>"#F5F3F4",
             fontSize=>"24px",
             backgroundUrl=>"_images/bodyBg1.jpg",
             backgroundSize=>"50% 50%",
             padding=>"10px 0px 0px 0px",
             margin=>"0px 0px 0px 0px",
             width=>"100%",
             height=>"60px",
             imagePosition=>"top-left",
                )
    );
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Did my research on this, couldn't find what I was looking for. Tried ReflectionClass
I did some research but couldn't find the answer I was looking for so
I did a lot of research on this subject but couldn't find any end
I did a series of research on this topic, but unfortunately I couldn't find
Alright I did a little bit of research on this but I couldn't find
As usual, i did a little research, but couldn't quite find the answer on
I did some research and couldn't find a suitable answer so I'm reaching out.....
I did some research but all I could find was syncing data core with
I did some research but cannot find a definite approval or disapproval. What I
I did a little research and I didn't find a way, anyone know? c#

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.