Author Topic: Add Contact Page  (Read 11845 times)

0 Members and 1 Guest are viewing this topic.

Offline Peaces

  • Newbie
  • *
  • Posts: 26
    • View Profile
Add Contact Page
« on: June 02, 2009, 04:31:35 PM »
I have read through the posts and watched the video as to creating a new Template page. I have successfully done so. I am wanting to make that additional page into a Contact page. The Contact scripting that I have requires the page to be .php.

When I create the new Template page it is .html. I have tried pasting the form contents from the Contact script into the html Template page but this obviously does not work.

Any suggestions as to how I need to make this work? Or other suggestions for creating a Contact page that has spam security and not use the one I have?

I am open to any suggestions.

Offline V@no

  • If you don't tell me what to do, I won't tell you where you should go :)
  • Administrator
  • 4images Guru
  • *****
  • Posts: 17.849
  • mmm PHP...
    • View Profile
    • 4images MODs Demo
Re: Add Contact Page
« Reply #1 on: June 02, 2009, 04:44:24 PM »
.php file can contain HTML, as long as it's outside <?php and ?> tags.
i.e.

Code: [Select]
<head>
  <title>mixed html with php</title
</head>
<body>
  <div>pure html output</div>
  <div>
<?php
    
echo "and some php output";
?>

  </div>
</body>
Your first three "must do" before you ask a question:
Please do not PM me asking for help unless you've been specifically asked to do so. Such PMs will be deleted without answer. (forum rule #6)
Extension for Firefox/Thunderbird: Master Password+    Back/Forward History Tweaks (restartless)    Cookies Manager+    Fit Images (restartless for Thunderbird)

Offline bergblume

  • Sr. Member
  • ****
  • Posts: 463
  • on to the top!
    • View Profile
Re: Add Contact Page
« Reply #2 on: June 02, 2009, 04:45:46 PM »
hi,

yes, your templates are in .html - but you have to call these site via ./index.php?template=YOURSITENAME  (e.g. index.php?template=contact)

BR, bergblume

Offline Peaces

  • Newbie
  • *
  • Posts: 26
    • View Profile
Re: Add Contact Page
« Reply #3 on: June 02, 2009, 04:50:22 PM »
Thanks!

Now off to give it a try....

Offline Peaces

  • Newbie
  • *
  • Posts: 26
    • View Profile
Re: Add Contact Page
« Reply #4 on: June 02, 2009, 05:30:29 PM »
Sorry for the immaturity here.

I have created a contact.php  -  I have created a contact.html (Template)
The contact.php does call the Template and views properly.

Do I apply the Contact Form script to the Template page or the .php page?

I have tried applying the script to either page. When I apply it to the .html, the form works but it takes away the fonts and other formatting from the Template. When applying to the .php page, I get a Fatal error for the line I added the Form script.

Here is the Form script.

Code: [Select]
<form action="" method="post" name="emailContact" onsubmit="WAValidateRQ(document.emailContact.Contact_Name,'- Please enter your name',document.emailContact.Contact_Name,0,false,'text');WAValidateEM(document.emailContact.Email_address,document.emailContact.Email_address.value,'- Please enter your email address',document.emailContact.Email_address,0,true);WAValidateRQ(document.emailContact.Comments,'- Please provide a comment so that we know how best to assist you',document.emailContact.Comments,0,true,'textarea');WAValidateRQ(document.emailContact.Security_code,'- Please enter the text as it appears in the image above',document.emailContact.Security_code,0,false,'text');WAValidateRQ(document.emailContact.Security_question,'- Please answer the question to ensure a human is filling out this form.',document.emailContact.Security_question,0,false,'text');WAAlertErrors('The following errors were found','Correct invalid entries to continue',true,false);return document.MM_returnValue">
        <div style="width:100%">
          <label for="Contact_Name" >Your name:</label>
          <br />
          <input name="Contact_Name" type="text" id="Contact_Name" class="inputValue" value="<?php echo(ValidatedField("contact","Contact_Name")) ?>" />
          <input name="addblock" type="text" id="addblock" style="display:none" value="" />
          <br />
            <?php
if (ValidatedField("contact","contact"))  {
  if ((
strpos((",".ValidatedField("contact","contact").","), "," "1" ",") !== false || "1" == ""))  {
    if (!(
false))  {
?>

             
          <p class="emailFormError">* Please provide your name.</p>
          <?php //WAFV_Conditional contact.php contact(1:)
    
}
  }
}
?>

          <br />
          <label for="Email_address" >E-mail address:</label>
          <br />
          <input name="Email_address" type="text" class="inputValue" id="Email_address" value="<?php echo(ValidatedField("contact","Email_address")) ?>" />
          <input name="seconddblock" id="seconddblock" type="text" style="display:none" value="">
          <br />
            <?php
