我有一個聯繫表單,它在我的服務器上託管時工作正常,但是當我將其上傳到我的客戶機服務器時,我遇到了問題。請查看這裏的頁面:http://www.conceptonegfx.com/contact.phpPHP表單 - 未定義常量'PHP_SELF'
我會在形式
通知的頂部以下錯誤:使用未定義的常量「PHP_SELF」的 - 在電子商務假定'PHP_SELF「」:\域\ C \ conceptonegfx.com \ user \ htdocs \ fns.php on line 42
注意:未定義的索引:E:\ Domains \ c \ conceptonegfx.com \ user \ htdocs \ fns.php中的'PHP_SELF'在第42行「 id =「uploadform」enctype =「multipart/form-data」>
以下是fns.php上的問題行:
<?php
//start session
if(!isset($_SESSION))
{
session_start();
}
// prints form
function print_form(){
?>
<form method="post" class="action="<?php echo $_SERVER[’PHP_SELF’];?>" id="uploadform" enctype="multipart/form-data">
<p><label for="namefrom">Name <span class="required">*</span></label>
<input name="namefrom" id="namefrom" type="text" class="field" value="<?= $_SESSION['myForm']['namefrom']; ?>" tabindex="1"/></p>
<p><label for="emailfrom">Email <span class="required">*</span></label>
<input name="emailfrom" id="emailfrom" type="text" class="field" value="<?= $_SESSION['myForm']['emailfrom']; ?>" tabindex="3"/></p>
<p><label for="phone">Phone</label>
<input name="phone" id="phone" type="text" class="field" value="<?= $_SESSION['myForm']['phone']; ?>" tabindex="4"/></p>
<p><label for="message">Message <span class="required">*</span></label>
<textarea name="comments" id="comments" rows="10" cols="35" align="left" class="field" tabindex="6"><?= $_SESSION['myForm']['comments']; ?></textarea></p>
<p><label for="attachment">File Upload<br /></label>
<input name="attachment" id="attachment" type="file" tabindex="7">
<p><input align="left" type="submit" name="submit" id="submit" value="Send Email" tabindex="8"/></p>
<p><input type="hidden" name="submitted" value="true" /></p>
</form>
@rdlowrey在那裏添加你的東西,並給你信用。 – Iznogood 2012-02-13 19:15:00
信用沒有必要,只是正確。 Downvote取消,upvote給出。每個人都會錯過一些東西(我確定)。重要的是編輯你的答案,如果有人發現你遺漏或錯誤的東西。 – rdlowrey 2012-02-13 19:19:18