失敗下面的代碼:PHP Echo在行情
<form method="POST" action="<? echo $PHP_SELF; ?>" enctype="multipart/form-data">
它顯示爲HTML:<form method="POST" action="<? echo $PHP_SELF; ?>" enctype="multipart/form-data">
PHP可以在我的代碼的其餘部分,但是這其中有我渴望我的頭
編輯:
下面是顯示它的代碼:
<?
$AssignedTo = $_POST['id'];
if (isset ($_POST['submit'])) // if the form was submitted, display their name
{
// Action to be completed once the form is submitted
}
else // form hasn't been submitted, so display the form
{
echo '<form method="POST" action="<?php echo $PHP_SELF; ?>" enctype="multipart/form-data">
<h2>**** - Add </h2>
</form>';
}
?>
這將工作得很好。這裏需要更多信息。 – Brad 2010-11-17 15:52:36
檢查以前代碼中打開的引號或打開php標籤例如:<?php ..... – infinity 2010-11-17 16:02:48
另請注意,'$ PHP_SELF'本身並不是一個有效的變量(您需要定義它)。查看[保留變量列表](http://php.net/manual/en/reserved.variables.php)和[保留常量列表](http://php.net/manual/en/reserved。 constants.php)。您正在查找的信息位於$ _SERVER ['PHP_SELF']'中:請參閱[$ _SERVER'上的文檔](http://www.php.net/manual/en/reserved.variables.server。 PHP)。 – ircmaxell 2010-11-17 16:13:44