if (ValidatedField("contact","contact"))  {
  if ((
strpos((",".ValidatedField("contact","contact").","), "," "2" ",") !== false || "2" == ""))  {
    if (!(
false))  {
?>

             
          <p class="emailFormError">* Please provide your email addess so we can get back in touch with you.</p>
  <?php //WAFV_Conditional contact.php contact(2:)
    
}
  }
}
?>

          <br />
         
          <label for="Comments" >Comments:</label>
          <br />
          <textarea name="Comments" id="Comments" class="inputText" ><?php echo(ValidatedField("contact","Comments")) ?></textarea>
          <br />
          <?php
if (ValidatedField("contact","contact"))  {
  if ((
strpos((",".ValidatedField("contact","contact").","), "," "3" ",") !== false || "3" == ""))  {
    if (!(
false))  {
?>

            <p class="emailFormError">* Please let us know how we can assist you.</p>
            <br />
            <?php //WAFV_Conditional contact.php contact(3:)
    
}
  }
}
?>

           
            <br />
            <input name="addblock2" type="text" id="addblock2" style="display:none" value="" />
          <br />
          <label for="Security_code" >type this Security code in the box below:</label>
          <br />
          <img src="WA_ValidationToolkit/WAVT_CaptchaSecurityImages.php?noisecolor=<?php echo $WAGLOBAL_Captcha_Noise?>&bgcolor=<?php echo $WAGLOBAL_Captcha_BG?>" alt="security code" /> <span class="style1"> NOT case sensitive.</span> <br  />
          <input name="Security_code" type="text" id="Security_code" class="inputValue" maxlength="40" />
          <br />
          <?php
if (ValidatedField("contact","contact"))  {
  if ((
strpos((",".ValidatedField("contact","contact").","), "," "4" ",") !== false || "4" == ""))  {
    if (!(
false))  {
?>

            <p class="emailFormError">* Your security code entry did not match the image.</p>
            <?php //WAFV_Conditional contact.php contact(4:)
    
}
  }
}
?>

          <br />
          <label for="Security_code" ><br />
          <label for="Security_question" >Please answer:</label>
          <?php require_once("WA_ValidationToolkit/WAVT_CaptchaSecurityQuestion.php"); ?></label>
          <br />
          <input name="Security_question" type="text" id="Security_question" class="inputValue" maxlength="40" />
          <br />
            <?php
if (ValidatedField("contact","contact"))  {
  if ((
strpos((",".ValidatedField("contact","contact").","), "," "5" ",") !== false || "5" == ""))  {
    if (!(
false))  {
?>

            <p class="emailFormError">* Your answer was not correct.</p>
            <?php //WAFV_Conditional contact.php contact(4:)
    
}
  }
}
?>

<br />
          <input type="submit" value="Submit" class="inputButton"/>
        </div>
      </form>
« Last Edit: June 03, 2009, 03:28:53 AM by V@no »

Offline V@no

  • If you don't tell me what to do, I won't tell you where you should go :)
  • Administrator
  • 4images Guru
  • *****
  • Posts: 17.849
  • mmm PHP...
    • View Profile
    • 4images MODs Demo
Re: Add Contact Page
« Reply #5 on: June 03, 2009, 03:32:48 AM »
It's hard to follow your description without visual examples and without knowing exactly what you did and how your script works.

Perhaps if you provide your contact.php and contact.html template we can help you out.

P.S.
use [code][/code] tags when posting code.

[Moving to programming discussion, as it doesn't seems to be related much to 4images itself]
Your first three "must do" before you ask a question:
Please do not PM me asking for help unless you've been specifically asked to do so. Such PMs will be deleted without answer. (forum rule #6)
Extension for Firefox/Thunderbird: Master Password+    Back/Forward History Tweaks (restartless)    Cookies Manager+    Fit Images (restartless for Thunderbird)

Offline Peaces

  • Newbie
  • *
  • Posts: 26
    • View Profile
Re: Add Contact Page
« Reply #6 on: June 04, 2009, 05:00:24 PM »
Thanks for your willingness to try and help me.

Here is the contact page (contact scripting)... http://PhotoPeaces.com/contactus.php
Here is the Template page... http://www.photopeaces.com/templates/default/contact.html

I would like the contact page to show up in the body of the Template when opening contactus.php.

My attempts so far have failed.

If you have a simpler contact script that I should be using, that's fine as well. I have been using this contact scripting for my other websites.

Offline mawenzi

  • 4images Moderator
  • 4images Guru
  • *****
  • Posts: 4.500
    • View Profile
Re: Add Contact Page
« Reply #7 on: June 04, 2009, 05:09:07 PM »
... and why you don't use ...
... [MOD] Contact Form : http://www.4homepages.de/forum/index.php?topic=8987.msg41855#msg41855 ...
... ? ...
Your first three "must do" before you ask a question ! ( by V@no )
- please read the Forum Rules ...
- please study the FAQ ...
- please try to Search for your answer ...

You are on search for top 4images MOD's ?
- then please search here ... Mawenzi's Top 100+ MOD List (unsorted sorted) ...

 

Post your comments here