Thank you very much for providing such an excellent tool and for free even.
Thank you for the exceptional How-To Guides.
Thank you for reading this post and possibly providing an answer. =)
Problem:
After the return link is clicked, the original contact form appears but without external styles applied nor images.
Possible Explanation:
The contact form's html code, which references the style sheet and images, is using a relative path. The fmbadhandler.php file does not know the correct root path to use. (The below code is truncated for example purposes)
Code:
<img src="images/image01.jpg"/>
Code:
<link href="styles/websitestyles.css" />
Wanted Solution:- After the return link is clicked, the original contact form appears as expected.
- A PHP variable is used to re-establish the root directory for the relative path within the contact form.
- The contact form does not require setting paths as either an absolute url or absolute path.
Steps Already Taken:
Changed the value of $SET_REAL_DOCUMENT_ROOT in both the files formmail.php and fmbadhandler.php to one of the following:- blank
- /home1/mysite/public_html
Understanding of folder tree and file placement:
Site Root: (/home1/mysite/)(folder) contactform (not accessible to the general public)
(file) formmail.ini
(file) contact_errors.htm (the HTML template for errors)
(folder) public_html (accessible to the general public by an internet browser)
(file) contact.htm
(file) thankyou.htm
(folder) images
(file) image01.jpg
(folder) scripts
(file) fmbadhandler.php
(file) formmail.php
(file) verifyimg.php
(folder) styles
(file) websitestyles.css
Referenced How-To-Guides:
- http://www.tectite.com/fmhowto/redir.php
- http://www.tectite.com/fmhowto/adverror.php
Form Hidden Fields: (contact.htm)
Code:
<input type="hidden" name="recipients" value="myvalue" />
<input type="hidden" name="mail_options" value="PlainTemplate=template_email.txt,AlwaysList" />
<input type="hidden" name="env_report" value="REMOTE_ADDR,HTTP_USER_AGENT,AUTH_TYPE,REMOTE_HOST,REMOTE_USER" />
<input type="hidden" name="good_url" value="http://the_name_of_the_website/thankyou.htm" />
<input type="hidden" name="bad_url" value="http://the_name_of_the_website/scripts/fmbadhandler.php" />
<input type="hidden" name="bad_template" value="contact_errors.htm" />
<input type="hidden" name="this_form" value="http://the_name_of_the_website/contact.htm" />
Error Page Fields: (contact_errors.htm)
Code:
<div id="contact_form_container"><div id="contact_form_container_quirks_IE8">
<h1 class="centered">Please correct these errors!</h1>
<div id="contact_form">
<p id="contact_form_error_message">[fmerror /]</p>
<ul id="contact_form_error_list">[fmerroritemlist /]</ul>
<p class="centered"><a href="$return_link">Return to form</a></p>
</div>
</div></div><!-- end #contact_form_container -->
PHP Variables: (formmail.php)
Code:
$SITE_DOMAIN = ""; // your website domain name
/* Help: http://www.tectite.com/fmdoc/site_domain.php */
$SET_REAL_DOCUMENT_ROOT = "/home1/mysite/public_html"; // overrides the value set by SetRealDocumentRoot function
/* Help: http://www.tectite.com/fmdoc/set_real_document_root.php */
$TARGET_URLS = array(); // default; no URLs allowed
/* Help: http://www.tectite.com/fmdoc/target_urls.php */
$TEMPLATEDIR = "/home1/mysite/contactform"; // directory for template files; empty string if you don't have any templates
/* Help: http://www.tectite.com/fmdoc/templatedir.php */
$TEMPLATEURL = ""; // default; no template URL
/* Help: http://www.tectite.com/fmdoc/templateurl.php */
define("PUT_DATA_IN_URL",false); // set to true to place data in the URL for bad_url redirects
/* Help: http://www.tectite.com/fmdoc/put_data_in_url.php */
PHP Variables: (fmbadhandler.php)
Code:
$TARGET_URLS = array("http://the_name_of_the_website/contact.htm"); // default; no URLs allowed
$SET_REAL_DOCUMENT_ROOT = "/home1/mysite/public_html"; // overrides the value set by SetRealDocumentRoot function
$TEMPLATEDIR = "/home1/mysite/contactform"; // directory for template files; empty string if you don't have any templates
Thank you in advance for any and all helpful replies.
Jonathan
Bookmarks