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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 28, 20262026-05-28T05:14:00+00:00 2026-05-28T05:14:00+00:00

Alright, here is my problem i’m trying to solve. I have an index page

  • 0

Alright, here is my problem i’m trying to solve. I have an index page built with a bunch of php includes to other files on the server. For example, a file to build my menu’ing, etc.

Of those files, i am working with a include that builds a table on the page with a delete button on each row, so that the data can be removed by the user if needed. With that being said, the page that builds the table is using this form definition:

<form name=somename id=someid method=post action=<?php $PHP_SELF?>

Well whats happening is, when the delete is executed the form tries to post to itself and it throws an error into the address bar of:

Notice: Undefined variable: PHP_SELF in C:\xampp\htdocs \web\somefile.php on line 39

Line 39 is the form attribute.

=================================

The setup of the index page that contains this is like so:

<div id="container">
    <div id="left">
        <p>Welcome <?php echo $_SESSION['USERFIRSTNAME']?> <?php echo $_SESSION['USERLASTNAME']?></p>
    </div>
    <div id="right">
        <?php 
            //navigation menu
            include('menu.php');
        ?>
    </div> <!-- menu div -->
    <div class="clear"></div>
</div> <!-- container div -->
<div id="userlist">
    <?php 
        //build user access links
        //include('userlist.php');
    ?>
</div><!-- user list div -->
<div id="dbview">
    <?php 
        include('dbview.php');
    ?>
</div>

the dbview.php builds the table i was speaking about above.

I’m trying to figure out how i can execute the delete (which simply updates a db row) while it refreshes back to the index page. The current code which i’m using to handle the post doesn’t seem to be working:

if (($someresult)&& ($anotherresult))
                    {
                        echo'<font color="#FF0000">You have successfully  removed item </font>';
                        header('Location: index.php');
                         exit;
                    }
                    else
                    {
                        echo'<font color="#FF0000">Error while Removing</font>';
                    }

all the issue seems to be with the $PHP_SELF part, but i need some assistance. I’m sorry for the drawn out post. Hopefully it makes sense. If more code needs to be posted i can do that as well. Thanks again!

  • 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-28T05:14:01+00:00Added an answer on May 28, 2026 at 5:14 am

    The data you want is actually held in $_SERVER['PHP_SELF'].

    If you are expecting a variable called $PHP_SELF to be defined, I suspect you are used to working with a server where register_globals was enabled, which is rarely the case any more. If this is the case, you should also be aware the variables passed through $_GET and $_POST will also not be defined.

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

Sidebar

Related Questions

Alright, so here's my problem. I'm trying to write a script in PHP that
alright so i have a small problem here, i have this here. - (void)alertView:(UIAlertView
Alright so here is the question. I have a user class which contains a
Alright, so heres my problem: I have an application I am working with that
Alright, here we go. I have a cocos2d app, and there are targets that
I have a very recurrent problem here. (it happens literally all the time). I
Alright, so here's the portion of my code that is giving me a problem.
Alright, this problem seems to be way above my head! I have this code:
I will describe the problem as simple as i can. alright, here goes the
I have written this piece of code here and I have linked it alright

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.