Jump to content


Contact Form and using EmailForm snippet


  • You cannot reply to this topic
4 replies to this topic

#1 patdpoo

    Etomite Forum Newbie

  • Member
  • 22 posts

Posted 04 January 2005 - 08:07 PM

I added the EmailForm snippet to my test contact page here:
http://www.craigandarla.com/index.php?id=20

Where do I delete the little drop down menu that is above the message box?

Thanks, Pat :)

#2 Ralph

    Loves Etomite Forums!

  • Admin
  • 6,524 posts
  • Gender:Male

Posted 04 January 2005 - 08:42 PM

patdpoo, on Jan 4 2005, 04:07 PM, said:

I added the EmailForm snippet to my test contact page here:
http://www.craigandarla.com/index.php?id=20

Where do I delete the little drop down menu that is above the message box?

Thanks, Pat :)
Although this question should have been posted in the EmailForm thread, here is your answer... Simply delete the section of code listed below:
$SendMail .= "<select name='subject'>n";
    foreach ($subject_array as $value2) {
$SendMail .= "<option value=" . '"'. $value2 .'"' . ">" . $value2 . "</option>n";
        }
$SendMail .= "</select><br><br>n";
This chunk of code simply loops through the $subject_array variable and uses its contents to create the drop-down select box... The recipient drop-down works in the same fashion using the code listed below:
$SendMail .= "<select name='to'>n";
    foreach ($recipient_array as $key => $value) {
$SendMail .= "<option value= " . $value . ">" . $key . "</option>n";
        }
$SendMail .= "</select><br><br>n";
You will also notice that there are references to these items at the top of the snippet... The email subject is extracted from the form variables using $the_subject = $_POST['subject'];
...

I won't go into further detail regarding the forms functionality as there are plenty of internet sites which cover basic HTML Forms generation... The only difference when creating forms within PHP snippets is that all HTML code is concatenated into a variable which is then returned to the parser for display during page rendering, $SendMail in this instance...

I hope this information gets you headed in the right direction... B)

#3 jaredc

    Loves Etomite Forums!

  • Member
  • PipPipPipPip
  • 1,193 posts

Posted 04 January 2005 - 08:43 PM

I believe if you remove these lines:

$SendMail .= "<select name='subject'>n";
    foreach ($subject_array as $value2) {
$SendMail .= "<option value=" . '"'. $value2 .'"' . ">" . $value2 . "</option>n";
        }
$SendMail .= "</select><br><br>n";
AND

Change the subject to a hard coded subject by changing this line:

   $the_subject = $_POST['subject'];
To something like:

   $the_subject = 'Email from web site form';
You should be good.

You should also know that each snippet has a support forum. The EmailForm Support Forum is the place to go when you have questions specifically about the snippet.

In the future, questions like these about specific snippets are best dealt with in their own support forums. The reason being, if others have questions about the same snippet, then all the answers will be in the same spot. And those investigating a snippet can stroll thru the support forum and see what problems people are having, or how the snippet is being used etc. The link to each snippets support forum is at the bottom of the snippets page in the library.

We're pretty soft on the newbies though. Welcome to Etomite.

#4 patdpoo

    Etomite Forum Newbie

  • Member
  • 22 posts

Posted 05 January 2005 - 05:54 AM

Thank you both for your help. It's fixed now. And thank you for being soft on me as a newbie to the forum. I'll be sure and look for more specific forum topics to post on in the future.

Pat :)

#5 jaredc

    Loves Etomite Forums!

  • Member
  • PipPipPipPip
  • 1,193 posts

Posted 05 January 2005 - 12:53 PM

No problem. Glad to have another Etomite enthusiast in our midst!





1 user(s) are reading this topic

0 members, 1 guests, 0 anonymous users