Jump to content


Photo

Trying To Create A New Snippet

new snippet contact forms

  • Please log in to reply
4 replies to this topic

#1 Rodrigo

Rodrigo

    Etomite Forum Newbie

  • Member
  • 21 posts

Posted 14 December 2011 - 04:11 AM

Hello,

I am a newbie here, so please bare with me.

I am trying to create a new snippet that calls a php page located on a different location on the same server. I realize I could just use a wrapper, but I'm trying to embed the code because I believe that this would be great way to create simple as well as sophisticated contact forms using the a nifty little program.

Anyway, here is the code I am using:

//Embed form
// Usage: [[contact-form]]
$contact_form = 1; // set desired form number.
$contact_form_path = '/home/XYZ/public_html/my-folder/'; // set path to /contact-files/ with slash on end.
require $contact_form_path . 'contact-form-run.php';

As you can see, the snippet is simply requiring to run a particular php script (contact-form-run.php) which contains a form created using a form-creation script. When I place this snippet on a page within etomite, it does work perfectly, except that the form (the content of the snippet), appears before the HTML tag at the top of the page instead of the content of the page.

Can anybody tell me what I'm doing wrong? If this works, I would submit as a nice way to add forms to etomite.

Thanks,
Rodrigo

#2 Ralph

Ralph

    Loves Etomite Forums!

  • Admin
  • 6,539 posts

Posted 14 December 2011 - 04:28 AM

You do need a wrapper... The problem is that the echo commands in the external file are bypassing the parsers display routine... Using a wrapper snippet resolves this problem...

#3 Rodrigo

Rodrigo

    Etomite Forum Newbie

  • Member
  • 21 posts

Posted 14 December 2011 - 06:24 PM

I was afraid you'd say that, Ralph, but I appreciate it. Oh well, a wrapper it is.

Thanks,
Rodrigo

#4 lealand

lealand

    Etomite Forum Newbie

  • Member
  • 1 posts

Posted 13 April 2012 - 08:14 AM

As I know, use a wrapper can create a new snippet.but it is not so easy.

#5 andyou111

andyou111

    Etomite Forum Newbie

  • Member
  • 3 posts

Posted 10 May 2012 - 07:13 AM

You do need a wrapper... The problem is that the echo commands in the external file are bypassing the parsers display routine... Using a wrapper snippet resolves this problem...

i think use wrapper don't easy

Escort Nordjyllandrolex replicaas seen on tvgame poker

Edited by andyou111, 23 May 2012 - 05:21 AM.





0 user(s) are reading this topic

0 members, 0 guests, 0 anonymous users