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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 23, 20262026-05-23T23:39:53+00:00 2026-05-23T23:39:53+00:00

Here is an example of what I am trying to do: index.php <ul><?php include(list.php)

  • 0

Here is an example of what I am trying to do:

index.php

<ul><?php include("list.php") ?></ul>

list.php

<?php
    if (PAGE_NAME is index.php) {
        //Do something
    }
    else {
        //Do something
    }
?>

How can I get the name of the file that is including the list.php script (PAGE_NAME)? I have tried basename(__FILE__), but that gives me list.php.

  • 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-05-23T23:39:54+00:00Added an answer on May 23, 2026 at 11:39 pm

    $_SERVER["PHP_SELF"]; returns what you want

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

Sidebar

Related Questions

Let's say my URL is this: http://example.com/forum/index.php?topic=53.msg251#msg251 This part here, I can't figure out
Here's an example of the query I'm trying to convert to LINQ: SELECT *
I am trying to integrate Qt with OpenCV. Here is the example: http www
I'm trying to comprehend ontology basics. Here's an example: car (class) 2009 VW CC
Here's what I've been trying to do, in a nutshell: class example <T extends
I'm trying to create an access control system. Here's a stripped down example of
Alright, here is my problem i'm trying to solve. I have an index page
I enabled URL rewriting on my PHP site with Apache ( http://example.com/index.php?param=12 becomes http://example.com/index/param/12
Ok I have a script in the folder 'intake'. The index.php file auto creates
I am trying to get the index of an element using jQuery to send

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.