I have a contact form, it works fine when hosted on my server, but when I uploaded it to my clients server I ran into problems. Please check out the page here: http://www.conceptonegfx.com/contact.php
I get the following errors at the top of the form
Notice: Use of undefined constant ’PHP_SELF’ - assumed '’PHP_SELF’' in E:Domainscconceptonegfx.comuserhtdocsfns.php on line 42
Notice: Undefined index: ’PHP_SELF’ in E:Domainscconceptonegfx.comuserhtdocsfns.php on line 42" id="uploadform" enctype="multipart/form-data">
Here are the problem lines on 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>
See Question&Answers more detail:
os 与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…