English 中文(简体)
网址包括PHP_SELF表属性问题
原标题:php include with PHP_SELF form attribute issues
  • 时间:2012-01-12 16:51:30
  •  标签:
  • php
  • forms

诚然,这是我试图解决的问题。 我有一个索引页,配备了一台实验室,其中包括服务器上的其他档案。 例如,一个文件来建造我的菜单等等。

在这些档案中,我正在与一个包含一个表格的目录一起工作,每个行各有一处删除的纽扣吨,以便用户必要时可以删除数据。 既然如此,表格的页正使用这一形式定义:

<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: Un Defintable:PHP_SELF in C:xampphtdocs websomefile.php on line39

第39条是属性。

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

该指数页的设置也一样:

<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>

页: 1 网址是上表一。

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!

最佳回答

您想要的数据实际上载于<代码>_美元。 SERVER[PHP_SELF]。

如果你期望确定一个称为<代码>的变量——PHP_SELF,我怀疑你被利用与一个服务器合作,该服务器网站register_globals,但这种情况很少发生。 如果是这样,你也应当知道通过<代码>_GET和_$_POST通过的各种变量。

问题回答

暂无回答




相关问题
Brute-force/DoS prevention in PHP [closed]

I am trying to write a script to prevent brute-force login attempts in a website I m building. The logic goes something like this: User sends login information. Check if username and password is ...

please can anyone check this while loop and if condition

<?php $con=mysql_connect("localhost","mts","mts"); if(!con) { die( unable to connect . mysql_error()); } mysql_select_db("mts",$con); /* date_default_timezone_set ("Asia/Calcutta"); $date = ...

定值美元

如何确认来自正确来源的数字。

Generating a drop down list of timezones with PHP

Most sites need some way to show the dates on the site in the users preferred timezone. Below are two lists that I found and then one method using the built in PHP DateTime class in PHP 5. I need ...

Text as watermarking in PHP

I want to create text as a watermark for an image. the water mark should have the following properties front: Impact color: white opacity: 31% Font style: regular, bold Bevel and Emboss size: 30 ...

How does php cast boolean variables?

How does php cast boolean variables? I was trying to save a boolean value to an array: $result["Users"]["is_login"] = true; but when I use debug the is_login value is blank. and when I do ...

热门标签