Problems, need help? Have a tip or advice? Post it here.
4 posts Page 1 of 1
Hi, I've set up my contact form pretty much like the tutorial but I get this error when i tested it.

Internal Server Error
The server encountered an internal error or misconfiguration and was unable to complete your request.
Please contact the server administrator and inform them of the time the error occurred, and anything you might have done that may have caused the error.
More information about this error may be available in the server error log.
Apache/1.3.33 Server at http://www.fouridine.com Port 80


Here is my code for the contact form:

Code: Select all
                  <cms:form  action='' method='post' id='contact_form'>
                        <div class="hr dotted clearfix">&nbsp;</div>
                        <ul>                  
                            <li class="clearfix">
                                <label for="name">Name</label>
                                <cms:input type='text' name='name' id='name' required='1'/>
                                <div class="clear"></div>
                                <cms:if k_error_name>
                                   <p id='name_error' class='error' style='display:block'>Insert a Name</p>
                                </cms:if>
                            </li>
                            <li class="clearfix">
                                <label for="email">Email Address</label>
                                <cms:input type='text' name='email' id='email' required='1'/>
                                <div class="clear"></div>
                                <cms:if k_error_email>
                                   <p id='email_error' class='error' style='display:block'>Enter a valid email address</p>
                                </cms:if>
                            </li>
                            <li class="clearfix">
                                <label for="subject">Subject</label>
                                <cms:input type='text' name='subject' id='subject' required='1'/>
                                <div class="clear"></div>
                                <cms:if k_error_subject>
                                     <p id='subject_error' class='error' style='display:block'>Enter a message subject</p>
                                </cms:if>
                            </li>
                            <li class="clearfix">
                                <label for="message">Message</label>
                                <cms:input type='textarea' name='message' id='message' required='1' rows="20" cols="20"></cms:input>
                                <div class="clear"></div>
                                <cms:if k_error_message>
                                   <p id='message_error' class='error' style='display:block'>Enter a message</p>
                                </cms:if>
                            </li>
                            <li class="clearfix">
                            <cms:if k_success>
                                 <p id='mail_success' class='success' style='display:block'>Thank you. I'll get back to you as soon as possible.</p>
                               
                                 <cms:send_mail from=k_email_from to=k_mail_to subject='Feedback from your site'>     
                                    The following is an email sent by a visitor to your site:
                                    <cms:show k_success />
                                 </cms:send_mail>
                            </cms:if>
                                 
                               <p id='mail_fail' class='error'>Sorry, an error has occured. Please try again later.</p>
                            <div id="submit">
                           
                            <input type='image' id='send_message' class="button" value='Submit' src='images/btn_submit.png' />
                            </div>
                            </li>
                        </ul>
                    </cms:form>


I've also changed the config.php file with my appropriate email address.
Hi,

The part of your code that sends an email currently is
Code: Select all
<cms:send_mail from=k_email_from to=k_mail_to subject='Feedback from your site'>     
   The following is an email sent by a visitor to your site:
   <cms:show k_success />
</cms:send_mail>

whereas is should be -
Code: Select all
<cms:send_mail from=k_email_from to=k_email_to subject='Feedback from your site'>     
   The following is an email sent by a visitor to your site:
   <cms:show k_success />
</cms:send_mail>

See the difference?
You wrote to=k_mail_to instead of the correct to=k_email_to
There is no such variable as 'k_mail_to' and hence your code was trying to send email to a blank address. Ergo the server error.
Arrgh.. damn typos.. Thanks so much! I'd buy you coffee x5 if you were in my country.
:D
4 posts Page 1 of 1

Who is online

In total there are 15 users online :: 1 registered, 0 hidden and 14 guests
(based on users active over the past 5 minutes)

Users browsing this forum: Google [Bot] and 14 guests

cron