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

  • Home
  • SEARCH
  • 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 8776857
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 13, 20262026-06-13T19:09:16+00:00 2026-06-13T19:09:16+00:00

I am developing a custom homepage background,in my html have <form action=’.$_SERVER[‘PHP_SELF’].’> <input type=text

  • 0

I am developing a custom homepage background,in my html have

<form action="'.$_SERVER['PHP_SELF'].'">
<input type="text" width="128px" name="mybg">
<input type="submit" value="Set as background">
</form>

<b style="position:absolute;height:100%;width:100%;top:0;left:0;z-index:-1;background:url('<?=$_SESSION['mybg'];?>');"></b>

and my php file:

if(isset($_GET['mybg'])){
session_set_cookie_params(3600 * 24 * 7);
session_start();
$_SESSION['mybg'] = $_GET['mybg'];
}

and my background image shown as post url,the url like "http://si.te/?mybg=http%3A%2F%2Fabc.com%2Fpic.jpg" but when i go back to the homepage(index.php) and the background image disappeared,how can I save that in the session?

I don’t want to use any sql please do not suggest that.

  • 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-13T19:09:17+00:00Added an answer on June 13, 2026 at 7:09 pm

    Your code is mainly correct, but you have to move the session_start() outside the if condition. If you don’t, the session will not be started when you go back to your homepage, and $_SESSION['mybg'] will not be set.

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

Sidebar

Related Questions

I am developing a custom control for WinRT. I have a property with type
I am developing a custom list-search tool. I have multiple custom properties to retain
I'm developing a custom control, which most resembles a text area. I am drawing
As a company specialized in developing custom CMS, we have been asked to deploy
Background : I'm developing a custom regex-like syntax for URL filenames. It will work
im developing a custom form and i need to put a button right next
I'm developing custom Media Controller and i have taken four button(play/pause,next,pre and bandwidth)inside a
I'm developing a custom aspx form for a SharePoint list in Visual Studio, basically
Does anyone have any good links for developing custom field and content types that
I am currently developing a custom map, but have one issue. I have several

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.