$ _SERVER ['PATH_INFO'] ..未定义的索引:PATH_INFO [英] $_SERVER['PATH_INFO'] ..Undefined index: PATH_INFO

查看:123
本文介绍了$ _SERVER ['PATH_INFO'] ..未定义的索引:PATH_INFO的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

  $ fullurl = $ _ SERVER ['PATH_INFO']; 
echo'
< form action ='。$ fullurl。'method =POST>
< table width =1000border =1cellpadding =10id =navigationBar>
< tr>
< td> < a href =/ PoliticalForum / Registration.php>注册< / a>< / td>
< td> < a href =/ PoliticalForum / controlPanel.php>控制面板< / a>< / td>
< td> < a href =/ PoliticalForum / checkEmail.php>捐赠< / a> < / TD>
< td align =right> name:< input name =nametype =text/>< / td>
< td>密码:< input name =passtype =text/> < input name =logintype =submitvalue =Login/> < / TD>
< / tr>
< / table>
< / form>
';

我使用require包含页面文件头部。我想要的是fullurl变量来获取它的required_once的完整网址,当我点击提交时,我希望它重定向到页面上的页面..我将url添加到动作的形式..



但我得到的是这样的:

 未定义的索引:PATH_INFO 

我尝试使用这些:

  explode('/',substr(parse_url($ _ SERVER ['REQUEST_URI'],PHP_URL_PATH),1)); 

$ _ENV ['PATH_INFO'];

但他们也没用:($ / b>

解决方案

 < form action =method =POST> 
b
$ b

这就是所有

另外,回显原始HTML没有意义 -
使用此代码而不是你的

 ?> 
< form action =method =POST>
< tr>
< td>< a href =/ PoliticalForum /Registration.php>注册< / a>< / td>
< td>< a href =/ PoliticalForum / controlPanel.php>控制面板< / a>< td>
< td>< a href =/ PoliticalForum / checkEmail.php>捐赠< / a>< / td>
< td align =right> name :< input name =nametype =text/>< / td>
< td> password:< input name =passtype =text/><输入名称=登录类型=submi tvalue =登录/> < / TD>
< / tr>
< / table>
< / form>


I am using a code to be put as a header:

$fullurl=$_SERVER['PATH_INFO'];
    echo '
      <form action="'. $fullurl .'" method="POST">
      <table width="1000" border="1" cellpadding="10" id="navigationBar">
          <tr>
            <td> <a href="/PoliticalForum/Registration.php">Register</a></td>
            <td> <a href="/PoliticalForum/controlPanel.php">Control Panel</a></td>
            <td> <a href="/PoliticalForum/checkEmail.php">Donate</a> </td>
            <td align="right">name:<input name="name" type="text" /></td>
            <td>password:<input name="pass" type="text" /> <input name="login" type="submit" value="Login" /> </td>
          </tr>
       </table>
           </form>
       ';

I include the header across page files with the require once. What I want is that the fullurl variable to obtain the full url of the page it is "required_once" on, and when I click submit, I want it to redirect to the page the header is on.. I added the url onto the action of the form..

But what I get is this:

Undefined index: PATH_INFO

I tried to use those instead:

explode('/', substr(parse_url($_SERVER['REQUEST_URI'], PHP_URL_PATH),1));

$_ENV['PATH_INFO'];

But they didnt work too :(

解决方案

  <form action="" method="POST">

that's all

also, there is no point in echoing raw HTML
use this code instead of yours

?>
  <form action="" method="POST">
  <table width="1000" border="1" cellpadding="10" id="navigationBar">
      <tr>
        <td> <a href="/PoliticalForum/Registration.php">Register</a></td>
        <td> <a href="/PoliticalForum/controlPanel.php">Control Panel</a></td>
        <td> <a href="/PoliticalForum/checkEmail.php">Donate</a> </td>
        <td align="right">name:<input name="name" type="text" /></td>
        <td>password:<input name="pass" type="text" /> <input name="login" type="submit" value="Login" /> </td>
      </tr>
   </table>
       </form>

这篇关于$ _SERVER ['PATH_INFO'] ..未定义的索引:PATH_INFO的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