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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 15, 20262026-06-15T18:42:47+00:00 2026-06-15T18:42:47+00:00

I want to echo a variable on a page which I’ve included form a

  • 0

I want to echo a variable on a page which I’ve included form a different page. This to save space and separate php code from text data as much as possible.

In the page from where I fetch the variables (let’s call it “aa.php”) I have:

if ($whatever=="A") echo "somethingA";
if ($whatever=="B") echo "somethingB";
if ($whatever=="C") echo "somethingC";

I include it on the page where I want the data to show (let’s call it “data.php”):

include 'aa.php';
$whatever = "B";

I want “B” to show on data.php, but it isn’t echoing on the page at all (I’m guessing because it’s actually on the other page?) — How do I echo it on the page where I want the data to show, with as little clutter as possible?

  • 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-15T18:42:48+00:00Added an answer on June 15, 2026 at 6:42 pm

    The order seems to be the problem:

    $whatever = "B";
    include 'aa.php';
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have code which passes php variable to another page on my site: echo'<a
i want to echo $html variable (which contents html code of page) to browser
I want to make this form: echo '<form method=post action=ratinghandler.php style=width: 250px> <input type=hidden
i have value in php variable like that $var='2.500000550'; echo $var what i want
I have question,I want to redirect page using javascript which the code is to
I have two pages, A and B. I want to echo a variable written
I want to echo out each date in my Array within a PHP file.
I want to make a transition page, to forward URL to. I have this
I want to make a form which takes information then uses that information on
I'm passing information from one page another with following php code.. Index.php page: <?php

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.